/* The web client's page styles; the brand tokens they use are inlined by the layout. */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* The device's own reading face, as in the Mac app: SF Pro on Apple devices, Segoe UI on Windows, the desktop's elsewhere. Not the
   kit's interface token, whose Outfit only a browser with it installed drew. Segoe UI comes before system-ui, which a Windows CJK
   locale maps to a face that sets Latin poorly. */
body { background: var(--am-color-canvas); color: var(--am-color-text);
  font: var(--am-type-body-weight) var(--am-type-body-size)/var(--am-type-body-line-height) -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
/* Without color-scheme a dark page keeps the browser's white scrollbar, and a browser with no scrollbar-color
   (Safari before 26.2) still draws its own; ::-webkit-scrollbar would pin Safari's overlay scrollbars open. */
:root { color-scheme: light dark; scrollbar-color: var(--am-color-border) transparent; }
/* A theme picked in Settings holds against the computer's (Layout paints it); unpicked follows it. */
:root[data-am-theme="day"] { color-scheme: light; }
:root[data-am-theme="night"] { color-scheme: dark; }
* { scrollbar-width: thin; }
:root:has(.app), :root:has(.app) body { overflow: hidden; }
.app { display: flex; height: 100dvh; overflow: hidden; }
.chat { display: flex; flex: 1; min-width: 0; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; padding: 0 var(--am-space-4); }
.sidebar { position: relative; container: sidebar / inline-size; display: flex; flex: none; flex-direction: column; width: var(--sidebar-width, 260px); padding: var(--am-space-2) var(--am-space-3) var(--am-space-4);
  background: var(--am-color-canvas); border-right: var(--am-border-thin) solid var(--am-color-divider); }
.sidebar-search { display: flex; align-items: center; gap: var(--am-space-2); flex: none; width: 100%; min-height: 36px; margin: 0 0 var(--am-space-2);
  padding: 0 var(--am-space-3); font: inherit; font-size: var(--am-type-caption-size); color: var(--am-color-text-muted); text-align: left;
  background: var(--am-color-surface); border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-control); cursor: pointer; }
.sidebar-search svg { flex: none; }
.sidebar-search:hover { color: var(--am-color-text); border-color: var(--am-color-border); background: var(--am-color-surface-raised); }
@media (pointer: coarse) { .sidebar-search { min-height: var(--am-metric-touch-target); } }
/* The 16px grab strip draws a faint 2px line: a full focus fill read as a black bar, and full border ink was too heavy on cream.
   Chromium treats script focus after a drag as focus-visible, so data-pointer reserves the strong line for keyboard use. */
.sidebar-resize { position: absolute; z-index: 3; inset: 0 -8px 0 auto; width: 16px; cursor: col-resize; touch-action: none; }
.sidebar-resize::after { content: ""; position: absolute; inset: 0 calc(50% - 1px); border-radius: var(--am-radius-pill); background: var(--am-color-border); opacity: 0;
  transition: opacity var(--am-motion-quick) var(--am-motion-ease); }
.sidebar-resize:hover::after { opacity: 0.35; }
.sidebar-resizing .sidebar-resize::after { opacity: 0.7; }
.sidebar-resize:focus-visible { outline: none; }
:root:not(.sidebar-resizing) .sidebar-resize:focus-visible:not([data-pointer])::after { background: var(--am-color-focus); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sidebar-resize::after { transition: none; } }
.sidebar-resizing, .sidebar-resizing * { cursor: col-resize !important; user-select: none !important; }
.sidebar-resizing iframe { pointer-events: none; }
.nav-rows a, .shelf a, .all a { display: flex; align-items: center; gap: var(--am-space-2); border-radius: var(--am-radius-control);
  color: var(--am-color-text); font-weight: var(--am-type-body-weight); text-decoration: none; }
.nav-rows a, .shelf a { min-height: 36px; padding: 0 var(--am-space-3); }
/* A touch screen keeps no hover: the phone's drawer slides Today in under the finger that pressed the menu button. */
@media (hover: hover) { .nav-rows a:hover, .shelf a:hover, .all a:hover { background: var(--am-color-surface-raised); } }
.shelf { display: flex; flex-direction: column; padding-bottom: var(--am-space-2); }
.nav-lists section + section { margin-top: var(--am-space-4); }
/* The Mac's crown: the name's own ink, just after it, and never squeezed out by a long name. */
.crown { flex: none; margin-left: -4px; }
.nav-rows .crown { margin-left: 0; }
.panel-card .crown { width: 16px; height: 16px; margin-left: 0; }
/* The Mac's AntHead: the brand head at 84%, a little low, on its enamel disc inside a hairline ring. */
.head { flex: none; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 var(--am-border-thin) var(--am-color-divider);
  background: url(ant-head.png) 50% 69% / 84% no-repeat var(--enamel); }
[data-face="vermilion"] { --enamel: var(--am-palette-vermilion); }
[data-face="metal"] { --enamel: var(--am-palette-metal); }
[data-face="sage"] { --enamel: var(--am-palette-sage); }
[data-face="deep-sage"] { --enamel: var(--am-palette-sage-deep); }
[data-face="ivory"] { --enamel: var(--am-palette-ivory); }
[data-face="brown"] { --enamel: var(--am-palette-muted); }
.shelf svg, .all svg { flex: none; }
.nav-rows a[aria-current], .shelf a[aria-current] { background: var(--am-color-selection); color: var(--am-color-selection-text); }
.sidebar :is(a, button):focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: -2px; }
/* Everything, Pinned and Recents share one quiet scroller; Search stays at the top and All/Account at the bottom.
   No scrollbar gutter sits beside the 16px resize edge; a phone drawer scrolls whole instead. */
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; padding-bottom: var(--am-space-2); }
.sidebar-scroll::-webkit-scrollbar { display: none; }
.nav-lists { min-height: 0; }
.nav-label { position: sticky; top: 0; z-index: 1; background: var(--am-color-canvas); display: flex; align-items: center; justify-content: space-between; min-height: 28px; padding: var(--am-space-2) var(--am-space-3) 0;
  color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.nav-label h2 { margin: 0; font: inherit; font-weight: var(--am-type-caption-weight); }
.nav-empty { margin: var(--am-space-1) 0; padding: 0 var(--am-space-3); color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.nav-rows { margin: 0; padding: 0; list-style: none; }
.nav-rows > li { display: flex; align-items: center; position: relative; }
.nav-rows > li > a { flex: 1; min-width: 0; }
.nav-rows .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-rows svg { flex: none; }
.nav-remove { display: grid; flex: none; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--am-color-text-muted); background: none; border: 0; border-radius: var(--am-radius-control); cursor: pointer; }
.nav-remove:hover, .nav-grip:hover { color: var(--am-color-text); background: var(--am-color-surface-raised); }
/* Six dots at the default stroke read much lighter than the X beside them, so the dots are drawn bolder. */
.nav-grip svg { stroke-width: 3.5; }
.nav-grip { display: grid; flex: none; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--am-color-text-muted); background: none; border: 0; border-radius: var(--am-radius-control); cursor: grab; }
/* On touch the grip is hidden: its arrow keys need a keyboard, and the two 44px keys would leave a name about eight characters. */
@media (hover: none) { .nav-rows a, .shelf a { min-height: 44px; } .nav-remove { width: 44px; height: 44px; } .nav-grip { display: none; } }
/* With a mouse the two Edit keys are narrower, so a long name keeps more of its room. */
@media (hover: hover) { .nav-remove, .nav-grip { width: 24px; } }
/* A drag over Pinned: the section reads as the target, and a 2px line (drawn, so no row moves) shows where it lands. */
#nav-pinned.drop-on { background: var(--am-color-surface-raised); border-radius: var(--am-radius-control); }
.nav-rows > li.drop-before::before, .nav-rows > li.drop-after::after { content: ""; position: absolute; left: 0; right: 0; z-index: 2; height: 2px; background: var(--am-color-text); pointer-events: none; }
.nav-rows > li.drop-before::before { top: -1px; }
.nav-rows > li.drop-after::after { bottom: -1px; }
.all { display: flex; align-items: center; justify-content: center; gap: var(--am-space-1); padding: var(--am-space-2) 0 var(--am-space-3); border-top: var(--am-border-thin) solid var(--am-color-divider); color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.all a { gap: 4px; padding: 4px 6px; color: inherit; font-weight: inherit; }
.all a:hover { color: var(--am-color-text); }
/* The Pin key sits at a tile's corner beside its link: a button cannot live inside a link. */
.pin-key { position: absolute; top: -1px; right: -1px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--am-color-text);
  background: none; border: 0; cursor: pointer; }
/* The disc is the ground, so a glyph reads on a dark preview and on a light one; its key keeps a 44px touch target. */
.pin-key::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--am-color-canvas);
  box-shadow: 0 0 0 1px var(--am-color-border), var(--am-elevation-key); }
.pin-key svg { position: relative; }
.pin-key:hover::before { background: var(--am-color-surface-inset); }
.pin-key[aria-pressed="true"] { color: var(--am-color-canvas); }
.pin-key[aria-pressed="true"]::before, .pin-key[aria-pressed="true"]:hover::before { background: var(--am-color-text); box-shadow: none; }
.pin-key[aria-pressed="true"] svg { fill: currentColor; }
.pin-key:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
@media (hover: hover) {
  .pin-key { top: 6px; right: 6px; width: 30px; height: 30px; }
  .pin-key::before { inset: 0; }
  :is(.tile, .tiles li):not(:hover, :focus-within) > .pin-key[aria-pressed="false"] { opacity: 0; pointer-events: none; }
}
.account { padding-top: var(--am-space-3); border-top: var(--am-border-thin) solid var(--am-color-divider); }
.account > button { display: flex; align-items: center; gap: var(--am-space-2); width: 100%; padding: var(--am-space-2); font: inherit;
  font-weight: var(--am-type-label-weight); text-align: left; color: var(--am-color-text); background: none; border: 0;
  border-radius: var(--am-radius-control); cursor: pointer; }
.account > button:hover, .account > button:has(+ :popover-open) { background: var(--am-color-surface-raised); }
.avatar { position: relative; display: grid; flex: none; place-items: center; width: 28px; height: 28px; overflow: hidden; border-radius: 50%;
  background: var(--am-color-text-muted); color: var(--am-color-canvas); font-size: var(--am-type-caption-size); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chevron { flex: none; margin-left: auto; }
.account > button:has(+ :popover-open) .account-chevron { transform: rotate(180deg); }
#account-menu { inset: auto auto calc(var(--am-space-4) + var(--am-space-3) + 28px + 3 * var(--am-space-2)) var(--am-space-3);
  width: calc(260px - 2 * var(--am-space-3)); margin: 0; padding: var(--am-space-1); color: var(--am-color-text); background: var(--am-color-surface);
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-panel); box-shadow: var(--am-elevation-panel); }
#account-menu :is(a, button) { display: flex; align-items: center; gap: var(--am-space-3); min-height: var(--am-metric-touch-target); width: 100%; padding: var(--am-space-2) var(--am-space-3); font: inherit; text-align: left;
  color: inherit; text-decoration: none; background: none; border: 0; border-radius: var(--am-radius-control); cursor: pointer; }
#account-menu :is(a, button):hover { background: var(--am-color-surface-inset); }
#account-menu svg { flex: none; }
#menu-sign-out { margin-top: var(--am-space-1); padding-top: var(--am-space-1); border-top: var(--am-border-thin) solid var(--am-color-divider); }
.account > button:focus-visible, #account-menu :is(a, button):focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
#jump { top: 14vh; width: min(560px, calc(100vw - 2 * var(--am-space-4))); margin: 0 auto; padding: 0; overflow: hidden; color: var(--am-color-text);
  background: var(--am-color-surface); border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-panel); box-shadow: var(--am-elevation-panel); }
#jump::backdrop { background: rgb(0 0 0 / 0.3); }
#jump .jump-refused { margin: 0; padding: var(--am-space-4) var(--am-space-4) 0; color: var(--am-color-error); }
#jump input { display: block; width: 100%; padding: var(--am-space-4); font: inherit; font-size: var(--am-type-title-size, 17px); color: inherit; background: none; border: 0;
  border-bottom: var(--am-border-thin) solid var(--am-color-divider); outline: 0; }
#jump [role="listbox"] { display: flex; flex-direction: column; gap: var(--am-space-1); max-height: 50vh; overflow-y: auto; padding: var(--am-space-2); }
#jump [role="listbox"]:empty::after { content: "Nothing by that name"; padding: var(--am-space-2) var(--am-space-3); color: var(--am-color-text-muted); }
#jump [role="option"], .mentions [role="option"] { display: flex; flex: none; min-width: 0; overflow: hidden; align-items: center; gap: var(--am-space-3); min-height: var(--am-metric-touch-target); padding: var(--am-space-2) var(--am-space-3);
  font: inherit; font-weight: var(--am-type-label-weight); text-align: left; color: inherit; background: none; border: 0; border-radius: var(--am-radius-control); cursor: pointer; }
#jump [role="option"] svg, .mentions [role="option"] svg { flex: none; width: 28px; }
#jump [role="option"][aria-selected="true"], .mentions [role="option"][aria-selected="true"] { background: var(--am-color-selection); color: var(--am-color-selection-text); }
#jump .capture-row { gap: 0; }
#jump .capture-row::before { content: "+"; flex: none; width: 28px; margin-inline-end: var(--am-space-3); text-align: center; font-size: 18px; }
#jump .file-row::before { content: ""; flex: none; width: 28px; height: 20px; background: currentColor; opacity: .7;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l4 4v14H6z'/%3E%3Cpath d='M14 3v4h4'/%3E%3C/svg%3E") center / contain no-repeat; }
#jump .who, .mentions .who, #jump .capture-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#jump .capture-end { flex: none; }
#jump .role, .mentions .role { flex: none; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: var(--am-space-2); color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); font-weight: var(--am-type-caption-weight); }
.menu { display: none; place-items: center; width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); margin-left: calc(-1 * var(--am-space-2));
  padding: 0; color: var(--am-color-text); background: none; border: 0; cursor: pointer; }
.scrim { display: none; }
@container sidebar (max-width: 220px) {
  .all { flex-direction: column; }
  .all > span { display: none; }
}
@media (min-width: 721px) {
  .sidebar[data-slim="true"] { padding-inline: 6px; }
  .sidebar[data-slim="true"] .sidebar-search { justify-content: center; min-height: 40px; padding: 0; gap: 0; background: none; border-color: transparent; }
  .sidebar[data-slim="true"] .sidebar-search:hover { background: var(--am-color-surface-raised); }
  /* Keep the names in the accessibility tree and in Capture's textContent-based search. */
  .sidebar[data-slim="true"] :is(.sidebar-label, .who, .account .name, .nav-label h2) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sidebar[data-slim="true"] :is(.crown, .account-chevron, .all > span, .all a > svg:last-child, .nav-empty, .nav-remove, .nav-grip, .recent-preview) { display: none; }
  .sidebar[data-slim="true"] :is(.shelf, .all) { flex-direction: column; align-items: stretch; }
  .sidebar[data-slim="true"] :is(.shelf a, .all a, .nav-rows a, .account > button) { justify-content: center; min-height: 40px; padding: 0; gap: 0; }
  .sidebar[data-slim="true"] .nav-label { justify-content: center; padding-inline: 0; }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 9; width: min(80vw, 300px); transform: translateX(-100%);
    visibility: hidden; transition: transform var(--am-motion-quick) var(--am-motion-ease), visibility var(--am-motion-quick);
    overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar.open { transform: none; visibility: visible; box-shadow: var(--am-elevation-panel); }
  .sidebar .sidebar-scroll, .sidebar .nav-lists { flex: none; min-height: auto; overflow-y: visible; }
  .sidebar .nav-label { position: static; }
  .sidebar .account { flex: none; margin-top: auto; }
  .sidebar-resize { display: none; }
  .menu, .scrim.open { display: grid; }
  #account-menu { width: calc(min(80vw, 300px) - 2 * var(--am-space-3)); }
  .scrim { position: fixed; inset: 0; z-index: 8; background: rgb(0 0 0 / 0.3); touch-action: none; }
  :root:has(.sidebar.open), :root:has(.sidebar.open) body { overflow: hidden; overscroll-behavior: none; }
  .app:has(.sidebar.open) :is(.transcript, .today, .library) { touch-action: none; overflow: hidden; }
}
.bar { display: flex; align-items: center; gap: var(--am-space-2); padding: var(--am-space-4) 0;
  border-bottom: var(--am-border-thin) solid var(--am-color-divider); }
