/* The signed-in app as a chat with agents (the owner, 2026-11-25, with three reference screenshots: "I want anticode to
   look like these images combined"):
   - the home: a dotted ground, "Good evening, Sam" in the middle and one wide rounded box under it, with + at the left and
     the microphone and send at the right; where it runs, the project, team, effort and mode stay in a quiet row under it
   - the sidebar: small type (13px), New, Search, Startups, Artifacts, Grow and Connectors, then Recents, each a chat: the
     project's own little character in a circle, its name in bold and the latest line said in it in grey
   - the builder's chat: your words in a pill at the right, the replies as plain text on soft dark cards, a question's
     answers lettered A, B, C, and a detail panel at the right (chat-pills.js detail) with the project's character, name,
     Activity and Library, each part in a quiet rounded card
   Loaded after calm.css, home-env.css and ui.css on the dashboard (dashboard.html), and after chat-pills.css in the
   builder (chat-pills.js). Dark only. Surfaces are told apart by fill alone, never outlines.

   Tokens, darker than calm's greys to match the references:
     side   #0e0e0f   the sidebar, and the ground round the work area
     main   #131314   the work area
     card   #1b1b1d   replies, cards, menus
     hover  #222225   a row under the pointer
     sel    #29292c   the current row, a picked tab
     box    #1a1a1c   the prompt box, a 1px #2e2e31 edge (#45454a while typing)
     text   #f2f2f3   17.4:1 on main, 15.9:1 on card
     body   #d3d3d6   12.8:1 on main
     muted  #8f8f96   6.0:1 on main, 5.5:1 on card, 4.6:1 on sel */
body.dash, .build {
  --c-side: #0e0e0f; --c-main: #131314; --c-card: #1b1b1d; --c-hover: #222225; --c-sel: #29292c; --c-edge: #2a2a2d;
  --c-well: #0e0e0f; --c-pop: #1b1b1d; --c-quiet: #222225; --c-quiet-hover: #2c2c30; --c-off: #29292c;
  --c-box: #1a1a1c; --c-box-edge: #2e2e31; --c-box-edge-on: #45454a; --c-box-ph: #8f8f96;
  --text: #f2f2f3; --body: #d3d3d6; --muted: #8f8f96;
  --al-r: 14px;
}

/* ======================= sidebar (dashboard .side, builder .wsnav) ======================= */
.dash:not(.is-collapsed) .side, body .build.ws > .wsnav { font-size: 13px; }
:root body.dash:not(.is-collapsed) .side :is(.snav > a, .snav > button, .recent-list a), body .build .wsnav-links a { font-size: 13px; }
:root body.dash:not(.is-collapsed) .side .snav > :is(a, button), body .build .wsnav-links a { height: 32px; border-radius: 8px; }
.dash .recents-head, body .build .wsnav-h { margin-top: 14px; font-size: 12px; font-weight: 500; color: var(--muted); }

/* a Recents row as a chat: character, bold name, a grey line */
.dash:not(.is-collapsed) .recent-list a, body .build .wsnav-recents a {
  display: flex; align-items: center; gap: 10px; height: auto; min-height: 48px; padding: 7px 8px; border-radius: 10px;
}
.dash .recent-list .dot, body .build .wsnav-recents .wsnav-dot { display: none; }
:is(.dash .recent-list, .build .wsnav-recents) .rc-av {
  flex: none; display: block; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--c-sel);
}
:is(.dash .recent-list, .build .wsnav-recents) .rc-av svg { display: block; width: 100%; height: 100%; }
:is(.dash .recent-list, .build .wsnav-recents) .rc-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
:is(.dash .recent-list, .build .wsnav-recents) .rc-name {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.3;
}
:is(.dash .recent-list, .build .wsnav-recents) .rc-line {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.35;
}
.dash .recent-list .rc-row.has-more > a { padding-right: 30px; }
:is(.dash .recent-list a, .build .wsnav-recents a):hover { background: var(--c-hover); }
:is(.dash .recent-list a, .build .wsnav-recents a)[aria-current="page"] { background: var(--c-sel); }
/* the collapsed rail shows the characters alone */
.dash.is-collapsed .recent-list .rc-text { display: none; }