.bar h1 { margin: 0; font-size: var(--am-type-label-size); font-weight: var(--am-type-label-weight); }
.chat > .bar { display: grid; grid-template-columns: var(--am-metric-touch-target) minmax(0, 1fr) var(--am-metric-touch-target); }
.chat > .bar > h1 { grid-column: 2; grid-row: 1; justify-self: center; max-width: 100%; }
.chat > .bar > .menu { grid-column: 1; grid-row: 1; }
.chat > .bar > .lamp { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
/* Said only while the page has lost its Colony: a dot that only ever showed "connected" meant nothing. */
.lamp { display: none; color: var(--am-color-text-muted); font-size: 12px; }
.phx-client-error .lamp, .phx-server-error .lamp { display: inline; }
.thread { position: relative; display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; }
/* Today and the Inbox hide the chat, never drop it: a stream sends its lines to the browser once. */
.thread[hidden] { display: none; }
/* The page scrolls at the window's edge, as any web page does: the scroller spans the pane and pads its lines into the column. */
.app > .chat { max-width: none; padding: 0; }
.app:not(.space) > .chat > :is(.bar, .composer) { align-self: center; width: min(728px, calc(100% - 2 * var(--am-space-4))); }
.transcript { flex: 1; min-height: 0; overflow-y: auto; padding: var(--am-space-6) max(var(--am-space-4), calc(50% - 364px)); }
/* The chat scrolls under the Ant's name (#2487): the bar floats over the transcript's top edge, which a short fade of the canvas
   softens; the fade stops short of the scroll bar. It is solid behind the name and the menu, so no word of the chat is cut by them (#2455 workers saw it). Isolation keeps a card's own layers (a map's Open button) under the bar, and
   the bar under the phone's scrim. --bar is the menu button's row, so the name keeps one height at every width. */
.app:not(.space) > .chat:has(> .bar) { position: relative; isolation: isolate; --bar: calc(2 * var(--am-space-4) + var(--am-metric-touch-target)); }
/* The lamp's row grows the bar, so the fade and the first line move down with it instead of the lamp sitting over the chat. */
:is(.phx-client-error, .phx-server-error) .app:not(.space) > .chat:has(> .bar) { --bar: calc(2 * var(--am-space-4) + var(--am-metric-touch-target) + var(--am-space-2) + 24px); }
.app:not(.space) > .chat > .bar { position: absolute; z-index: 2; top: 0; right: 0; left: 0; margin-inline: auto;
  grid-template-rows: var(--am-metric-touch-target); border-bottom: 0; pointer-events: none; }
.app:not(.space) > .chat > .bar > .lamp { line-height: 24px; }
.app:not(.space) > .chat > .bar > :not(.lamp) { pointer-events: auto; }
.app:not(.space) > .chat:has(> .bar)::before { content: ""; position: absolute; z-index: 1; top: 0; left: 0; right: var(--am-space-3);
  height: calc(var(--bar) + var(--am-space-4)); pointer-events: none;
  background: linear-gradient(var(--am-color-canvas) var(--bar), transparent); }
/* The name and the phone's menu carry their own chip, so they read as controls on the bar, not as words of the chat. */
.app:not(.space) > .chat > .bar :is(.ant-open, .menu) { background: var(--am-color-surface-raised); border: var(--am-border-thin) solid var(--am-color-divider);
  box-shadow: var(--am-elevation-panel); }
.app:not(.space) > .chat > .bar .ant-open { padding: 4px 16px 4px 4px; }
/* The name ellipsizes itself, so the h1 need not clip, which would cut the chip's shadow. */
.app:not(.space) > .chat > .bar > h1 { overflow: visible; }
.app:not(.space) > .chat > .bar .menu { margin-left: 0; border-radius: var(--am-radius-pill); }
.app:not(.space) > .chat > .bar :is(.ant-open, .menu):hover { background: var(--am-color-surface-inset); }
.app:not(.space) > .chat:has(> .bar) .transcript { isolation: isolate; padding-top: calc(var(--bar) + var(--am-space-4)); scroll-padding-top: calc(var(--bar) + var(--am-space-4)); }
/* A class later in this file would otherwise beat `[hidden]` and leave the jump up over the latest line. */
.scroll-bottom { position: absolute; z-index: 2; left: 50%; bottom: var(--am-space-3); transform: translateX(-50%); display: grid;
  place-items: center; width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); padding: 0;
  color: var(--am-color-text); background: var(--am-color-surface); border: var(--am-border-thin) solid var(--am-color-border);
  border-radius: var(--am-radius-pill); box-shadow: var(--am-elevation-key); cursor: pointer; }
.scroll-bottom[hidden] { display: none; }
/* The jump sits on a solid canvas band at the thread's foot, as the name does at its head, so it never cuts through the line under it. */
.thread:has(> .scroll-bottom:not([hidden]))::after { content: ""; position: absolute; z-index: 1; bottom: 0; left: 0; right: var(--am-space-3);
  height: calc(var(--am-metric-touch-target) + 2 * var(--am-space-3) + var(--am-space-4)); pointer-events: none;
  background: linear-gradient(to top, var(--band, var(--am-color-canvas)) calc(100% - var(--am-space-4)), transparent); }
.scroll-bottom:hover { background: var(--am-color-surface-inset); }
.scroll-bottom:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
.scroll-bottom:active { transform: translateX(-50%) translateY(var(--am-motion-pressed-offset)); }
@media (prefers-reduced-motion: reduce) { .scroll-bottom:active { transform: translateX(-50%); } }
.msg { margin: 0 0 var(--am-space-5); white-space: pre-wrap; overflow-wrap: anywhere; max-width: var(--am-metric-body-measure); }
.msg.you { width: fit-content; max-width: 80%; margin-left: auto; padding: var(--am-space-2) var(--am-space-4);
  background: var(--am-color-selection); color: var(--am-color-selection-text); border-radius: var(--am-radius-panel); }
.ant-ref { color: var(--am-color-link); background: var(--am-color-surface-inset); font-weight: var(--am-type-label-weight);
  border-radius: var(--am-radius-small); padding: 0 var(--am-space-1); text-decoration: none; }
a.ant-ref:hover { text-decoration: underline; }
a.ant-ref:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
.msg.md { white-space: normal; }
/* In an Ant's whole chat a line said in a Room is headed by the Room's name, which opens it; the Room's own chat shows only its lines. */
.from-room { display: flex; align-items: center; gap: 6px; width: fit-content; margin: 0 0 var(--am-space-1); color: var(--am-color-text-muted);
  font-size: var(--am-type-caption-size); font-weight: var(--am-type-label-weight); text-decoration: none; }
.message-row:has(> .you) > .from-room { margin-left: auto; }
/* A reply shows the message it answers as one small line over the bubble, and a press goes to that message. */
.reply-to { color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); border: 0; border-left: 3px solid var(--am-color-border); }
.reply-to { display: block; max-width: min(80%, 420px); margin: 0 0 var(--am-space-1) auto; padding: 3px var(--am-space-3); font-family: inherit; text-align: left;
  background: color-mix(in srgb, var(--am-color-selection) 60%, transparent); border-radius: 0 var(--am-radius-small) var(--am-radius-small) 0; cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reply-to::before { content: "↩ "; }
.reply-to:hover { color: var(--am-color-text); }
.reply-to:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
/* A held reply is a card at the top of the box: who is answered, a line of what they said, and an X. */
.replying { display: flex; align-items: center; gap: var(--am-space-3); margin: 0 var(--am-space-1); padding: var(--am-space-2) var(--am-space-1) var(--am-space-2) var(--am-space-3); background: var(--am-color-surface-inset); border-radius: var(--am-radius-small); font-size: var(--am-type-caption-size); line-height: 1.35; }
.replying[hidden] { display: none; }
/* The @ list sits in the box above the words, in the page's flow, so a phone's keyboard never covers it. */
.mentions { display: flex; flex-direction: column; gap: var(--am-space-1); max-height: 40vh; overflow-y: auto; }
.mentions[hidden] { display: none; }
.mentions .role { margin-left: auto; }
.replying::before { content: ""; align-self: stretch; width: 3px; background: var(--am-color-text-muted); border-radius: 2px; }
.replying > div { flex: 1; min-width: 0; }
.replying b { display: block; font-weight: var(--am-type-label-weight); }
.replying .quote { display: block; overflow: hidden; color: var(--am-color-text-muted); text-overflow: ellipsis; white-space: nowrap; }
.replying .x { position: relative; display: grid; flex: none; place-items: center; width: 28px; height: 28px; padding: 0; color: var(--am-color-text-muted); background: none; border: 0; border-radius: var(--am-radius-small); cursor: pointer; }
.replying .x::after { content: ""; position: absolute; inset: -8px; }
.replying .x:hover { color: var(--am-color-selection-text); background: var(--am-color-selection); }
.replying .x:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 1px; }
.msg.found { outline: 2px solid transparent; outline-offset: 4px; border-radius: var(--am-radius-small); animation: found 1.6s ease-out; }
@keyframes found { from { outline-color: var(--am-color-focus); } }
.from-room::before, .md .file.space::before { content: ""; flex: none; width: 14px; height: 14px; border: 0; border-radius: 0; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2'/%3E%3Cpath d='M16 6H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2v3l3-3h7a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2z'/%3E%3Cpath d='M5.5 10.5h9.5'/%3E%3Cpath d='M5 14.5h9.5'/%3E%3Cpath d='M9.3 9 8.4 16'/%3E%3Cpath d='M13.1 9l-.9 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.from-room:hover { color: var(--am-color-text); text-decoration: underline; }
.from-room:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
/* A Recents card opens the chat at what you said there, which glows once. */
.msg.at { animation: at-glow 2.4s ease-out; }
@keyframes at-glow { from { box-shadow: 0 0 0 3px var(--am-color-focus); } }
@media (prefers-reduced-motion: reduce) { .msg.at { animation: none; } }
#reply-md:empty { display: none; }
/* The reasons box under a thumbs-down (Web.MessageReactions) and the Today brief's wish box share one look. */
.reaction-feedback { margin-top: var(--am-space-2); color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.reaction-follow { display: flex; align-items: center; gap: var(--am-space-2); min-height: 30px; }
.reaction-said { color: var(--am-color-success); }
.reaction-again { padding: 0; border: 0; background: none; color: var(--am-color-link); font: inherit; cursor: pointer; white-space: nowrap; }
@media (hover: hover) { .reaction-again:hover { text-decoration: underline; } }
.reaction-feedback button:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
.reaction-note { display: flex; align-items: center; gap: var(--am-space-2); max-width: 440px; margin-top: var(--am-space-1); padding: 4px 4px 4px var(--am-space-3);
  border: 1px solid var(--am-color-border); border-radius: var(--am-radius-control); background: var(--am-color-surface); }
.reaction-note:focus-within { border-color: var(--am-color-focus); }
/* The feedback text is a caption, but an input under 16px makes iOS Safari zoom the page on focus; the composer keeps the body size, which its input inherits. */
.reaction-note { font-size: var(--am-type-body-size); }
.reaction-note input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: none; color: var(--am-color-text); font: inherit; }
.reaction-note .send { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--am-radius-small);
  background: var(--am-color-action); color: var(--am-color-action-text); cursor: pointer; }
.reaction-note .send:hover { background: var(--am-color-action-hover); }
.reaction-note .send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md :is(p, ul, ol, pre, blockquote, table) { margin: 0 0 var(--am-space-3); }
.md :is(h1, h2, h3, h4) { margin: var(--am-space-4) 0 var(--am-space-2); font-size: var(--am-type-label-size); font-weight: var(--am-type-label-weight); }
.md a { color: var(--am-color-link); }
/* An Ant's drawing, live page or table, drawn from its fenced block. */
.md .surface { display: block; max-width: 100%; margin: 0 0 var(--am-space-2); border-radius: var(--am-radius-control); }
.md iframe.surface { width: 100%; height: 420px; border: var(--am-border-thin) solid var(--am-color-border); background: #fff; }
.md table.surface { display: table; }
.md img.surface { background: #fff; }
.md img { max-width: 100%; height: auto; }
.md p > img { max-height: 480px; vertical-align: bottom; border-radius: var(--am-radius-control); }
.md button.surface.run { padding: var(--am-space-3) var(--am-space-4); color: var(--am-color-text); background: var(--am-color-surface); border: var(--am-border-thin) solid var(--am-color-border); font: inherit; cursor: pointer; }
.md button.surface.run:hover { background: var(--am-color-surface-inset); }
.md button.surface.run:disabled { color: var(--am-color-disabled-text); background: var(--am-color-disabled-surface); cursor: default; }
/* An Ant's question: lettered options a tap answers, greyed once the person wrote after it. */
.md .choice { padding: var(--am-space-3) var(--am-space-4); border: var(--am-border-thin) solid var(--am-color-border); background: var(--am-color-surface); }
.md .choice p { margin: 0 0 var(--am-space-2); font-weight: var(--am-type-label-weight); }
.md .choice button { display: flex; gap: var(--am-space-3); width: 100%; padding: var(--am-space-3) var(--am-space-2); color: var(--am-color-text); background: none;
  border: 0; border-top: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-control); font: inherit; text-align: left; cursor: pointer; }
.md .choice button:hover { background: var(--am-color-surface-inset); }
.md .choice .key { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--am-radius-control); background: var(--am-color-surface-inset); font-size: var(--am-type-caption-size); }
.md .choice .pick { margin-left: var(--am-space-2); padding: 0 var(--am-space-2); border-radius: 999px; color: var(--am-color-link); background: var(--am-color-selection); font-size: var(--am-type-caption-size); }
.md .choice .why { display: block; color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.md .map { position: relative; margin: 0 0 var(--am-space-2); overflow: hidden; border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-panel); background: var(--am-color-surface); }
.md .map .view { position: relative; height: 260px; background: var(--am-color-surface-inset); }
.md .map.off .view { display: none; }
.md .map figcaption { display: flex; align-items: baseline; gap: var(--am-space-3); padding: var(--am-space-3) var(--am-space-3) 0; }
.md .map figcaption b { font-weight: var(--am-type-label-weight); }
.md .map figcaption a { margin-left: auto; color: var(--am-color-link); font-size: var(--am-type-caption-size); text-decoration: none; white-space: nowrap; }
.md .map figcaption a::after { content: " \2197"; }
.md .map ol { margin: 0; padding: var(--am-space-2); list-style: none; }
.md .map li { display: flex; gap: var(--am-space-3); margin: 0; padding: 5px var(--am-space-2); border-radius: var(--am-radius-small); }
.md .map li.lit { background: var(--am-color-surface-inset); }
.md .map li > i { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; color: #fff; background: var(--am-color-action); font-size: 12px; font-style: normal; font-weight: 700; line-height: 1; }
.md .map li > :is(span, a) { min-width: 0; color: var(--am-color-text); text-decoration: none; }
.md .map li > a:hover { text-decoration: underline; }
.md .map li small { margin-left: var(--am-space-2); color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.md .map em:is(.open, .shut) { font-style: normal; font-weight: 600; color: var(--am-color-success); }
.md .map em.shut { color: var(--am-color-error); }
.md .map .stop { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; color: #fff; background: var(--am-color-action); border: 2px solid #fff; font-size: 12px; font-weight: 700; box-shadow: 0 1px 3px rgb(0 0 0 / .3); cursor: default; transition: box-shadow .12s; }
.md .map .stop.lit { z-index: 1; box-shadow: 0 0 0 5px color-mix(in srgb, var(--am-color-action) 35%, transparent), 0 1px 3px rgb(0 0 0 / .3); }
.md .map .credit { position: absolute; right: 6px; bottom: 6px; z-index: 2; max-width: calc(100% - 12px); padding: 1px 6px; border-radius: 6px; text-align: right; color: var(--am-color-text-muted); background: color-mix(in srgb, var(--am-color-surface) 80%, transparent); font-size: 10px; line-height: 16px; }
.md .map .credit a { color: inherit; text-decoration: none; }
.md .map .credit.folded { width: 18px; height: 18px; padding: 0; border-radius: 50%; font-size: 0; cursor: pointer; }
.md .map .credit.folded::before { content: "i"; display: block; font: italic 700 11px/18px Georgia, serif; text-align: center; }
@media (max-width: 720px) { .md .map .view { height: 220px; } }
.message-row:has(~ .message-row > .msg.you) .choice button, .md .choice button:disabled { opacity: .55; cursor: default; pointer-events: none; }
/* A Library file in a reply is Everything's tile (.tiles draws its picture and words), set in the line so several sit side by side and wrap. */
.md .art { display: inline-flex; flex-direction: column; gap: 0; width: 160px; max-width: 100%; margin: var(--am-space-1) var(--am-space-3) var(--am-space-1) 0; vertical-align: top;
  color: inherit; font-weight: inherit; text-decoration: none; border-radius: 12px; }
.md .art > span { display: block; }
.md .art:hover .title { text-decoration: underline; }
.md .art:focus-visible { outline: 2px solid var(--am-color-focus); outline-offset: 3px; }
/* A file an Ant shared before the Library: a document glyph, its name (opens it) and Download, on one quiet card. */
.md .file { display: inline-flex; align-items: center; gap: var(--am-space-3); max-width: 100%; padding: var(--am-space-2) var(--am-space-3);
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); background: var(--am-color-surface); }
.md .file::before { content: ""; flex: none; width: 14px; height: 18px; border: 1.5px solid currentColor; border-radius: 2px 6px 2px 2px; opacity: .6; }
/* A Room an Ant opened sits in its sentence as a tag, never a box that pushes the lines apart. */
.md .file.space { gap: 6px; margin-block: -1px; padding: 0 var(--am-space-2); vertical-align: bottom; border-color: var(--am-color-divider); border-radius: var(--am-radius-small); }
.md .file a:first-of-type { overflow: hidden; min-width: 0; color: var(--am-color-text); font-weight: var(--am-type-label-weight); text-overflow: ellipsis; white-space: nowrap; }
.md .file a[download] { flex: none; font-size: var(--am-type-caption-size); }
.md .file a { text-decoration: none; }
.md .file a:hover { text-decoration: underline; }
.md .file.pdf::before { display: none; }
.md .file.pdf > a:first-of-type { display: flex; align-items: center; gap: var(--am-space-3); }
.md .file.pdf .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.md .file.pdf img.pdf-preview { flex: none; width: 48px; height: 64px; max-width: 48px; max-height: 64px;
  object-fit: contain; border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-small); background: #fff; }
.md img.surface, .md .picture, .md :not(a) > img[src*="/files/"] { cursor: zoom-in; }
.md .picture { display: block; width: fit-content; margin-bottom: var(--am-space-2); }
.md .picture img { display: block; max-width: min(100%, 480px); max-height: 480px; border-radius: var(--am-radius-control); }
.md code { font: var(--am-type-code-size)/var(--am-type-code-line-height) var(--am-font-code); padding: 0 var(--am-space-1);
  background: var(--am-color-selection); border-radius: 4px; }
.md pre { overflow-x: auto; padding: var(--am-space-3); background: var(--am-color-selection); border-radius: var(--am-radius-control); }
.md pre code { padding: 0; background: none; }
.md blockquote { padding-left: var(--am-space-3); border-left: 3px solid var(--am-color-divider); color: var(--am-color-text-muted); }
/* :where keeps a table's margins below .md's first- and last-child rules, as every other block's are. */
.md :where(.table-scroll) { margin: var(--am-space-3) 0 var(--am-space-4); }
.md .table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain;
  border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-control); background: var(--am-color-surface); }
.md .table-scroll:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: -2px; }
.md .table-scroll > table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0;
  font-size: var(--am-type-caption-size); line-height: var(--am-type-caption-line-height); font-variant-numeric: tabular-nums; }
.md :is(th, td) { padding: var(--am-space-3) var(--am-space-4); text-align: left; vertical-align: top;
  border: 0; border-bottom: var(--am-border-thin) solid var(--am-color-divider); overflow-wrap: normal; }
.md th { background: var(--am-color-surface-inset); color: var(--am-color-text-muted); font-weight: var(--am-type-label-weight); white-space: nowrap; }
.md tbody tr:last-child td { border-bottom: 0; }
.md :is(th, td)[align="center"] { text-align: center; }
.md :is(th, td)[align="right"] { text-align: right; white-space: nowrap; }
.md .table-scroll img { display: block; max-width: 144px; max-height: 108px;
  object-fit: contain; border-radius: var(--am-radius-small); }
@media (hover: hover) { .md tbody tr:hover { background: var(--am-color-surface-inset); } }
.msg.error { color: var(--am-color-error); }
/* A card's result takes the card's own place and width (it also carries .card .status, as Settings' card-said does). */
.msg.note { max-width: none; white-space: normal; }
.msg.talk { max-width: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; white-space: normal;
  color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.msg.talk .party { display: inline-flex; align-items: center; gap: 4px; }
/* A faint underline at rest, so a touch screen shows the name opens its Ant's chat. */
.msg.talk .party a { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.msg.talk .party a:hover { color: var(--am-color-text); text-decoration-color: currentColor; }
.msg.talk .party a:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; border-radius: var(--am-radius-small); }
.msg.talk .head { width: 16px; height: 16px; }
.message-row > .ant-created { margin-top: var(--am-space-2); }
.status { margin: 0 0 var(--am-space-5); color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
/* A message waiting behind a reply its room does not show draws the working sign alone, never that reply's preview. */
#turn[data-waits] #reply-md { display: none; }
/* One box: the form is the surface, and its border takes the focus color while anything inside has focus. */
.composer { position: relative; display: flex; flex-direction: column; gap: var(--am-space-2); margin: var(--am-space-3) 0 var(--am-space-4); padding: var(--am-space-3) var(--am-space-2) var(--am-space-2);
  background: var(--am-color-surface); border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-panel); box-shadow: var(--am-elevation-panel); transition: border-color var(--am-motion-quick); }
.composer:focus-within { border-color: var(--am-color-focus); }
@media (prefers-reduced-motion: reduce) { .composer { transition: none; } }
.lock { margin: 30vh auto 0; max-width: 28rem; text-align: center; }
.lock a { display: inline-block; padding: var(--am-space-2) var(--am-space-4); border-radius: var(--am-radius-control);
  background: var(--am-color-action); color: var(--am-color-action-text); text-decoration: none; }
.lock a:hover { background: var(--am-color-action-hover); }
.keep { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
/* The draft grows with its words; the box around it, not the field, is what a person sees. */
.composer textarea { display: block; width: 100%; min-height: var(--am-type-body-line-height); max-height: 40vh; margin: 0; padding: 0 var(--am-space-2); resize: none; field-sizing: content;
  font: inherit; line-height: var(--am-type-body-line-height); color: inherit; background: none; border: 0; outline: none; caret-color: var(--am-color-action); }
.composer textarea::placeholder { color: var(--am-color-text-muted); opacity: 1; }
/* The keys: + at the left, the rest at the right. The mic and the talk key show only where the Voice hook shows the mic. */
.keys { display: flex; align-items: center; gap: 2px; }
.keys > :is(.k, .attach, .send, .stop) { position: relative; display: grid; flex: none; place-items: center; width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); padding: 0; border: 0;
  border-radius: var(--am-radius-control); cursor: pointer; transition: background var(--am-motion-quick), color var(--am-motion-quick), box-shadow var(--am-motion-quick), transform var(--am-motion-quick) var(--am-motion-ease); }
.keys > :is(.k, .attach) { color: var(--am-color-text-muted); background: none; }
.keys > :is(.k, .attach):hover { color: var(--am-color-selection-text); background: var(--am-color-selection); }
.keys > :is(.k, .attach, .send, .stop):active { transform: translateY(var(--am-motion-pressed-offset)); }
.keys > :is(.send, .stop) { color: var(--am-color-action-text); background: var(--am-color-action); box-shadow: var(--am-elevation-key); }
.keys > :is(.send, .stop):hover { background: var(--am-color-action-hover); }
.keys > :is(.send, .stop):active { box-shadow: var(--am-elevation-pressed); }
.keys > .send:disabled { color: var(--am-color-disabled-text); background: var(--am-color-disabled-surface); box-shadow: none; cursor: default; }
.keys > .attach { margin-right: auto; }
/* The focus edge is drawn inside the key, so it never crowds the box's border. */
.keys > :is(.k, .attach, .send, .stop):focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: calc(-1 * var(--am-border-control)); }
.keys svg { transition: transform var(--am-motion-settle) var(--am-motion-ease); }
.keys > .attach:hover svg { transform: rotate(90deg); }
.keys > .send:not(:disabled):hover svg { transform: translateY(-2px); }
.keys > [hidden], .keys > .talk { display: none; }
.composer:has(.mic:not([hidden], [data-phase=listening], [data-phase=speaking], [data-talking=true])) .keys > .talk { display: grid; }
/* Send rests quiet until there is something to send: words or a file row (a held reply alone sends nothing). */
.composer:has(textarea:placeholder-shown):not(:has(#attachments)) .send:not(:disabled) { color: var(--am-color-text-muted); background: var(--am-color-selection); box-shadow: none; cursor: default; }
.composer:has(textarea:placeholder-shown):not(:has(#attachments)) .send svg { transform: none; }
/* Talk mode uses the mic in Send's place. */
.keys > .mic:is([data-phase=listening], [data-phase=speaking]):not([data-dictating]) { color: var(--am-color-action-text); background: var(--am-color-action); box-shadow: var(--am-elevation-key); }
.composer:has(.mic:is([data-phase=listening], [data-phase=speaking]):not([data-dictating])) .keys > .send { display: none; }
/* While the Ant works Stop shows until something is typed, then Send steers it. */
.composer:has(textarea:placeholder-shown) .steer, .composer:not(:has(textarea:placeholder-shown)) .stop { display: none; }
/* Dictation swaps the mic icon and uses the last key for Send. */
.dictation-stop, .mic[data-dictating] .mic-icon, .composer:has(.mic[data-dictating]) .keys > .stop { display: none; }
.mic[data-dictating] .dictation-stop { display: block; }
.composer:has(.mic[data-dictating]) .keys > .send { display: grid; }
@media (prefers-reduced-motion: reduce) {
  .keys > *, .keys svg { transition: none; }
  .keys > :active, .keys > .attach:hover svg, .keys > .send:hover svg { transform: none; }
}
/* A picked file is a short row: the picture or its kind, the name over its size or what went wrong, and the X. Rows sit on a grid whose columns line up across lines (one column where only one fits), and the area scrolls past two and a half rows. The X shows always on a touch screen, and on row hover or focus with a mouse. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); grid-auto-rows: max-content; gap: var(--am-space-2); margin: 0 var(--am-space-1); padding: 0; list-style: none; --row: calc(var(--am-metric-touch-target) + 2 * var(--am-space-1) + 2 * var(--am-border-thin)); max-height: calc(2.5 * var(--row) + 2 * var(--am-space-2)); overflow: hidden auto; scrollbar-width: none; }
/* The rows area scrolls by wheel, drag and keyboard with no scrollbar: WebKit's overlay one took clicks meant for the X's right 14px, and the half-visible row shows the list scrolls. */
.cards::-webkit-scrollbar { display: none; }
.cards li { position: relative; display: flex; align-items: center; gap: var(--am-space-2); min-width: 0; padding: var(--am-space-1) 0 var(--am-space-1) 6px; overflow: hidden;
  background: var(--am-color-surface); border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-control); }
.cards .thumb { display: grid; flex: none; place-items: center; width: 40px; height: 40px; object-fit: cover; background: var(--am-color-selection); border-radius: var(--am-radius-small); }
.cards .badge { font-size: calc(var(--am-type-caption-size) * 0.75); font-weight: var(--am-type-label-weight); letter-spacing: 0.05em; }
.cards li > div { flex: 1; min-width: 0; font-size: var(--am-type-caption-size); line-height: 1.3; }
.cards :is(strong, .size) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cards strong { font-weight: var(--am-type-label-weight); }
.cards :is(.size, .failed) { color: var(--am-color-text-muted); }
.cards .failed { display: block; color: var(--am-color-error); }
.cards progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; appearance: none; background: none; border: 0; }
.cards progress::-webkit-progress-bar { background: none; }
.cards progress::-webkit-progress-value { background: var(--am-color-text); }
.cards progress::-moz-progress-bar { background: var(--am-color-text); }
/* The X is a 44px key around a 20px mark, its left side laid over the text's gap; it stays 4px off the row's rounded edge so its corners are still pressable. */
.cards button { position: relative; isolation: isolate; display: grid; flex: none; place-items: center; width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); margin: 0 var(--am-space-1) 0 -12px; padding: 0; font: inherit; font-size: 14px; line-height: 1; color: var(--am-color-text-muted);
  background: none; border: 0; cursor: pointer; }
.cards button::before { content: ""; position: absolute; inset: 12px; z-index: -1; border-radius: 50%; }
.cards button:hover { color: var(--am-color-selection-text); }
.cards button:hover::before { background: var(--am-color-selection); }
.cards button:focus-visible { outline: none; }
.cards button:focus-visible::before { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 1px; }
@media (hover: hover) { .cards button { opacity: 0; } .cards li:is(:hover, :focus-within) button { opacity: 1; } }
/* A drop anywhere: LiveView marks .app while files are over the window; the card never takes the pointer, so the drop lands on .app. */
.drop { display: none; }
.app.phx-drop-target-active > .drop { position: fixed; inset: 0; z-index: 17; display: flex; padding: var(--am-space-6); pointer-events: none; background: rgb(0 0 0 / 0.3); }
.drop > div { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: var(--am-space-2); padding: var(--am-space-6); text-align: center;
  color: var(--am-color-text); background: color-mix(in srgb, var(--am-color-surface) 88%, transparent); backdrop-filter: blur(6px); border: 2px dashed var(--am-color-text-muted); border-radius: var(--am-radius-panel); animation: lift 0.15s ease-out; }
.drop svg { margin-bottom: var(--am-space-2); color: var(--am-color-text-muted); }
.drop strong { font-size: var(--am-type-heading-size); font-weight: var(--am-type-heading-weight); line-height: 1.25; }
.drop span { color: var(--am-color-text-muted); }
@keyframes lift { from { opacity: 0; transform: scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .drop > div { animation: none; } }
.shots { display: flex; flex-wrap: wrap; gap: var(--am-space-2); }
.shots:empty { display: none; }
.shots:not(:empty) { margin-bottom: var(--am-space-2); }
.shots img { width: 146px; height: 96px; object-fit: cover; background: var(--am-color-canvas); border: var(--am-border-thin) solid var(--am-color-border);
  border-radius: var(--am-radius-control); }
.chips { display: flex; flex-wrap: wrap; gap: var(--am-space-1); margin: var(--am-space-2) 0 0; padding: 0; list-style: none; }
.chips li { max-width: 100%; padding: 0 var(--am-space-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--am-type-caption-size);
  background: var(--am-color-surface-inset); color: var(--am-color-text); border-radius: var(--am-radius-small); }
.card { margin: 0 0 var(--am-space-5); padding: var(--am-space-4); background: var(--am-color-surface);
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-panel); }
.card h2 { margin: 0 0 var(--am-space-1); font-size: var(--am-type-label-size); font-weight: var(--am-type-label-weight); text-wrap: balance; }
.card .status { margin-bottom: var(--am-space-3); }
/* An Ability's logo and one line lead; its consent facts follow in full, and every key sits in one row. */
.card header { display: flex; align-items: center; gap: var(--am-space-3); margin-bottom: var(--am-space-1); }
.card header:has(img, svg) { margin-bottom: var(--am-space-3); }
.card header img, .card header svg { flex: none; width: 32px; height: 32px; }
.card header h2 { margin: 0; }
.card header .summary { margin: 2px 0 0; color: var(--am-color-text-muted); }
.card .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--am-space-2); }
.card .actions form { margin: 0; }
.card .detail { margin: 0 0 var(--am-space-3); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--am-color-text-muted); text-wrap: pretty; }
/* What an Ability asks to do (an email's address and body), kept as written and scrolled when long. */
.card.confirm .detail { max-height: 16rem; overflow-y: auto; }
.card details { margin: var(--am-space-2) 0 var(--am-space-3); }
.card details > summary { width: fit-content; cursor: pointer; color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.card details > .detail { margin: var(--am-space-2) 0 0; }
.card .send-previews { display: flex; gap: var(--am-space-2); overflow-x: auto; margin: 0 0 var(--am-space-3); padding: 0; list-style: none; }
.card .send-previews img { display: block; width: 88px; height: 116px; object-fit: contain; background: var(--am-color-surface-inset);
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); }
.card form { display: flex; flex-wrap: wrap; gap: var(--am-space-2); margin-bottom: var(--am-space-3); }
/* Save and Cancel wrap as one pair: beside the field when it fits, under it, side by side, when it does not. */
.card form .buttons { display: flex; flex: none; gap: var(--am-space-2); }
.card input { flex: 1 1 12rem; min-width: 0; height: var(--am-metric-control-height); padding: 0 var(--am-space-4); font: inherit; color: inherit;
  background: var(--am-color-canvas); border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); outline: none; }