/* ======================= dashboard home: greeting, box, plain ground ======================= */
/* the work area sits on the sidebar's ground as one rounded sheet (wide windows), plain: no dotted grid or picture
   behind the home (the owner, 2026-11-25: "remove dotted grid", then "nothing" for a replacement) */
@media (min-width: 821px) {
  html:not(.in-desk) .dash .panel { margin: 8px 8px 8px 0; border-radius: var(--al-r); background: var(--c-main); }
}
.dash .view-home .panel-backdrop, .dash .panel-backdrop { display: none; }

/* the greeting and the box together in the middle; the card of recent projects gives way (they're in the sidebar, and
   the row under the box still picks where it runs and which project) */
.dash .view-home .home-main { justify-content: center; min-height: calc(100dvh - 140px); padding-bottom: 6vh; }
/* the templates shelf (home-env.css) starts under it, its top in view at the foot of the first screen */
.dash .view-home .home-main > .greet {
  display: block; order: 0; position: static; height: auto; min-height: 0; margin: 0 0 28px; padding: 0; text-align: center;
  color: var(--text); font-size: clamp(26px, 3vw, 32px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.2;
}
.dash .view-home .env-card { display: none; }
.dash .view-home .use-warn { order: 1; width: 100%; max-width: 800px; margin: 0 0 10px; }
.dash .view-home .dcomp { order: 2; position: relative; inset: auto; max-width: 800px; margin: 0; }
.dash .view-home .dcomp-box {
  padding: 8px 8px 8px 10px; border-radius: calc(18px + 8px); background: var(--c-box); box-shadow: inset 0 0 0 1px var(--c-box-edge);
}
.dash .view-home .dcomp:focus-within .dcomp-box { background: var(--c-box); box-shadow: inset 0 0 0 1px var(--c-box-edge-on); }
.dash .view-home .dcomp textarea { min-height: 40px; padding: 9px 8px; font-size: 15px; }
/* + at the left, as a quiet disc */
:root .dash .view-home .dcomp .dcomp-plus { width: 36px; height: 36px; border-radius: 50%; background: var(--c-hover); color: var(--text); }
:root .dash .view-home .dcomp .dcomp-plus:hover { background: var(--c-quiet-hover); }
.dash .view-home .dbar { order: 3; padding: 4px 4px 0; }

/* ======================= builder: the chat ======================= */
#build.cp { --cp-card: var(--c-card); --cp-sel: var(--c-sel); --cp-ground: var(--c-main); --cp-col: 720px; }
/* replies: plain text on a soft dark card */
#build.cp .thread .msg-agent { padding: 12px 16px; border-radius: var(--al-r); background: var(--c-card); }
#build.cp .thread .msg-agent p { color: var(--body); }
#build.cp .thread :is(.result:not(.qa), .release) { padding: 12px 16px; border-radius: var(--al-r); background: var(--c-card); }
/* your words: a pill at the right */
#build.cp .msg-user { padding: 9px 16px; border-radius: 20px; background: var(--c-sel); }
/* a question's answers lettered A, B, C on small rounded squares (the radio stays the control underneath) */
#build.cp .qa { border-radius: 18px; background: var(--c-card); }
#build.cp .qa-opts { counter-reset: al-opt; }
#build.cp .qa-opt { position: relative; counter-increment: al-opt; }
#build.cp .qa-opt input { width: 24px; height: 24px; border-radius: 7px; background: var(--c-sel); box-shadow: none; }
#build.cp .qa-opt::before {
  content: counter(al-opt, upper-alpha); position: absolute; left: 8px; top: 50%; width: 24px; translate: 0 -50%;
  text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 24px; pointer-events: none;
}
#build.cp .qa-opt input:checked { background: var(--cp-go); box-shadow: none; }
#build.cp .qa-opt:has(input:checked)::before { color: var(--cp-on-go); }
#build.cp .qa-opt:has(input[type="checkbox"])::before { content: none; }
/* the box at the foot: the home's rounder box */
#build.cp .ask .ask-card, #build.cp .ask-box { border-radius: 18px; }