.card input:focus { border-color: var(--am-color-focus); }
.card button { height: var(--am-metric-control-height); padding: 0 var(--am-space-4); font: inherit; color: inherit; cursor: pointer;
  background: none; border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); }
.card button[type=submit] { border: 0; background: var(--am-color-action); color: var(--am-color-action-text); }
.card button[type=submit]:hover { background: var(--am-color-action-hover); }
.card button[type=submit].secondary, .card button[type=submit].secondary:hover { background: none; color: inherit; border: var(--am-border-thin) solid var(--am-color-border); }
.items li.dimmed strong { color: var(--am-color-text-muted); }
.card button:disabled { background: var(--am-color-disabled-surface); color: var(--am-color-disabled-text); cursor: default; }
.card > a { color: var(--am-color-link); }
/* An Ability's sign-in: the code to confirm, and its page as the card's main key. */
.card .code { margin: 0 0 var(--am-space-2); font: 700 1.375rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; user-select: all; }
.card a.key { display: inline-flex; align-items: center; height: var(--am-metric-control-height); padding: 0 var(--am-space-4); border-radius: var(--am-radius-control); background: var(--am-color-action); color: var(--am-color-action-text); text-decoration: none; }
.card a.key:hover { background: var(--am-color-action-hover); }
.items { margin: 0 0 var(--am-space-3); padding: 0; list-style: none; }
.items li { display: flex; align-items: center; gap: var(--am-space-3); padding: var(--am-space-3) 0; border-top: var(--am-border-thin) solid var(--am-color-divider); }
.items li[hidden] { display: none; }
.items li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.items li .status { display: block; margin: 0; }
/* Mac Settings: a quiet header, a section rail, and one compact group of rows. */
/* A popup over the page it opened from, as Feedback's sheet is; a phone gets the whole screen. */
.settings-scrim { position: fixed; inset: 0; z-index: 15; background: rgb(0 0 0 / 0.3); }
#settings { position: fixed; z-index: 16; top: 50%; left: 50%; transform: translate(-50%, -50%); overflow-y: auto;
  width: min(960px, calc(100vw - 2 * var(--am-space-6))); height: min(760px, calc(100dvh - 2 * var(--am-space-6)));
  background: var(--am-color-canvas); border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-panel); box-shadow: var(--am-elevation-panel); }
.settings-close { display: inline-flex; align-items: center; justify-content: center; width: var(--am-metric-touch-target); height: var(--am-metric-touch-target);
  color: var(--am-color-text-muted); border-radius: var(--am-radius-control); }
.settings-close:hover { background: var(--am-color-surface-inset); color: var(--am-color-text); }
#settings-title:focus { outline: none; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--am-space-4);
  padding: var(--am-space-4) var(--am-space-10); border-bottom: var(--am-border-thin) solid var(--am-color-divider); }
.settings-heading h2 { margin: 0; font-size: 1.4375rem; line-height: 1.3; font-weight: 600; }
.settings-layout { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: start; gap: var(--am-space-8);
  max-width: 980px; margin: 0 auto; padding: 30px var(--am-space-10); }
.settings-nav { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; min-height: var(--am-metric-touch-target); padding: var(--am-space-2) 10px;
  color: var(--am-color-text-muted); font-size: .8125rem; line-height: 1.4; text-decoration: none; border-radius: var(--am-radius-control); }
.settings-nav a[aria-current] { background: var(--am-color-surface-raised); color: var(--am-color-text); font-weight: 600; }
.settings-nav a:not([aria-current]):hover { background: var(--am-color-surface-inset); color: var(--am-color-text); }
#settings :is(a, button):focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
.settings-content { grid-column: 2; grid-row: 1; }
.settings-panel[hidden] { display: none; }
#settings h3 { margin: 0 0 6px; font-size: 1rem; line-height: 1.4; font-weight: 600; }
#settings .status { font-size: .75rem; line-height: 1.5; overflow-wrap: anywhere; }
#settings .card { margin: 0; padding: 14px var(--am-space-4); border-color: var(--am-color-divider); box-shadow: var(--am-elevation-panel); }
#settings .settings-content > .card, #settings .ability-settings .card-said { margin-bottom: var(--am-space-6); }
/* Two panels on one tab (the plan with Account, or with AI providers when no one is signed in) read as two groups, and a
   panel's cards as one stack. Hidden panels sit between them, so the second is any later sibling, not the next one. */
#settings .settings-panel:not([hidden]) ~ .settings-panel:not([hidden]) { margin-top: var(--am-space-8); }
#settings .settings-panel > .card + .card { margin-top: var(--am-space-3); }
#settings .ability-pages, #settings .mac-abilities { margin-top: var(--am-space-3); }
.mac-abilities > header { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: var(--am-space-2); margin-bottom: var(--am-space-4); }
/* An empty or failed read ("No devices yet", "Could not read the vault") is a title over its line, as a row is. */
#settings .card > p.status > strong:first-child { display: block; margin-bottom: 3px; color: var(--am-color-text); }
#settings .card > :last-child { margin-bottom: 0; }
#settings .card strong, #settings .card h3 { font-size: .8125rem; font-weight: 600; }
#settings .card h3 { margin-bottom: 3px; }
#settings .card button { font-size: .8125rem; min-height: var(--am-metric-touch-target); }
#settings .items li { min-height: 66px; padding: 14px 0; }
#settings .items li:first-child { border-top: 0; padding-top: 0; }
#settings .items li:last-child { padding-bottom: 0; }
#settings .items li .status { margin-top: 3px; }
.usage-sharing-row { display: flex; align-items: center; justify-content: space-between; gap: var(--am-space-4); }
.usage-sharing-row .status { margin: 0; }
:is(.card, .activity) .usage-switch { display: flex; flex: none; align-items: center; gap: var(--am-space-2); min-height: var(--am-metric-touch-target); height: auto; padding: var(--am-space-2); border: 0; }
.switch-track { display: block; width: 40px; height: 24px; padding: 3px; border-radius: var(--am-radius-pill); background: var(--am-color-text-muted); }
.switch-track::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--am-color-surface); }
.usage-switch[aria-checked="true"] .switch-track { background: var(--am-color-success); }
.usage-switch[aria-checked="true"] .switch-track::after { transform: translateX(16px); }
.usage-switch[aria-disabled="true"] { opacity: 0.5; }
/* General's rows: one segmented control, as the Mac's, and usage sharing as the card's last row. */
#settings .segmented { display: inline-flex; flex: none; gap: 2px; padding: 2px; background: var(--am-color-surface-inset);
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); }
#settings .card .segmented button { min-height: 36px; height: 36px; padding: 0 14px; white-space: nowrap; background: none; border: 0; color: var(--am-color-text-muted); }
/* Too narrow for the words and the keys side by side, the keys drop under the words, as on the Mac. */
#settings :is(#prefs, #natural-voice) li > span:first-child { flex: 1 1 14rem; }
#settings .card .segmented button[aria-pressed="true"] { background: var(--am-color-surface-raised); color: var(--am-color-text); font-weight: 600; box-shadow: inset 0 0 0 var(--am-border-thin) var(--am-color-border); }
#prefs, #natural-voice { margin: 0; }
/* The switch the Colony keeps reads as one more row of the list above, which the page keeps. */
#prefs + #natural-voice { margin-top: 14px; }
#settings #natural-voice li { padding-top: 14px; border-top: var(--am-border-thin) solid var(--am-color-divider); }
:is(#prefs, #natural-voice) + #web-app-settings { margin-top: 14px; padding-top: 14px; border-top: var(--am-border-thin) solid var(--am-color-divider); }
#web-app-settings { margin-bottom: 0; }
#settings #sign-out { margin: 0; }
#settings #sign-out button { background: none; color: inherit; border: var(--am-border-thin) solid var(--am-color-border); }
#settings .card.items { padding-top: 14px; padding-bottom: 14px; }
#enter-to-send::after { content: "Off"; }
#enter-to-send[aria-checked="true"]::after { content: "On"; }
/* The iPhone row sits over the device list, split as the Mac's rows are. */
#device-list .card > .items:first-child:not(:only-child) { margin-bottom: 14px; padding-bottom: 14px; border-bottom: var(--am-border-thin) solid var(--am-color-divider); }
#settings .items li { flex-wrap: wrap; }
#settings .items li > :is(button, .kinds) { flex: none; }
#settings .items li > a { display: inline-flex; align-items: center; min-height: var(--am-metric-touch-target); padding: 0 var(--am-space-4); font-size: .8125rem;
  color: inherit; text-decoration: none; border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); }
#settings .items li > a:hover { background: var(--am-color-surface-inset); }
#settings .items li > a.danger { color: var(--am-color-error); }
/* Settings > Vault: an item's words take a line of their own before its three keys squeeze them, a shown
   value's rows sit under it, and the Add or Edit form puts one field a line. */
#vault-list .items li > span { flex: 1 1 16rem; }
.vault-values > span { display: flex; align-items: center; gap: var(--am-space-2); margin-top: var(--am-space-2); }
.vault-values code { min-width: 0; overflow-wrap: anywhere; user-select: all; }
#settings .vault-values button { height: 28px; padding: 0 var(--am-space-3); font-size: .8125rem; }
.card form.vault-form { display: grid; gap: var(--am-space-3); margin: 0; }
.vault-form h4 { margin: 0; }
.items + form.vault-form { padding-top: var(--am-space-4); border-top: var(--am-border-thin) solid var(--am-color-divider); }
.vault-form label { display: grid; gap: var(--am-space-1); font-size: .8125rem; color: var(--am-color-text-muted); }
.vault-form label input { color: var(--am-color-text); font-size: 1rem; }
.vault-form-buttons { display: flex; justify-content: flex-end; gap: var(--am-space-2); }
/* A key's two switches on its card: label left, switch right, the full width. */
.switches { flex: 1 0 100%; margin: 0 0 var(--am-space-3); padding: 0; list-style: none; }
.switches li { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: var(--am-space-4); min-height: 0; padding: 0; border-top: 0; }
/* The button's padding is its touch target; the track itself ends on the text column's edge. */
.switches .usage-switch { padding-right: 0; }
/* The ring goes around the track, so it sits evenly about the switch on a card. */
.switches .usage-switch:focus-visible { outline: none; }
.switches .usage-switch:focus-visible .switch-track { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
/* The Abilities list, and an Ability's own page: its switches, the calendars it may use, and the skill it ships with. */
#settings .ability-settings .card + .card { margin-top: 14px; }
.ability-logo { flex: none; width: 28px; height: 28px; }
#settings .items li > .ability-open { flex: 1; display: flex; align-items: center; gap: var(--am-space-3); padding: 0; border: 0; }
#settings .items li > .ability-open:hover { background: none; }
.ability-open > span { flex: 1; min-width: 0; }
.ability-open > svg { flex: none; color: var(--am-color-text-muted); }
#settings .ability-page h3:focus { outline: none; }
#settings .ability-back { display: inline-flex; align-items: center; min-height: var(--am-metric-touch-target); margin-bottom: var(--am-space-4); padding: 0 var(--am-space-3); font-size: .8125rem; color: inherit; text-decoration: none;
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); }
.ability-page header { display: flex; align-items: center; flex-wrap: wrap; gap: var(--am-space-3); margin-bottom: var(--am-space-2); }
#settings .ability-page header h3 { flex: 1; min-width: 0; margin: 0; }
#settings .ability-page header button { min-height: var(--am-metric-touch-target); padding: 0 var(--am-space-4); font: inherit; font-size: .8125rem; color: inherit; cursor: pointer;
  background: none; border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); }
.ability-page h4 { margin: var(--am-space-5) 0 3px; font-size: .8125rem; font-weight: 600; }
.ability-page h4 + .status { margin-bottom: var(--am-space-3); }
.ability-settings .card > p { margin: 0 0 3px; }
#settings .ability-missing { border-color: var(--am-color-error); }
.ability-missing .status { margin-bottom: var(--am-space-3); }
.ability-calendars .items { margin: var(--am-space-3) 0 0; }
#settings .ability-calendars .items li { min-height: var(--am-metric-touch-target); padding: var(--am-space-2) 0; border-top: 0; }
#settings .computer-rules .items li { min-height: 0; padding: var(--am-space-1) 0; border-top: 0; font-size: .8125rem; }
.ability-calendars label { display: flex; flex: 1; align-items: center; gap: var(--am-space-3); min-height: var(--am-metric-touch-target); font-size: .8125rem; cursor: pointer; }
.ability-calendars input[type=checkbox] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--am-color-success); }
.ability-calendars label .status { display: inline; }
.ability-calendars li > span { font-size: .8125rem; }
.ability-calendars label.mine { flex: none; gap: var(--am-space-2); color: var(--am-color-text-muted); }
.ability-settings summary { cursor: pointer; }
.ability-settings summary .status { display: inline; }
.ability-settings pre { max-height: 16rem; overflow: auto; margin: var(--am-space-3) 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .75rem; line-height: 1.5; color: var(--am-color-text-muted); }
@media (max-width: 1000px) {
  .settings-layout { grid-template-columns: 128px minmax(0, 1fr); gap: var(--am-space-5); padding: var(--am-space-6); }
  .settings-heading { padding: var(--am-space-4) var(--am-space-6); }
}
@media (max-width: 720px) {
  #settings { inset: 0; transform: none; width: auto; height: auto; border: 0; border-radius: 0; }
  .settings-heading { padding: var(--am-space-4); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: var(--am-space-6); padding: var(--am-space-4); }
  .settings-content { grid-column: 1; grid-row: 2; }
  /* One row of tabs that scrolls sideways, never a ragged second line; it fades at the end that has more (app.js SettingsNav). */
  .settings-nav { flex-direction: row; gap: var(--am-space-1); margin: 0 calc(-1 * var(--am-space-4)); padding: var(--am-space-1) var(--am-space-4); overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 48px;
    mask-image: linear-gradient(to right, var(--more-left, #000), #000 48px, #000 calc(100% - 48px), var(--more-right, #000)); }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav a { flex: none; padding: var(--am-space-2) var(--am-space-3); font-size: .875rem; white-space: nowrap; }
  #settings .status { font-size: .875rem; }
  #settings .card strong, #settings .card h3, #settings .card button { font-size: .875rem; }
  #settings .card .segmented button { min-height: var(--am-metric-touch-target); height: var(--am-metric-touch-target); }
}
/* Feedback: a corner disc and the account menu open one sheet. The disc is Lucide's megaphone
   on the action vermilion. Below 1120 the centered bar meets that corner, so the bar and the
   day headings keep 68px clear. A Room's people pill owns the corner, and an open Ant panel's
   close key does too. Settings covers the page, so the disc leaves. */
.sheet button { height: var(--am-metric-control-height); padding: 0 var(--am-space-4); font: inherit; color: var(--am-color-text);
  background: none; border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); cursor: pointer; }
.sheet button:hover { background: var(--am-color-surface-inset); }
/* Above Undo, which otherwise takes presses through the sheet. */
.feedback .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.3); }
.sheet { position: fixed; top: 10vh; left: 50%; z-index: 41; width: min(480px, calc(100vw - 2 * var(--am-space-4))); max-height: 80vh; overflow-y: auto;
  transform: translateX(-50%); padding: var(--am-space-5); background: var(--am-color-surface); border: var(--am-border-thin) solid var(--am-color-border);
  border-radius: var(--am-radius-panel); box-shadow: var(--am-elevation-panel); color: var(--am-color-text);
  font-size: var(--am-type-body-size); line-height: var(--am-type-body-line-height); }
.sheet h2 { margin: 0 0 var(--am-space-4); font-size: var(--am-type-label-size); font-weight: var(--am-type-label-weight); }
.sheet fieldset { display: flex; flex-direction: column; gap: var(--am-space-3); margin: 0; padding: 0; border: 0; }
.sheet .kinds { display: flex; flex-wrap: wrap; gap: var(--am-space-2); white-space: nowrap; }
.sheet label { display: flex; align-items: center; gap: var(--am-space-2); }
/* The kinds are the Mac's two pills: the radio stays for keyboard and screen readers, out of sight. */
.sheet .kinds label { position: relative; padding: var(--am-space-1) var(--am-space-4); border: var(--am-border-thin) solid var(--am-color-border);
  border-radius: var(--am-radius-pill); cursor: pointer; }
.sheet .kinds label:has(:checked) { background: var(--am-color-surface-inset); border-color: var(--am-color-text); font-weight: 600; }
.sheet .kinds label:has(:focus-visible) { outline: 2px solid var(--am-color-focus); outline-offset: 2px; }
.sheet .kinds input { position: absolute; opacity: 0; pointer-events: none; }
.sheet .included { display: flex; flex-direction: column; gap: var(--am-space-3); }
.sheet .included h3 { margin: 0; color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); font-weight: 600; }
.sheet .include { justify-content: space-between; gap: var(--am-space-3); cursor: pointer; }
.sheet .include > span:first-child { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sheet .include small { color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.sheet .shot img { display: block; width: 72px; height: 46px; object-fit: cover; object-position: top left; border: var(--am-border-thin) solid var(--am-color-border); border-radius: 3px; }
/* The web's switch (settings' green track) drawn on the checkbox itself, knob and all, so the form posts it. */
.sheet input[role="switch"] { flex: none; appearance: none; width: 40px; height: 24px; margin: 0; border-radius: var(--am-radius-pill); cursor: pointer;
  background: radial-gradient(circle at 12px 50%, var(--am-color-surface) 8.5px, transparent 9px) var(--am-color-text-muted); }
.sheet input[role="switch"]:checked { background: radial-gradient(circle at 28px 50%, var(--am-color-surface) 8.5px, transparent 9px) var(--am-color-success); }
.sheet input[role="switch"]:disabled { opacity: 0.4; cursor: default; }
.sheet input[role="switch"]:focus-visible { outline: 2px solid var(--am-color-focus); outline-offset: 2px; }
.sheet textarea { resize: vertical; padding: var(--am-space-3); font: inherit; color: inherit; background: var(--am-color-canvas);
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); outline: none; }
.sheet textarea:focus { border-color: var(--am-color-focus); }
.sheet summary { color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); cursor: pointer; }
.sheet pre { max-height: 150px; overflow: auto; margin: var(--am-space-2) 0 0; padding: var(--am-space-3); white-space: pre-wrap; overflow-wrap: anywhere;
  font: var(--am-type-code-size)/var(--am-type-code-line-height) var(--am-font-code); background: var(--am-color-surface-inset); border-radius: var(--am-radius-control); }
.sheet .failed { margin: 0; color: var(--am-color-error); font-size: var(--am-type-caption-size); }
.sheet .actions { display: flex; justify-content: flex-end; gap: var(--am-space-2); }
.sheet button.key { border: 0; background: var(--am-color-action); color: var(--am-color-action-text); }
.sheet button.key:hover:not(:disabled) { background: var(--am-color-action-hover); }
.sheet button:disabled { background: var(--am-color-disabled-surface); color: var(--am-color-disabled-text); cursor: default; }
.feedback-float { position: fixed; z-index: 2; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--am-color-action); color: var(--am-color-action-text); box-shadow: var(--am-elevation-key); }
.feedback-float svg { width: 18px; height: 18px; }
.feedback-float:hover { background: var(--am-color-action-hover); }
.feedback-float:focus { outline: none; }
.feedback-float:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 3px; }
@media (hover: hover) {
  .feedback-float:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); right: 0; padding: 4px 8px;
    background: var(--am-color-text); color: var(--am-color-canvas); border-radius: 6px; font-size: var(--am-type-caption-size);
    font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: var(--am-elevation-key); }
}
@media (max-width: 720px) {
  .feedback-float { width: 44px; height: 44px; }
  .feedback-float svg { width: 20px; height: 20px; }
}
@media (max-width: 1120px) {
  .today-head { padding-right: 68px; }
}
@media (min-width: 721px) {
  .app:has(.ant-panel:not([hidden])) .feedback-float { right: 352px; }
}
.app:has(#settings) .feedback-float, .feedback:has(.sheet) .feedback-float { display: none; }
.bar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Scout's trail, paced as the apps pace it (ScoutTrail.swift): a dot that hesitates, then darts, with a faint tail, on one
   fixed loop. Both paths follow the inherited dash offset; under reduced motion the dot rests where it hesitates. */
.scout { margin-right: var(--am-space-2); vertical-align: middle; stroke: var(--am-color-link);
  stroke-linecap: round; stroke-dashoffset: -25; animation: scout 4.8s linear infinite; }
.scout .tail { stroke-width: 2; stroke-dasharray: 0 88 12 0; opacity: 0.42; }
.scout .dot { stroke-width: 6; stroke-dasharray: 0 100; }
@keyframes scout { 0% { stroke-dashoffset: 0; } 26%, 31.7% { stroke-dashoffset: -25; } 43.75% { stroke-dashoffset: -53; } 100% { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) { .scout { animation: none; } }
.undo .bar button[aria-label="Dismiss"] { display: grid; place-items: center; padding: 6px; background: none; }
.space-gone { position: fixed; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; color: var(--am-color-text-muted); }
.space-gone a { color: var(--am-color-link); font-weight: 600; text-underline-offset: 2px; }
/* A Room's tile (Web.TopicLink): its canvas scaled by the tile's own width over the world's, which every engine takes as a plain number
   (tan of atan2 turns two lengths into their ratio), so a tile fills any column and one rule serves a computer and a phone. */
.spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 24px 18px; }
.spaces > .tile, .ant-tiles > .tile { position: relative; min-width: 0; }
.spaces .room-preview { position: relative; width: 100%; margin-top: 0; }
[data-pin-kind="room"] > .room-preview::after { content: ""; position: absolute; inset: 0; }
.rooms-more { display: flex; justify-content: center; padding: var(--am-space-3) 0; }
.rooms-more button { min-height: 32px; padding: 0 14px; border: 0; border-radius: var(--am-radius-pill); font: inherit; font-size: 12.5px; color: var(--am-color-text-muted); background: transparent; cursor: pointer; }
.rooms-more button:hover { color: var(--am-color-text); background: var(--am-color-surface-inset); }
.rooms-more[data-loading="true"] button { opacity: .6; pointer-events: none; }
.mini { --s: tan(atan2(100cqw, calc(var(--ww) * 1px))); position: relative; isolation: isolate; container-type: inline-size; width: 100%; aspect-ratio: 16 / 10; margin-bottom: 8px;
  overflow: hidden; border-radius: 12px; background: var(--am-color-canvas); box-shadow: 0 0 0 1px var(--am-color-divider); }
/* A map note is the Room's own card made small: its saved picture, or its pins on plain ground, fill the view the Room's rules lay out. */
.mini .map .view { position: relative; }
.mini .map .view > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini .map .stop { position: absolute; translate: -50% -50%; }
/* Everything's Ants: a head beside two lines, set in the Room tiles' type. */
.ant-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px 18px; }
/* The padding and equal negative margin leave the focus ring room, without moving the grid. */
.ant-tiles > .tile > a { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 6px 40px 6px 6px; margin: -6px; color: inherit; text-decoration: none; border-radius: 12px; }
.ant-tiles .crown { margin-left: 0; }
.ant-tiles > .tile > a:focus-visible { outline: 2px solid var(--am-color-focus); outline-offset: 2px; }
.ant-tiles .head { width: 56px; height: 56px; }
.ant-tiles .who { display: flex; flex-direction: column; min-width: 0; }
.ant-tiles .who > strong { display: flex; align-items: center; gap: 4px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ant-tiles > .tile > a:hover .who > strong { text-decoration: underline; }
.ant-tiles .who > span { color: var(--am-color-text-muted); font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 720px) { .ant-tiles { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
@media (max-width: 720px) { .spaces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; } }
.room-name-editor { min-width: 0; }
.room-name-editor strong { display: block; }
.room-name-editor :is(button, input) { max-width: 100%; padding: 2px 4px; color: inherit; font: inherit; border: 0; border-radius: var(--am-radius-control); }
.room-name-editor button { background: none; cursor: pointer; }
.room-name-editor :is(button:hover, input) { background: var(--am-color-surface-inset); }
.room-name-editor input { width: 24ch; }
.room-name-editor :is(button:focus-visible, input:focus) { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: -1px; }
#room-name-error { position: absolute; top: calc(100% + 4px); left: 0; max-width: min(280px, calc(100vw - 2 * var(--am-space-4))); width: max-content; margin: 0;
  padding: 6px 8px; background: var(--am-color-surface-raised); border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-control); }
@media (pointer: coarse) {
  .room-name-editor :is(button, input) { min-height: var(--am-metric-touch-target); }
}
/* A page in place of the chat (Everything): one quiet 640px column under a 22px title. */
.today { flex: 1; overflow-y: auto; padding: var(--am-space-4) var(--am-space-4) var(--am-space-8);
  display: flex; flex-direction: column; align-items: center; gap: 22px; font-size: 14px; }