/* ======================= builder: the detail panel (chat-pills.js detail) ======================= */
#build.cp .al-detail { display: none; }
@media (min-width: 1200px) {
  #build.cp[data-page="chat"][data-detail="open"] > #rail { padding-right: 312px; }
  #build.cp[data-page="chat"][data-detail="open"] .al-detail {
    display: flex; flex-direction: column; gap: 10px; position: absolute; top: 56px; right: 12px; bottom: 12px; width: 288px;
    overflow: hidden auto; scrollbar-width: thin; scrollbar-color: var(--c-sel) transparent;
  }
}
#build.cp .al-who { display: grid; justify-items: center; gap: 10px; padding: 18px 12px 6px; text-align: center; }
#build.cp .al-av { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--c-sel); }
#build.cp .al-av svg { display: block; width: 100%; height: 100%; }
#build.cp .al-name { margin: 0; color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
#build.cp .al-state { margin: -6px 0 0; color: var(--muted); font-size: 12.5px; }
#build.cp .al-tabs { display: flex; justify-content: center; gap: 4px; padding-bottom: 4px; }
#build.cp .al-tab {
  height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
#build.cp .al-tab:hover { color: var(--text); }
#build.cp .al-tab[aria-selected="true"] { background: var(--c-sel); color: var(--text); }
#build.cp .al-tab:focus-visible, #build.cp .al-row:focus-visible { outline: var(--cp-ring); outline-offset: 2px; }
/* one column no wider than the panel: a grid track otherwise grows to its longest unwrapped line, and the cards ran
   off the panel's right edge with the words cut instead of ending in "…" */