/* The column is its rows' width, never the scroller's. */
.chat:has(> .today) > .card { box-sizing: border-box; align-self: center; width: min(640px, calc(100% - 2 * var(--am-space-4))); }
.today > :not(.undo) { box-sizing: border-box; width: 100%; max-width: 640px; }
/* Feedback's sheet sits inside the heading, so the heading tints only its own icon and wraps before it overflows. */
.today-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.today-head > svg { flex: none; color: var(--am-color-action); }
.today-head h1:focus { outline: none; }
.today-head h1 { margin: 0; color: var(--am-color-text); font-size: 22px; font-weight: 650; line-height: 1.1; letter-spacing: -.01em; }
.today-head time { color: var(--am-color-text-muted); font-size: 13.5px; }
.today .meta { margin: 0; color: var(--am-color-text-muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* The Library: a tile per kept file, its picture over its name (which opens it), who made it and when; Download and Delete show on the tile in hand. */
.today.library > :not(.undo) { max-width: 980px; }
.library .sort { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; font-size: 13.5px; color: var(--am-color-text-muted); }
/* A native dropdown, drawn as the page's pills with a chevron of the text's own color. */
.library .sort span { position: relative; display: flex; }
.library .sort span::after { content: ""; position: absolute; top: 50%; right: 14px; width: 6px; height: 6px; margin-top: -5px; border: solid var(--am-color-text); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
.library .sort span select { appearance: none; padding-right: 34px; }
/* The header keeps Sort's height when a list filter hides it, so the filters do not jump. */
/* Kept at its full height in the scrolling column: a narrow phone wraps Sort under the title, over Find otherwise. */
.library .today-head { flex: none; min-height: 36px; }
.library .find { margin: 0 0 var(--am-space-3); }
.library .find input { width: min(100%, 360px); min-height: 40px; padding: 0 16px; font: inherit; color: var(--am-color-text); background: var(--am-color-surface);
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-pill); }
.library .find input:focus-visible { outline: 2px solid var(--am-color-focus); outline-offset: 2px; }
.kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.library-todos { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.library-todos h2, .files-head { margin: 0; font-size: 15px; font-weight: 600; }
.todo-rows { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.todo-rows li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--am-color-surface); font-size: 13.5px; overflow-wrap: anywhere; }
.todo-rows .why { flex: none; font-size: 12px; color: var(--am-color-text-muted); }
.kinds button, .library .sort select, .tiles .acts > * { min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--am-radius-pill); font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--am-color-text); background: var(--am-color-surface); box-shadow: inset 0 0 0 1px var(--am-color-divider); cursor: pointer; }
.kinds span { margin-left: 4px; font-weight: 400; opacity: .75; }
.kinds [aria-pressed="true"], .tiles .acts a { color: var(--am-color-canvas); background: var(--am-color-text); box-shadow: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 24px 18px; margin: 0; padding: 0; list-style: none; }
.tiles li { position: relative; display: flex; flex-direction: column; min-width: 0; }
.tiles .pic { aspect-ratio: 4 / 3; margin-bottom: 8px; border-radius: 12px; overflow: hidden; background: var(--am-color-surface); box-shadow: 0 0 0 1px var(--am-color-divider); }
/* A preview's page is an iframe, and WebKit never delivers a drag that starts over one to the page: this clear sheet takes the press instead. */
.tiles .pic { position: relative; }
.tiles .pic::after { content: ""; position: absolute; inset: 0; }
.tiles .pic :is(img, video) { display: block; width: 100%; height: 100%; object-fit: contain; }
/* A PDF's own first page fills the tile from its top, as the drawn page does. */
.tiles .pic img:is([src^="data:"], [src$=".pdf?thumbnail=1" i]) { object-fit: cover; object-position: top; }
/* A page is drawn four times the tile's size and shrunk, so the tile shows its top as a browser would. */
.tiles .pic iframe { width: 400%; height: 400%; border: 0; background: #fff; transform: scale(.25); transform-origin: 0 0; pointer-events: none; }
.tiles .title { padding: 0 2px; color: inherit; font-weight: 500; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tiles .title:hover { text-decoration: underline; }
.tiles .why { padding: 0 2px; color: var(--am-color-text-muted); font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tiles .who { color: inherit; }
/* Over the picture's lower edge: the tile is 4:3 above two lines of words. */
.tiles .adding .pic { display: flex; align-items: center; justify-content: center; padding: 0 20%; }
.tiles .adding progress { width: 100%; accent-color: var(--am-color-text); }
.library .said { margin: 0 0 var(--am-space-4); color: var(--am-color-error); }
.tiles .acts { position: absolute; right: 8px; bottom: 54px; display: flex; gap: 6px; }
.tiles .acts > * { display: flex; align-items: center; min-height: 30px; padding: 0 11px; font-size: 12px; text-decoration: none; }
/* A deleted file has no other way back, so its Undo bar stays until the person leaves the page. */
.library .undo .bar { animation: none; }
@media (hover: hover) { .tiles li:not(:hover, :focus-within) .acts { opacity: 0; } }
/* A finger has no hover, so the two sit under the words as quiet links and the picture stays clear. */
@media (hover: none) { .tiles .acts { position: static; gap: 8px; }
  .tiles .acts :is(a, button) { min-height: 44px; padding: 0 8px 0 2px; color: var(--am-color-link); background: none; box-shadow: none; } }
.check { width: 18px; height: 18px; margin: 1px 0 0 1px; padding: 0; border: var(--am-border-control) solid var(--am-color-border);
  border-radius: 5px; background: none; cursor: pointer; transition: background .15s, border-color .15s; }
.check:hover { border-color: var(--am-color-text-muted); }
.check.checked { background: var(--am-color-action); border-color: var(--am-color-action); }
.check:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
.all-clear { margin: 0; padding: 14px 16px; border-radius: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--am-color-success-surface) 45%, transparent); }
/* The Undo bar fades out on its own after 5 s; a new check is a new bar, so its clock starts over. */
.undo { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px); pointer-events: none; }
.undo .bar { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border: 0; border-radius: 999px; font-size: 13px; pointer-events: auto;
  color: var(--am-color-canvas); background: var(--am-color-text); box-shadow: var(--am-elevation-panel); animation: undo-out 5s forwards; }
.undo .bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo .bar a { flex: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; color: inherit; text-decoration: none;
  background: color-mix(in srgb, var(--am-color-canvas) 18%, transparent); }
.undo button { flex: none; padding: 6px 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 600; color: inherit;
  background: color-mix(in srgb, var(--am-color-canvas) 18%, transparent); cursor: pointer; }