#build.cp .al-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
#build.cp .al-pane[hidden] { display: none; }
#build.cp .al-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 6px; border-radius: var(--al-r); background: var(--c-card); }
#build.cp .al-h { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 6px 8px 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
#build.cp .al-row {
  display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: 100%; min-width: 0; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 9px;
  background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer;
}
#build.cp .al-row:hover:not(:disabled) { background: var(--c-hover); }
#build.cp .al-row:disabled { color: var(--muted); cursor: default; }
#build.cp .al-row .i { flex: none; width: 16px; height: 16px; color: var(--body); }
#build.cp .al-row span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#build.cp .al-row small { flex: none; color: var(--muted); font-size: 12px; }
#build.cp .al-note { margin: 0; padding: 4px 8px 6px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
@media (pointer: coarse) { #build.cp :is(.al-row, .al-tab) { min-height: 44px; } }
/* the toggle only where the panel can show: the chat page of a wide window */
#build.cp .al-toggle { display: none; }
@media (min-width: 1200px) { #build.cp[data-page="chat"] .al-toggle { display: inline-grid; } }

/* ======================= builder: the box is the dashboard's, part by part ======================= */
/* the dashboard's box above (.view-home .dcomp-box) is measured against this one by test/chat-pills.test.mjs: same
   corners, same padding, a 40px line, the plus and send sitting on its baseline */
:root #build.cp:not(.ph-b) #ask::before { border-radius: calc(18px + 8px); }
:root #build.cp:not(.ph-b) #ask > #ask-attach { margin: 12px 0 8px 10px; }
:root #build.cp:not(.ph-b) #ask > #ask-input { min-height: 40px; margin: 8px 0; padding: 9px 8px; }
:root #build.cp:not(.ph-b) #ask > .voice-btn { margin: 12px 0 8px; }
:root #build.cp:not(.ph-b) #ask > button[type="submit"] { margin: 12px 8px 8px 0; }
:root #build.cp:not(.ph-b) #ask > .ask-strip { margin-top: 10px; }

/* ======================= downscaled (the owner, 2026-11-25: "fix scaling issues and downscale anticode") =======================
   The app's base type is 16.5px, so anything without its own size came out large. Measured at 1440, 1280 and 1024 wide:
   - Recents: a 40px row and a 24px icon, the same in the dashboard and the builder (the builder's were 14px, 2px off)
   - the home: a 26px greeting over a 720px box
   - the chat: 14px replies and cards on a 720px column
   - the detail panel: 256px, a 52px icon */
.dash:not(.is-collapsed) .recent-list a, body .build .wsnav-recents a { min-height: 40px; gap: 9px; padding: 5px 8px 5px 10px; font-size: 13px; }
:is(.dash .recent-list, .build .wsnav-recents) .rc-av { width: 24px; height: 24px; }
:is(.dash .recent-list, .build .wsnav-recents) .rc-name { font-size: 12.5px; }
:is(.dash .recent-list, .build .wsnav-recents) .rc-line { font-size: 11.5px; }
body .build .wsnav-h { margin-top: 28px; }
/* a project's icon: the image its owner added, or a plain placeholder (avatar.js projectIcon) */
:is(.dash .recent-list, .build .wsnav-recents, #build.cp .al-detail) :is(.rc-av, .al-av) { display: grid; place-items: center; color: var(--muted); }
:is(.dash .recent-list, .build .wsnav-recents, #build.cp .al-detail) :is(.rc-av, .al-av) img { display: block; width: 100%; height: 100%; object-fit: cover; }
:is(.dash .recent-list, .build .wsnav-recents) .rc-av .ph-icon { width: 15px; height: 15px; }
/* a line drawing on both pages (the builder has no svg.ic rule of its own, so it would fill the square black) */
:is(.dash .recent-list, .build .wsnav-recents, #build.cp .al-detail) .ph-icon { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#build.cp .al-av .ph-icon { width: 24px; height: 24px; }

.dash .view-home .home-main > .greet { margin-bottom: 22px; font-size: clamp(22px, 2.2vw, 26px); }
.dash .view-home .dcomp, .dash .view-home .use-warn { max-width: 720px; }

#build.cp .thread { font-size: 14px; }
#build.cp .thread .msg-agent, #build.cp .thread .msg-agent p { font-size: 14px; line-height: 1.55; }
#build.cp .thread .msg-user { font-size: 14px; }
#build.cp .thread :is(.msg-agent, .result:not(.qa), .release) { padding: 10px 14px; }
@media (min-width: 1200px) {
  #build.cp[data-page="chat"][data-detail="open"] > #rail { padding-right: 280px; }
  #build.cp[data-page="chat"][data-detail="open"] .al-detail { width: 256px; }
}
#build.cp .al-who { gap: 8px; padding: 14px 10px 4px; }
#build.cp .al-av { width: 52px; height: 52px; border: 0; padding: 0; cursor: pointer; }
#build.cp .al-av:disabled { cursor: default; }
#build.cp .al-av:not(:disabled):hover { background: var(--c-quiet-hover); }
#build.cp .al-av:focus-visible, #build.cp .al-icon-off:focus-visible { outline: var(--cp-ring); outline-offset: 2px; }
#build.cp .al-name { font-size: 14.5px; }
#build.cp .al-state { font-size: 12px; }
#build.cp .al-icon-off { margin-top: -2px; padding: 2px 8px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
#build.cp .al-icon-off:hover { color: var(--text); background: var(--c-hover); }
#build.cp .al-icon-msg { margin: 0; color: var(--muted); font-size: 12px; }
#build.cp .al-icon-msg:empty { display: none; }
/* the builder's box, the build card and the small print share the chat's column (workspace.css set them at 760px) */
:root #build.cp[data-page="chat"] > #rail > :is(.ask-media, .ask-target, .open-build, .ask, .ask-fine) { width: min(var(--cp-col), 100% - 48px); }
/* the account at the foot of either sidebar: one size */
body .build .wsnav-me, body.dash .side .acct-btn { font-size: 13px; }
/* Recents start at the same height, row for row, in the dashboard and the builder */
:root body .build .wsnav-h { margin-top: 28px; }
:root :is(body.dash:not(.is-collapsed) .recent-list a, body .build .wsnav-recents a) { padding-block: 0; }
:root body .build .wsnav-recents { margin-top: -6px; padding-top: 0; } /* the nav's 8px gap, less the dashboard's 2px */