@keyframes undo-out { 0%, 92% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
/* Your plan's meter: the share left over a bar in the action color at every level, as on the Mac. */
#plan .card + .card { margin-top: 14px; }
#plan .plan-head { display: flex; justify-content: space-between; gap: var(--am-space-4); margin: 0 0 10px; }
#plan .plan-head strong:last-child { font-size: .9375rem; }
#plan .plan-bar { display: block; height: 6px; margin-bottom: 10px; border-radius: var(--am-radius-pill); background: var(--am-color-surface-inset); overflow: hidden; }
#plan .plan-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--am-color-action); }
/* The Ant panel: the Mac's inspector column right of the chat, opened from the face in the top bar; a phone gets the whole screen. */
.ant-open { display: inline-flex; align-items: center; gap: var(--am-space-2); max-width: 100%; padding: 2px 8px; font: inherit; color: inherit;
  background: none; border: 0; border-radius: var(--am-radius-pill); cursor: pointer; }
.ant-open:hover { background: var(--am-color-surface-inset); }
/* A flex button's bare text never ellipsizes, so a long name is its own span that can. */
.ant-open > .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ant-open > :not(.name) { flex: none; }
.ant-open:focus-visible, .ant-panel button:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
.ant-panel { flex: none; width: 340px; height: 100dvh; overflow-y: auto; background: var(--am-color-canvas); border-left: var(--am-border-thin) solid var(--am-color-divider); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 10px 18px; }
.panel-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-of { display: none; }
.ant-panel [hidden] { display: none; }
.panel-close { display: grid; flex: none; place-items: center; width: 30px; height: 30px; padding: 0; color: var(--am-color-text-muted); background: none; border: 0;
  border-radius: var(--am-radius-control); cursor: pointer; }
.panel-close:hover { color: var(--am-color-text); }
.panel-body { padding: 0 18px 18px; }
.panel-tabs { display: flex; gap: 2px; margin-bottom: 8px; padding: 2px; background: var(--am-color-surface-inset); border-radius: 8px; }
.panel-tabs button { flex: 1; padding: 3px 0; font: inherit; font-size: 12px; color: var(--am-color-text-muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.panel-tabs button[aria-pressed="true"] { color: var(--am-color-text); background: var(--am-color-surface); box-shadow: 0 0 0 1px var(--am-color-divider), 0 1px 2px rgb(0 0 0 / .14); font-weight: 600; }
.panel-work { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.panel-learned li { display: flex; flex-direction: column; gap: 3px; }
.panel-learned .why:first-child { display: flex; gap: 6px; font-weight: 600; }
.panel-learned time { font-weight: 400; }
.panel-learned button { margin-left: auto; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--am-color-link); background: none; border: 0; cursor: pointer; }
.panel-work :is(h3, .mini-head) { display: flex; justify-content: space-between; margin: 8px 0 0; color: var(--am-color-text-muted); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.panel-work :is(h3, .mini-head) span { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.panel-work ul { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.panel-routines li { display: flex; align-items: center; gap: 12px; }
.panel-work li > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.panel-work .title { overflow-wrap: anywhere; }
.panel-work .one-line { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* A fidget spinner beside what runs now: flicked, then coasting to rest, on one loop. */
.panel-work .spin { flex: none; margin: 0; fill: var(--am-color-action); stroke: var(--am-color-action); stroke-width: 7; stroke-linecap: round; animation: panel-spin 1.8s cubic-bezier(.3, .6, .3, 1) infinite; }
.panel-work .spin circle { stroke: none; }
.panel-work .spin .hole { fill: var(--am-color-canvas); }
@keyframes panel-spin { to { transform: rotate(840deg); } }
@media (prefers-reduced-motion: reduce) { .panel-work .spin { animation: none; } }
.panel-plan { display: flex; flex-direction: column; gap: 8px; }
.panel-plan > .title { font-weight: 600; }
.panel-plan ol { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.panel-plan li { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; }
.panel-plan li::before { content: "\25CB"; grid-row: span 2; color: var(--am-color-text-muted); text-align: center; }
.panel-plan li[data-state="done"]::before { content: "\2713"; }
.panel-plan li[data-state="done"] .title { color: var(--am-color-text-muted); text-decoration: line-through; }
.panel-plan li:is([data-state="needs_you"], [data-state="stuck"])::before { content: "!"; color: var(--am-color-action); font-weight: 700; }
.panel-plan li[data-state="needs_you"] .why { color: var(--am-color-action); font-weight: 600; }
.panel-plan li .why { grid-column: 2; }
.panel-work .why, .panel-work .empty { margin: 0; color: var(--am-color-text-muted); font-size: 11.5px; }
#ant-work { position: relative; }
#ant-work .panel-refusal { position: absolute; top: -4px; right: 0; left: 0; overflow: hidden; margin: 0; color: var(--am-color-text-muted);
  font-size: 11.5px; line-height: 14px; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.panel-work [data-last="trouble"] { color: var(--am-color-action); }
.ant-panel .usage-switch { flex: none; padding: 0; background: none; border: 0; border-radius: var(--am-radius-pill); cursor: pointer; }
@media (max-width: 720px) { .ant-panel { position: fixed; inset: 0; z-index: 3; width: auto; border: 0; } .panel-of { display: inline; } }
.panel-card { gap: 4px; }
.panel-card h3 { display: block; margin: 10px 0 0; color: var(--am-color-text-muted); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.panel-card h3:first-child { margin-top: 0; }
.panel-card .class { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.panel-card p { margin: 0; }
.panel-card .chips { flex-direction: row; margin: 0; }
.panel-card .keys { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
#ant-confirm { display: flex; flex-basis: 100%; flex-wrap: wrap; gap: 10px; }
.panel-card .keys p { flex-basis: 100%; margin: 0; color: var(--am-color-text-muted); font-size: 13px; }
.panel-card .keys button { padding: 6px 12px; font: inherit; font-size: 13px; color: var(--am-color-text); background: var(--am-color-surface);
  border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-control); cursor: pointer; }
.panel-card .keys button:hover { background: var(--am-color-surface-inset); }
/* An Ant's computer: one card to click, its name and state beside a little screen in the Ant's own enamel. */
.panel-computer { display: flex; flex-direction: column; gap: 10px; }
.panel-computer .computer { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 14px 14px 16px; font: inherit; text-align: left;
  color: var(--am-color-text); text-decoration: none; background: var(--am-color-surface-raised); border: var(--am-border-thin) solid var(--am-color-divider);
  border-radius: 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.panel-computer .computer:hover { background: var(--am-color-surface-inset); border-color: var(--am-color-border); }
.panel-computer .computer:disabled { cursor: progress; }
.panel-computer .computer:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
.panel-computer .what { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.panel-computer .title { font-size: 14px; font-weight: 600; }
.panel-computer .why { color: var(--am-color-text-muted); font-size: 12px; }
.panel-computer .failing .why { color: var(--am-color-error); }
.panel-computer .screen { flex: none; width: 72px; height: 46px; border-radius: 9px; box-shadow: inset 0 0 0 var(--am-border-thin) rgb(255 255 255 / 0.12);
  background: radial-gradient(120% 90% at 20% 15%, rgb(255 255 255 / 0.35), transparent 55%),
    linear-gradient(140deg, var(--enamel), color-mix(in oklab, var(--enamel) 55%, black)); transition: filter .2s; }
.panel-computer .computer:not(.awake) .screen { filter: grayscale(1) brightness(0.7); }
.panel-computer .sleep { align-self: flex-start; padding: 0; font: inherit; font-size: 12px; color: var(--am-color-text-muted); background: none; border: 0; cursor: pointer; }
.panel-computer .sleep:hover { color: var(--am-color-text); text-decoration: underline; }
/* An Ant's screen: one dark viewer window over the chat, the desktop inset in a stage, the two-part switch in a strip below it. */
dialog.ant-screen { --screen-dark: rgb(17 17 17); width: calc(100vw - 32px); height: calc(100dvh - 32px); max-width: none; max-height: none; padding: 0; overflow: hidden; color: rgb(255 255 255 / 0.92); background: var(--screen-dark);
  border: var(--am-border-thin) solid rgb(255 255 255 / 0.12); border-radius: var(--am-radius-panel); box-shadow: var(--am-elevation-panel); }
dialog.ant-screen[open] { display: flex; flex-direction: column; animation: review-in 160ms ease-out; }
dialog.ant-screen::backdrop { background: rgb(0 0 0 / 0.45); backdrop-filter: blur(3px); }
.ant-screen-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 4px 18px; }
.ant-screen-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: rgb(255 255 255 / 0.92); overflow-wrap: anywhere; }
/* The dialog opens with its title focused, as Settings and the review do: Safari rings a button focused by showModal(). */
.ant-screen-head h2:focus { outline: none; }
.ant-screen-close { display: grid; flex: none; place-items: center; width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); padding: 0; color: rgb(255 255 255 / 0.7); background: none; border: 0; border-radius: var(--am-radius-control); cursor: pointer; transition: background .15s, color .15s; }
.ant-screen-close:hover, .ant-screen-close:focus-visible { color: #fff; background: rgb(255 255 255 / 0.1); }
/* Named through the dialog so it outranks the panel's own button ring, which is dark and lost on this surface. */
dialog.ant-screen button:focus-visible { outline: var(--am-border-control) solid #fff; outline-offset: 2px; }
.ant-screen-stage { position: relative; flex: 1; min-height: 0; padding: 0 12px; background: var(--screen-dark); }
#ant-screen-view { position: relative; width: 100%; height: 100%; }
.ant-screen-note { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: 13px; color: rgb(255 255 255 / 0.7); pointer-events: none; }
.ant-screen-foot { display: flex; flex: none; align-items: center; justify-content: center; height: 56px; }
.ant-screen-mode { display: flex; gap: 2px; padding: 3px; background: rgb(255 255 255 / 0.08); border-radius: var(--am-radius-pill); }
.ant-screen-mode button { min-height: 32px; padding: 0 14px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--screen-dark); white-space: nowrap; background: rgb(255 255 255 / 0.95); border: 0; border-radius: var(--am-radius-pill); cursor: pointer; transition: background .15s, color .15s; }
.ant-screen-state { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 12px; min-height: 32px; font-size: 12.5px; font-weight: 600; color: rgb(255 255 255 / 0.7); white-space: nowrap; }
.ant-screen-mode button:disabled { opacity: .5; cursor: default; }
@media (max-width: 760px) { dialog.ant-screen { width: 100vw; height: 100dvh; border-radius: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.ant-screen[open] { animation: none; } .ant-screen-mode button, .ant-screen-close { transition: none; } }
.panel-card .keys .drop { color: var(--am-color-error); }
@media (prefers-reduced-motion: reduce) { .looks button:hover { transform: none; } }

/* Actions stay outside the markdown and bubble so copying never includes their labels. A pointer
   finds them in the gap under a message, so they take no room; a touch screen shows them in place once the message is tapped. */
.message-row { position: relative; margin-bottom: var(--am-space-5); }
.message-row > .msg { margin-bottom: 0; }
.room-preview { display: flex; flex-direction: column; width: 264px; min-width: 0; max-width: 100%; margin-top: var(--am-space-2); color: inherit; text-decoration: none; border-radius: 12px; }
.room-preview-body { display: flex; flex-direction: column; min-width: 0; }
.room-preview-body > .mini { color: var(--am-color-text); }
.room-preview:focus-visible { outline: 2px solid var(--am-color-focus); outline-offset: 2px; }
.room-preview-body > strong { padding: 0 2px; color: var(--am-color-text); font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-preview-body > span { padding: 0 2px; color: var(--am-color-text-muted); font-size: 12.5px; }
.room-preview:hover .room-preview-body > strong { text-decoration: underline; }
.room-preview:not(.room-created):hover .mini, .room-created .room-preview-body:hover .mini { box-shadow: 0 0 0 1px var(--am-color-border); }
.room-created { width: 100%; pointer-events: none; }
.room-created .room-preview-body { width: 264px; max-width: 100%; pointer-events: auto; }
.msg.room-created-status { margin: var(--am-space-2) 0 0; }
.room-created-name { padding-block: var(--am-space-2); pointer-events: auto; overflow-wrap: anywhere;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); }
.room-created-name:hover { color: var(--am-color-text); text-decoration-color: currentColor; }
.message-actions { display: flex; align-items: center; gap: var(--am-space-2); color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.message-row:has(> .you) .message-actions { justify-content: flex-end; }
.message-actions button { min-height: var(--am-metric-touch-target); padding: 0 var(--am-space-2); border: 0; border-radius: var(--am-radius-small); background: transparent; color: inherit; cursor: pointer; }
/* An Ant's reply reads flush left, so its first action's label does too; the padding stays as touch target. */
.message-row:not(:has(> .you)) .message-actions button:first-child { margin-inline-start: calc(-1 * var(--am-space-2)); }
.message-actions button:hover { background: var(--am-color-surface-inset); color: var(--am-color-text); }
.message-actions button:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); }
.message-reactions { display: contents; }
.reaction-chips { display: flex; align-items: center; flex-wrap: wrap; gap: var(--am-space-1); margin-top: var(--am-space-1); }
.reaction-chip { display: inline-flex; align-items: center; gap: var(--am-space-1); padding: 2px var(--am-space-2); border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-pill); background: var(--am-color-surface-inset); color: var(--am-color-text-muted); font-size: var(--am-type-caption-size); }
.message-row:has(> .you) .reaction-chips { justify-content: flex-end; }
.reaction-picker { position: absolute; z-index: 3; inset: 100% auto auto 0; scroll-margin-block: var(--am-space-2); display: flex; align-items: center; gap: 2px; padding: var(--am-space-1); border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-pill); background: var(--am-color-surface); }
.reaction-picker[hidden] { display: none; }
.message-row:has(> .you) .reaction-picker { inset-inline: auto 0; }
.reaction-picker button { min-width: var(--am-metric-touch-target); min-height: var(--am-metric-touch-target); padding: 0; border: 0; border-radius: var(--am-radius-pill); background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
.reaction-picker button:is(:hover, [aria-pressed="true"]) { background: var(--am-color-surface-inset); }
.reaction-picker[data-still] button:not([aria-pressed="true"]) { background: transparent; }
.reaction-picker button:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); }
[data-pointer] :is(.message-actions, .reaction-picker) button:focus-visible { outline: none; }
.reply-to.reaction-reply-to { margin-inline: 0 auto; }
@media not ((hover: hover) and (pointer: fine)) { .message-row:not(.open) .message-actions { display: none; } }
@media (hover: hover) and (pointer: fine) {
  /* The gap is wide enough that the actions hang just under their own message and clear of the next one. The row's own
     padding is the space above them, so a mouse moving down onto them never leaves the row and hides them. */
  .message-row { margin-bottom: calc(var(--am-space-8) - var(--am-space-1)); padding-bottom: var(--am-space-1); }
  .message-actions { position: absolute; inset: 100% 0 auto; height: var(--am-space-5); white-space: nowrap; opacity: 0; }
  .reaction-picker { top: calc(100% + var(--am-space-5)); }
  .message-actions button { min-height: 0; height: 100%; }
  .message-row:is(:hover, :focus-within) .message-actions { opacity: 1; }
}
/* Activity, as the Mac draws it: four tiles (two on a phone), failures by reason, then each day's rows on one card, a lamp
   in the kind's color beside each. The page's 22 px gap would part a heading from its own lines, so those pull back up. */
/* It is a Settings tab (#3076): the dialog is its one scroller, and its own rows outrank Settings' card rules. */
#settings .activity { display: flex; flex-direction: column; gap: 22px; font-size: 14px; }
#settings .activity > h3 { margin: 0; }
#settings .activity > h3:focus { outline: none; }
.activity .meta { margin: 0; color: var(--am-color-text-muted); font-size: 12px; }
.activity .meta + :is(.card, .stats) { margin-top: -14px; }
.activity .card.items, .activity .stats, .activity .failures, .activity .feed { margin: 0; }
#settings .activity .card.items { padding: 2px 16px; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--am-color-divider); }
#settings .activity .card.items li { min-height: 0; padding: var(--am-space-3) 0; }
.activity .card.items li .status { margin-top: 3px; }
#settings .activity .card.items button { flex: none; min-height: 0; height: 36px; border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-pill); background: none; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0; list-style: none; }
.stats li { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--am-color-surface); box-shadow: inset 0 0 0 1px var(--am-color-divider); }
.stats strong { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats span { color: var(--am-color-text-muted); font-size: 12px; }
.stats .ok strong { color: var(--am-color-success); }
.stats .alarm { box-shadow: inset 0 0 0 var(--am-border-control) var(--am-color-error); }
.stats .alarm strong { color: var(--am-color-error); }
.failures, .feed { padding: 4px 0; list-style: none; border-radius: 12px; background: var(--am-color-surface); box-shadow: inset 0 0 0 1px var(--am-color-divider); }
.failures li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 16px; }
.failures code { overflow-wrap: anywhere; font-size: 12.5px; }
.failures span { flex: none; padding: 1px 8px; border: 1px solid var(--am-color-error); border-radius: var(--am-radius-pill); color: var(--am-color-error); font-size: 11px; font-weight: 600; }
.activity .day { display: flex; flex-direction: column; gap: 8px; margin-top: -10px; }
.activity .day h4 { margin: 0; color: var(--am-color-text-muted); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.feed > li { position: relative; padding: 12px 16px 12px 34px; }
.feed > li + li { border-top: var(--am-border-thin) solid var(--am-color-divider); }
.feed > li::before { content: ""; position: absolute; top: 18px; left: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--am-color-text-muted); }
.feed > li.message::before { background: var(--am-color-text); }
.feed > li.request::before { background: var(--am-color-success); }
.feed > li.bad::before { background: var(--am-color-error); }
.feed .line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.feed .line strong { font-size: 13.5px; font-weight: 600; }
.feed .label { color: var(--am-color-text-muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.feed .bad .label { color: var(--am-color-error); }
.feed .warn .label { padding: 0 6px; border-radius: var(--am-radius-pill); background: var(--am-color-warning-surface); color: var(--am-color-warning); }
.feed .line time { margin-left: auto; color: var(--am-color-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed .meta { margin-top: 3px; }
.feed .said { margin: 5px 0 0; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
:is(.feed .log .said, .trace .said) { color: var(--am-color-text-muted); font: 11.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.feed button { margin-top: 8px; min-height: 32px; padding: 0 14px; border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-pill);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--am-color-text); background: none; cursor: pointer; }
.trace { display: flex; flex-direction: column; gap: 8px; }
.trace h4 { margin: 0; font-size: 15px; font-weight: 600; }
.trace .card + h4 { margin-top: 14px; }
.activity :is(.quiet, .notice) { margin: 0; padding: 32px 16px; border: 1px dashed var(--am-color-divider); border-radius: 12px; color: var(--am-color-text-muted); text-align: center; }
.activity .notice { padding: 10px 16px; border-style: solid; text-align: left; }
/* The plain page (#3076): two counts, what each Ant did, then sharing and the Technical view behind its one control. */
.activity #activity-today { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feed > li.work::before { background: var(--am-color-success); }
.feed > li.work.bad::before { background: var(--am-color-error); }
.feed .line strong { overflow-wrap: anywhere; }
.feed .why { color: var(--am-color-error); }
.feed .meta a { color: inherit; font-weight: 600; }
.feed .more { margin-top: 10px; }
.feed.plain > li.message { padding-left: 16px; }
.feed.plain > li.message::before { content: none; }
.feed.plain .line { flex-wrap: nowrap; }
.feed.plain .line strong { flex: 1; min-width: 0; }
.feed .line .end { display: flex; flex: none; align-items: baseline; gap: 4px; white-space: nowrap; }
.feed .line button { min-width: 44px; min-height: 44px; margin: -14px -8px -14px 0; padding: 0 8px; border: 0; border-radius: 8px; color: var(--am-color-text-muted); font-weight: 400; text-decoration: underline; }
.activity .technical:focus { outline: none; }
.feed .more ol { display: block; margin: 3px 0 0; padding-left: 18px; }
#settings .activity .feed .more ol li { display: list-item; padding: 0; border: 0; }
.activity .technical-toggle { align-self: flex-start; min-height: 36px; padding: 0 14px; border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-pill);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--am-color-text); background: none; cursor: pointer; }
.activity .technical-toggle[aria-expanded="true"] { color: var(--am-color-canvas); background: var(--am-color-text); }
.activity .technical { display: flex; flex-direction: column; gap: 22px; }
/* Calls, as the Mac draws its call list: the chips, sharing and Pause, then each request's Ants, a row per call. */
.calls { display: flex; flex-direction: column; gap: 12px; }
.calls .day { margin-top: 0; }
.calls .ant { display: flex; flex-direction: column; gap: 6px; }
#settings .calls h5 { margin: 4px 0 0; font-size: 13px; font-weight: 600; }
.activity .usage-sharing { padding: 12px 16px; border-radius: 12px; background: var(--am-color-surface); box-shadow: inset 0 0 0 1px var(--am-color-divider); }
#settings .activity .usage-sharing h3 { margin: 0; }
#settings .activity .usage-sharing .status { font-size: 12px; }
.activity .usage-switch { border-radius: 12px; font: inherit; color: var(--am-color-text); background: none; cursor: pointer; }
.calls .follow { display: flex; gap: 8px; }
:is(.calls .follow, .activity .usage-sharing) button:not([role=switch]) { min-height: 32px; padding: 0 14px; border: var(--am-border-thin) solid var(--am-color-border); border-radius: var(--am-radius-pill);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--am-color-text); background: none; cursor: pointer; }
.usage-sharing > button { margin-top: 10px; }
#call-drawer { margin-top: 10px; }
#call-drawer .status { overflow-wrap: anywhere; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* A helper out (#2708): a placeholder mark, a second face at the head's lower corner, so no name, row or header moves when it comes; the count shows past one. */
.head { position: relative; }
.helper-mark { position: absolute; left: -5px; bottom: -5px; width: 14px; height: 14px; display: inline-flex; flex: none; pointer-events: none; }
.helper-mark .mini { width: 100%; height: 100%; border-radius: 50%; box-sizing: border-box; background: url(ant-head.png) 50% 69% / 84% no-repeat var(--enamel); box-shadow: 0 0 0 1.5px var(--am-color-success), 0 0 0 3px var(--am-color-surface); }
.helper-mark b { position: absolute; right: -5px; top: -7px; min-width: 11px; height: 11px; padding: 0 2px; box-sizing: border-box; border-radius: 6px; background: var(--am-color-text); color: var(--am-color-surface); font-size: 8px; font-weight: 700; line-height: 11px; text-align: center; }
.sidebar[data-slim="true"] .helper-mark { display: none; }
/* What an Ant made, opened over the page (viewer.js): the card, slim solid bar and keys of a Room's expanded card, over a dimmed page. */
.viewer { position: fixed; inset: 0; z-index: 40; display: flex; padding: var(--am-space-4); background: rgb(0 0 0 / .46); backdrop-filter: blur(3px); }
.viewer-card { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; outline: 0; background: var(--am-color-surface);
  border: var(--am-border-thin) solid var(--am-color-divider); border-radius: 12px; box-shadow: var(--am-elevation-panel); }
.viewer-bar { display: flex; flex: none; align-items: center; gap: var(--am-space-2); min-height: 40px; padding: 0 var(--am-space-1) 0 var(--am-space-3);
  font-size: var(--am-type-caption-size); background: var(--am-color-surface-inset); border-bottom: var(--am-border-thin) solid var(--am-color-divider); }
.viewer-bar strong { min-width: 0; overflow: hidden; font-weight: var(--am-type-label-weight); white-space: nowrap; text-overflow: ellipsis; }
.viewer-bar .by { color: var(--am-color-text-muted); white-space: nowrap; }
.viewer-bar .grow { flex: 1; }
.viewer .key { display: grid; flex: none; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--am-color-text-muted); background: none; border: 0;
  border-radius: var(--am-radius-control); cursor: pointer; }
.viewer .key[hidden] { display: none; }
.viewer .key:hover, .viewer .key[aria-pressed="true"] { color: var(--am-color-text); background: var(--am-color-selection); }
.viewer :is(.key, .viewer-strip a, .pages, .viewer-doc):focus-visible { outline: 2px solid var(--am-color-focus); outline-offset: -2px; }
/* The artifact starts under the bar and never runs under it: a picture whole, a page or a document filling its frame, a PDF's pages down a column. */
.viewer-stage { display: grid; flex: 1; min-height: 0; overflow: auto; }
.viewer-stage > :is(img, video) { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.viewer-stage > iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-stage .pages { display: flex; flex-direction: column; align-items: center; gap: var(--am-space-4); padding: var(--am-space-5) var(--am-space-4); overflow-y: auto;
  background: var(--am-color-surface-inset); }
.viewer-stage .pages canvas { width: min(100%, 900px); height: auto; background: #fff; box-shadow: var(--am-elevation-panel); }
/* Rich Markdown and full plain-text artifacts: inherit the web app's reading face and Atomic day/night palette, extending .md. */
.viewer-stage .viewer-doc { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: auto; background: var(--am-color-surface); color: var(--am-color-text);
  text-rendering: optimizeLegibility; font-kerning: normal; }
.viewer-stage .doc-body { width: 100%; max-width: 74ch; margin: 0 auto; padding: clamp(24px, 4.5vw, 52px) clamp(20px, 5vw, 48px) clamp(48px, 8vw, 80px);
  font-size: var(--am-type-body-size); line-height: 1.68; overflow-wrap: break-word; text-wrap: pretty; }
.doc-body :is(h1, h2, h3, h4, h5, h6) { color: var(--am-color-text); text-wrap: balance; scroll-margin-top: var(--am-space-6); }
.doc-body h1 { margin: 0 0 var(--am-space-4); padding-bottom: var(--am-space-3); font-size: clamp(1.625rem, 2.5vw, 2rem); line-height: 1.2;
  font-weight: var(--am-type-heading-weight); letter-spacing: var(--am-type-heading-tracking); border-bottom: var(--am-border-thin) solid var(--am-color-divider); }
.doc-body h2 { margin: var(--am-space-8) 0 var(--am-space-3); font-size: var(--am-type-subheading-size); line-height: var(--am-type-subheading-line-height);
  font-weight: var(--am-type-subheading-weight); letter-spacing: var(--am-type-subheading-tracking); }
.doc-body h3 { margin: var(--am-space-6) 0 var(--am-space-2); font-size: 1.125rem; line-height: 1.35; font-weight: 600; letter-spacing: -0.005em; }
.doc-body h4 { margin: var(--am-space-5) 0 var(--am-space-2); font-size: 1rem; line-height: 1.4; font-weight: 600; }
.doc-body :is(h5, h6) { margin: var(--am-space-4) 0 var(--am-space-2); font-size: var(--am-type-caption-size); line-height: 1.4; font-weight: 600; color: var(--am-color-text-muted); }
.doc-body .doc-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--am-space-1) var(--am-space-4); margin: 0 0 var(--am-space-6);
  padding: var(--am-space-3) var(--am-space-4); font-size: var(--am-type-caption-size); line-height: 1.45;
  background: var(--am-color-surface-inset); border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-control); }
.doc-body .doc-meta dt { color: var(--am-color-text-muted); font-weight: var(--am-type-label-weight); }
.doc-body .doc-meta dd { margin: 0; min-width: 0; color: var(--am-color-text); overflow-wrap: anywhere; }
.doc-body :is(p, ul, ol, pre, blockquote) { margin: 0 0 var(--am-space-4); }
.doc-body :is(ul, ol) { padding-left: 1.5em; }
.doc-body li + li { margin-top: 0.35em; }
.doc-body li > :is(ul, ol) { margin: 0.35em 0 0; }
.doc-body li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.35em; }
.doc-body input[type="checkbox"] { margin: 0 0.45em 0 0; accent-color: var(--am-color-action); vertical-align: -1px; }
.doc-body hr { border: 0; border-top: var(--am-border-thin) solid var(--am-color-divider); margin: var(--am-space-6) 0; }
.doc-body blockquote { padding: var(--am-space-3) var(--am-space-4); border-left: 3px solid var(--am-color-border);
  background: color-mix(in srgb, var(--am-color-surface-inset) 65%, transparent); border-radius: 0 var(--am-radius-small) var(--am-radius-small) 0; color: var(--am-color-text-muted); }
.doc-body blockquote > :last-child { margin-bottom: 0; }
.doc-body code { padding: 0.1em 0.36em; background: var(--am-color-surface-inset); border: var(--am-border-thin) solid var(--am-color-divider); border-radius: 5px; }
.doc-body pre { padding: var(--am-space-4); background: var(--am-color-surface-inset); border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-control); line-height: 1.55; }
.doc-body pre code { padding: 0; background: none; border: 0; }
.doc-body a { color: var(--am-color-link); text-underline-offset: 2px; text-decoration-thickness: 1px; }
.doc-body a.doc-file { font-weight: 500; }
.doc-body :where(.table-scroll) { margin: var(--am-space-5) 0; background: var(--am-color-surface-raised); }
.doc-body .table-scroll > table { font-size: 0.9375rem; line-height: 1.45; }
.doc-body :is(th, td) { padding: 10px 14px; }
.doc-body th { border-bottom-width: 1.5px; }
.doc-body img.doc-img { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; margin: var(--am-space-4) 0;
  border-radius: var(--am-radius-control); border: var(--am-border-thin) solid var(--am-color-divider); background: var(--am-color-surface-inset); }
.doc-body .table-scroll img.doc-img { margin: 0; border: 0; border-radius: var(--am-radius-small); }
.doc-body .table-scroll td[align="center"] img.doc-img { margin-inline: auto; }
.doc-body .table-scroll td[align="right"] img.doc-img { margin-left: auto; }
.doc-body img.surface { background: var(--am-palette-ivory); border: var(--am-border-thin) solid var(--am-color-divider); padding: var(--am-space-3); }
.doc-body :is(.doc-img-ext, .doc-img-note) { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; padding: 6px 12px;
  font-size: var(--am-type-caption-size); line-height: 1.35; background: var(--am-color-surface-inset); border: var(--am-border-thin) solid var(--am-color-divider);
  border-radius: var(--am-radius-small); text-decoration: none; }
.doc-body .doc-img-ext:hover { text-decoration: underline; }
.doc-body .doc-img-host { color: var(--am-color-text-muted); }
.doc-body .doc-img-ext::after { content: " \2197"; }
.doc-body .doc-img-note { color: var(--am-color-text-muted); }
.viewer-stage .doc-plain { width: 100%; max-width: 86ch; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(18px, 4vw, 40px) clamp(40px, 7vw, 64px);
  font: var(--am-type-code-size)/1.65 var(--am-font-code); color: var(--am-color-text); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.viewer-stage .none { display: flex; flex-direction: column; align-items: center; gap: var(--am-space-3); place-self: center; margin: 0; padding: var(--am-space-6);
  color: var(--am-color-text-muted); text-align: center; }
.viewer-stage .none img { width: 96px; }
/* A reply's other files, as small tiles in a solid strip under the artifact; the open one is ringed. A page is drawn 640 wide, as on its tile. */
.viewer-strip { display: flex; flex: none; justify-content: center; gap: var(--am-space-2); padding: var(--am-space-2); overflow-x: auto;
  background: var(--am-color-surface-inset); border-top: var(--am-border-thin) solid var(--am-color-divider); }
.viewer-strip[hidden] { display: none; }
.viewer-strip .pic { flex: none; width: 60px; height: 44px; aspect-ratio: auto; margin: 0; border-radius: var(--am-radius-small); opacity: .7; }
.viewer-strip .pic:hover { opacity: 1; }
.viewer-strip .pic[aria-current] { opacity: 1; box-shadow: 0 0 0 2px var(--am-color-focus); }
.viewer-strip .pic iframe { width: 640px; height: 470px; transform: scale(.09375); }
@media (prefers-reduced-motion: no-preference) { .viewer { animation: viewer-in 160ms ease-out; } }
@keyframes viewer-in { from { opacity: 0; } }
/* A phone shows the artifact alone, edge to edge, with keys a finger can press. */
@media (max-width: 760px) {
  .viewer { padding: 0; }
  .viewer-card { border: 0; border-radius: 0; }
  .viewer-bar { min-height: 48px; }
  .viewer .key { width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); }
  .viewer-stage .doc-body { padding: 20px 18px 40px; }
  .doc-body :is(th, td) { padding: 8px 10px; }
  .doc-body .table-scroll img.doc-img { max-width: 96px; max-height: 72px; }
  .viewer-stage .doc-plain { padding: 18px 16px 36px; }
}
/* The chat key (viewer.js). Wide, the page's own chat is a card of its own to the artifact's right, as it was beside an expanded card:
   nothing of the chat is drawn twice, so what is asked there is the conversation's. The reply that made the artifact wears a ring. */
.art.viewed .pic, .picture.viewed img, img.viewed { box-shadow: 0 0 0 2px var(--am-color-focus); }
.viewer-ask { display: none; }
@media (min-width: 761px) {
  :root[data-viewer="talk"] .viewer { padding-right: calc(min(380px, 42%) + 2 * var(--am-space-4)); }
  :root[data-viewer="talk"] .app > .chat { position: fixed; z-index: 41; inset: var(--am-space-4) var(--am-space-4) var(--am-space-4) auto; width: min(380px, 42%); height: auto; overflow: hidden;
    background: var(--am-color-canvas); border: var(--am-border-thin) solid var(--am-color-divider); border-radius: 18px; box-shadow: var(--am-elevation-panel); }
}
/* A phone has no room beside the artifact: the key brings one line to ask from to its foot, with the last thing said and its answer above the line. */
@media (max-width: 760px) {
  :root[data-viewer="talk"] .viewer-ask { display: block; flex: none; padding: var(--am-space-2) var(--am-space-3) calc(var(--am-space-3) + env(safe-area-inset-bottom, 0px));
    background: var(--am-color-canvas); border-top: var(--am-border-thin) solid var(--am-color-divider); }
  .viewer-said { max-height: 32vh; overflow-y: auto; padding: var(--am-space-2) 0 var(--am-space-1); }
  .viewer-said .msg { max-width: 100%; margin-bottom: var(--am-space-2); }
  .viewer-said .status { margin-bottom: var(--am-space-2); }
  .viewer-said .links { display: flex; gap: var(--am-space-4); margin: 0 0 var(--am-space-2); }
  .viewer-said .links button { min-height: var(--am-metric-touch-target); padding: 0; color: var(--am-color-text-muted); background: none; border: 0; font: inherit;
    font-size: var(--am-type-caption-size); text-decoration: underline; cursor: pointer; }
  .viewer-ask form { display: flex; align-items: flex-end; gap: var(--am-space-2); padding: 6px 6px 6px var(--am-space-4); background: var(--am-color-surface);
    border: var(--am-border-thin) solid var(--am-color-border); border-radius: 22px; }
  .viewer-ask form:focus-within { border-color: var(--am-color-focus); }
  .viewer-ask textarea { flex: 1; min-width: 0; min-height: 32px; max-height: 30vh; padding: 5px 0; color: inherit; background: none; border: 0; outline: 0; font: inherit; resize: none; field-sizing: content; }
  .viewer-ask .send { display: grid; flex: none; place-items: center; width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); padding: 0; color: var(--am-color-text-muted);
    background: var(--am-color-selection); border: 0; border-radius: var(--am-radius-control); cursor: pointer; }
  .viewer-ask form:has(textarea:not(:placeholder-shown)) .send { color: var(--am-color-canvas); background: var(--am-color-text); }
  .viewer-ask :is(.send, .links button):focus-visible { outline: 2px solid var(--am-color-focus); outline-offset: 2px; }
}
/* Everything's key beside a chat's name (Web.Every): the mark alone, laid beside the name's chip and out of the bar's flow, so the name stays where it was. */
/* A long name leaves room for the key on each side of the bar's middle, so the key never runs under the page's own corner keys. */
.chat > .bar > h1 { position: relative; max-width: calc(100% - 2 * (36px + var(--am-space-2))); }
.every-key { position: absolute; top: 50%; left: calc(100% + var(--am-space-2)); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; translate: 0 -50%;
  color: var(--am-color-text-muted); background: var(--am-color-surface-raised); border: var(--am-border-thin) solid var(--am-color-divider); border-radius: 50%;
  box-shadow: var(--am-elevation-panel); cursor: pointer; }
.every-key:hover { color: var(--am-color-text); background: var(--am-color-surface-inset); }
.every-key:focus-visible, .every-close:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
@media (pointer: coarse) { .every-key { width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); } }
/* Everything as a layer: the page itself in a card over the dimmed chat, under the viewer a tile of it opens. */
.every { position: fixed; inset: 0; z-index: 30; display: flex; padding: var(--am-space-6) max(var(--am-space-4), 6%); background: rgb(0 0 0 / .46); backdrop-filter: blur(3px); }
.every-card { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow: hidden; outline: 0; background: var(--am-color-canvas);
  border: var(--am-border-thin) solid var(--am-color-divider); border-radius: var(--am-radius-panel); box-shadow: var(--am-elevation-panel); }
.every .today.library { padding: var(--am-space-5) var(--am-space-6) var(--am-space-6); }
.every .today.library > :not(.undo) { max-width: none; }
.every .today-head { padding-right: 0; }
.every-close { display: grid; flex: none; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--am-color-text-muted); background: none; border: 0;
  border-radius: var(--am-radius-control); cursor: pointer; }
.every-close:hover { color: var(--am-color-text); background: var(--am-color-selection); }
@media (prefers-reduced-motion: no-preference) { .every { animation: viewer-in 160ms ease-out; } }
/* On a phone it is a sheet from the bottom, two tiles a row. */
@media (max-width: 760px) {
  .every { align-items: flex-end; padding: var(--am-space-6) 0 0; }
  .every-card { max-height: 100%; border-bottom: 0; border-radius: 18px 18px 0 0; }
  .every .today.library { padding: var(--am-space-4) var(--am-space-4) calc(var(--am-space-5) + env(safe-area-inset-bottom, 0px)); }
  .every .today-head { flex-wrap: nowrap; }
  .every .today-head h1 { flex: 1; min-width: 0; overflow: hidden; font-size: 19px; white-space: nowrap; text-overflow: ellipsis; }
  .every .sort label { display: none; }
  .every .find input { width: 100%; }
  .every .tiles { grid-template-columns: 1fr 1fr; gap: var(--am-space-4) var(--am-space-3); }
  .every-close { width: var(--am-metric-touch-target); height: var(--am-metric-touch-target); }
}
/* A Room is a chat on a subject (#2977): its page is the chat page, its title the bar's chip with the Room's mark, and its link its mark beside
   its name and how many files it holds, as an Ant's tile is its head beside two lines. */
.ant-open.room-open { padding-left: 12px; }
.ant-open.room-open > svg { color: var(--am-color-text-muted); }
.chat > .space-gone { position: static; transform: none; margin: auto; }
.room-preview-body { flex-direction: row; align-items: center; gap: 14px; }
.room-mark { display: grid; flex: none; place-items: center; width: 56px; height: 56px; color: var(--am-color-text-muted); background: var(--am-color-surface); border-radius: 12px;
  box-shadow: 0 0 0 1px var(--am-color-divider); }
.room-words { display: flex; flex-direction: column; min-width: 0; }
.room-words > strong { color: var(--am-color-text); font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-words > span { color: var(--am-color-text-muted); font-size: 12.5px; }
.room-preview:hover .room-words > strong { text-decoration: underline; }
/* Everything in a Room names the Room, and the name there is how it is renamed, as the canvas page's title was. */
.every-room { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3em; }
.every-room .room-name-editor { display: inline-flex; min-width: 0; max-width: 100%; }
.every-room #room-name { padding: 0; text-align: left; color: inherit; background: none; border: 0; font: inherit; text-decoration: underline dotted; text-underline-offset: 4px; cursor: text; }
.every-room #room-name:focus-visible { outline: var(--am-border-control) solid var(--am-color-focus); outline-offset: 2px; }
.every-room #room-name-input { min-width: 12ch; padding: 2px 8px; color: inherit; background: var(--am-color-surface); border: var(--am-border-thin) solid var(--am-color-border);
  border-radius: var(--am-radius-small); font: inherit; }
.every-room #room-name-error { flex-basis: 100%; margin: 4px 0 0; color: var(--am-color-error); font-size: var(--am-type-caption-size); font-weight: 400; }
/* A Room's name in its sheet's heading is how it is renamed, so a phone wraps it under "Everything in" and never cuts it. */
@media (max-width: 760px) { .every .today-head h1.every-room { overflow: visible; white-space: normal; text-overflow: clip; } .every .today-head:has(.every-room) { align-items: flex-start; } }
/* The box that renames the Room stays inside the heading's own width, so on a phone it never runs under Sort and Close. */
.every-room #room-name-form { min-width: 0; max-width: 100%; }
@media (max-width: 760px) { .every-room .room-name-editor:has(form), .every-room #room-name-form { flex: 1 1 100%; } .every-room #room-name-input { width: 100%; min-width: 0; } }
