/* BUILD_CHAT_2026Q4 (R4C) - build_chat.css: the build family in the mobile material (spec sections 1 and 3).
   Step 2: the build strip (.tye-bs), the part card / edit row / collapsed lines (.tye-bc*, inside a note host .msg.bot.tye-bc-host),
   the Export chooser (.tye-bx), the Share dialog restyled when the card opens it (.tye-share-ov.tye-bc-share), the reply pill hidden
   (.msg.tye-bc-own) and the bridge card hidden while the strip owns the build (#tye-solid-prog[data-tye-bc]).
   Step 3 adds the model chip (#tye-bc-mchip), the house toast (#toast restyled) and the pick-edit rows. Tokens come from chat_type.css (--ct-*). Rules here never set `display` on
   #tye-solid-prog: the bridge shows / hides it with the inline display property, so a take-over hides it with visibility keyed on
   [data-tye-bc] only. ASCII only. */
:root {
  --bc-ease: cubic-bezier(.32,.72,0,1);
  --bc-shadow: 0 1px 2px rgba(17,20,28,.05);
  --bc-pop-shadow: 0 10px 30px rgba(17,20,28,.12), 0 2px 8px rgba(17,20,28,.06);
  --bc-glass: rgba(255,255,255,.94);
  --bc-amber-tint: rgba(180,83,9,.10);
  --bc-red-tint: #fdedec;
  --bc-scrim: rgba(10,12,16,.32);
  --bc-seg-on: #ffffff; --bc-seg-sh: 0 1px 3px rgba(0,0,0,.12); --bc-acc-ink: #185fa5;
  --bc-grab: rgba(17,20,28,.18);
}
html[data-theme="dark"] {
  --bc-shadow: none;
  --bc-pop-shadow: 0 10px 30px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
  --bc-glass: rgba(30,31,35,.92);
  --bc-amber-tint: rgba(251,191,36,.12);
  --bc-red-tint: #3c2426;
  --bc-scrim: rgba(0,0,0,.55);
  --bc-seg-on: rgba(255,255,255,.14); --bc-seg-sh: none; --bc-acc-ink: #7dd3fc;
  --bc-grab: rgba(255,255,255,.22);
}

/* ---------- 1. the reply pill and the bridge card when this file owns the build ---------- */
html body #chat .msg.bot.tye-bc-own .tye-solid-pill { display: none !important; }
html.tye-bc-on body #chat .msg.bot[data-tye-restored] .tye-solid-pill { display: none !important; }   /* restored: "building" forever */
#tye-solid-prog[data-tye-bc="1"] { visibility: hidden !important; pointer-events: none !important; }
/* the kernel's "Rendering drawing" card (#tye-draw-prog, centred, inline display) while an Export chooser row makes the drawing:
   the row already says "Preparing the drawing..."; the card would cover the sheet. Visibility only, the class lives for that call. */
html.tye-bc-draw #tye-draw-prog { visibility: hidden !important; pointer-events: none !important; }

/* ---------- 2. the note host: the card stands in for the bubble (the note text stays in the DOM, hidden) ---------- */
html body #chat > .msg.bot.tye-bc-host > .bubble,
html body #chat > .msg.bot.tye-bc-host > .avatar { display: none !important; }
html body #chat > .msg.bot.tye-bc-host { align-items: flex-start; }
html body #chat > .msg.bot.tye-bc-host > .tye-bc-root { flex: 1 1 auto; min-width: 0; }
.tye-bc-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- 3. the build strip (the card's live form; a plain div in #chat, never a .msg) ---------- */
html body #chat > .tye-bs-row { display: flex; width: 100%; max-width: 760px; min-width: 0; box-sizing: border-box; flex: none; }
.tye-bs {
  box-sizing: border-box; width: 100%; max-width: 560px; min-width: 0; position: relative;
  background: var(--ct-sheet); border: 1px solid var(--ct-line); border-radius: 18px; box-shadow: var(--bc-shadow);
  padding: 8px 6px 12px 14px; font-family: var(--ct-font); color: var(--ct-ink); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
.tye-bs-r1 { display: flex; align-items: center; gap: 10px; height: 44px; }
.tye-bs-mk { flex: none; width: 20px; height: 20px; display: grid; place-items: center; }
.tye-bs[data-state="fail"] .tye-bs-mk { color: var(--ct-err); }
.tye-bs-t { flex: 1 1 auto; min-width: 0; font: 600 14px/1.2 var(--ct-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ct-ink); }
.tye-bs[data-state="fail"] .tye-bs-t { color: var(--ct-err); }
.tye-bs-tm { flex: none; font: 500 13px/1 var(--ct-font); color: var(--ct-ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tye-bs-tg, .tye-bc-open, .tye-bc-ib, .tye-bx-x, .tye-bc-cp {
  flex: none; width: 44px; height: 44px; padding: 0; margin: 0; border: 0; border-radius: 22px; background: transparent; color: var(--ct-ink2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tye-bs-tg[hidden] { display: none; }
.tye-bs-r2 { display: flex; align-items: baseline; gap: 8px; margin: 0 14px 0 30px; min-height: 18px; }
.tye-bs-r2[hidden], .tye-bs-why[hidden], .tye-bs-steps[hidden] { display: none; }
.tye-bs-step { flex: 1 1 auto; min-width: 0; font: 400 13px/18px var(--ct-font); color: var(--ct-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bs-n { flex: none; font: 500 12.5px/18px var(--ct-font); font-style: normal; color: var(--ct-ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tye-bs-why { margin: 0 14px 0 30px; font: 400 13.5px/1.5 var(--ct-font); color: var(--ct-ink); overflow-wrap: anywhere; }
.tye-bs-bar { display: flex; gap: 2px; height: 4px; margin: 8px 14px 0 30px; position: relative; overflow: hidden; border-radius: 2px; }
.tye-bs-bar > i { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--ct-line2); }
.tye-bs-bar > i.d { background: var(--ct-ink2); }
.tye-bs-bar > i.c { background: var(--ct-ink2); animation: tye-bc-pulse 1.2s ease-in-out infinite alternate; }
.tye-bs-bar > i.f { background: var(--ct-err); }
.tye-bs-bar.is-cont { background: var(--ct-line2); }
.tye-bs-bar.is-cont > i.fill { flex: none; background: var(--ct-ink2); transition: width .3s linear; }
.tye-bs-bar.is-cont.is-fail > i.fill { background: var(--ct-err); }
.tye-bs-bar.is-ind { background: var(--ct-line2); }
.tye-bs-bar.is-ind > i.ind { position: absolute; left: 0; top: 0; width: 30%; flex: none; background: var(--ct-ink2); animation: tye-bc-slide 1.4s var(--bc-ease) infinite; }
@keyframes tye-bc-pulse { from { opacity: .35; } to { opacity: 1; } }
@keyframes tye-bc-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.tye-bs-steps { margin: 10px 14px 0 30px; max-height: 168px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tye-bs-st { display: flex; align-items: center; gap: 8px; min-height: 28px; font: 400 13px/1.4 var(--ct-font); color: var(--ct-ink2); }
.tye-bs-st > svg { flex: none; color: var(--ct-ink3); }
.tye-bs-st .tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tye-bs-st .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bs-st > em { flex: none; margin-left: auto; padding-right: 2px; font: 400 12.5px/1 var(--ct-font); font-style: normal; color: var(--ct-ink3); }
.tye-bs-st[data-s="done"] > svg { color: var(--ct-ok); }
.tye-bs-st[data-s="cur"] { font-weight: 600; color: var(--ct-ink); }
.tye-bs-st[data-s="cur"] > svg { color: var(--ct-ink); animation: tye-bc-spin 1s linear infinite; }
.tye-bs-st[data-s="fail"] { align-items: flex-start; padding: 6px 0 4px; }
.tye-bs-st[data-s="fail"] > svg { color: var(--ct-err); margin-top: 1px; }
.tye-bs-st[data-s="fail"] .nm { font-weight: 600; color: var(--ct-ink); white-space: normal; }
.tye-bs-st[data-s="fail"] .why { font: 400 12.5px/1.45 var(--ct-font); color: var(--ct-ink3); }
@keyframes tye-bc-spin { to { transform: rotate(360deg); } }
.tye-bc-spin { animation: tye-bc-spin 1s linear infinite; transform-origin: 50% 50%; }

/* the hex-cube mark (working): faces .6 / .35 / .16 on light; on dark the faces the model picker ships (.5 / .92 / .72, ring .55) */
.tye-bc-hex { display: inline-flex; flex: none; }
.tye-bc-hex .r0 { stroke-opacity: .3; }
.tye-bc-hex .f1 { fill-opacity: .6; } .tye-bc-hex .f2 { fill-opacity: .35; } .tye-bc-hex .f3 { fill-opacity: .16; }
html[data-theme="dark"] .tye-bc-hex .r0 { stroke-opacity: .55; }
html[data-theme="dark"] .tye-bc-hex .f1 { fill-opacity: .5; } html[data-theme="dark"] .tye-bc-hex .f2 { fill-opacity: .92; } html[data-theme="dark"] .tye-bc-hex .f3 { fill-opacity: .72; }
.tye-bc-hex .r1 { animation: tye-bc-run 2s linear infinite; }
.tye-bc-hex .f { animation: tye-bc-face 2.4s ease-in-out infinite; }
.tye-bc-hex .f2 { animation-delay: 0s; } .tye-bc-hex .f3 { animation-delay: .8s; } .tye-bc-hex .f1 { animation-delay: 1.6s; }
@keyframes tye-bc-run { to { stroke-dashoffset: -100; } }
@keyframes tye-bc-face { 0% { fill-opacity: .16; } 6% { fill-opacity: 1; } 27% { fill-opacity: 1; } 34% { fill-opacity: .16; } 100% { fill-opacity: .16; } }

/* ---------- 4. the part card (spec 1.9: the house tool card, in-chat variant) ---------- */
.tye-bc {
  container-type: inline-size; box-sizing: border-box; width: 100%; max-width: 560px; min-width: 0;
  background: var(--ct-sheet); border: 1px solid var(--ct-line); border-radius: 18px; box-shadow: var(--bc-shadow);
  font-family: var(--ct-font); color: var(--ct-ink); overflow: hidden; -webkit-font-smoothing: antialiased; text-align: left;
}
.tye-bc.is-grow > * { animation: tye-bc-in 240ms ease both; animation-delay: 60ms; }
@keyframes tye-bc-in { from { opacity: 0; } to { opacity: 1; } }
.tye-bc-h { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 9px 6px 9px 14px; box-sizing: border-box; }
.tye-bc-chip { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--ct-tint3d); color: var(--ct-icon3d); }
.tye-bc-chip[data-tone="warn"] { background: var(--bc-amber-tint); color: var(--ct-warn); }
.tye-bc-chip[data-tone="err"] { background: var(--bc-red-tint); color: var(--ct-err); }
.tye-bc-hx, .tye-bx-hx { flex: 1 1 auto; min-width: 0; }
.tye-bc-t { font: 600 15px/1.55 var(--ct-font); color: var(--ct-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bc-s { margin-top: 3px; font: 400 12.5px/1.35 var(--ct-font); color: var(--ct-ink3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bc-open { margin-left: auto; }
.tye-bc-spec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; row-gap: 10px; padding: 2px 14px 12px; margin: 0; }
@container (min-width: 480px) { .tye-bc-spec { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.tye-bc-spec > div { min-width: 0; }
.tye-bc-spec dt { margin: 0; font: 600 11px/14px var(--ct-font); letter-spacing: .06em; text-transform: uppercase; color: var(--ct-ink3); }
.tye-bc-spec dd { margin: 2px 0 0; font: 500 13.5px/19px var(--ct-mono); font-variant-numeric: tabular-nums; color: var(--ct-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bc-spec dd.is-text { font: 500 14px/19px var(--ct-font); }
.tye-bc-spec dd.is-na, .tye-bc-spec dd.is-unset { color: var(--ct-ink3); }
/* FIX5: Size ("104.52 x 104.52 x 20 mm") and Material wrap to a second line when the cell is too narrow, never cut with an ellipsis */
.tye-bc-spec > .is-size dd, .tye-bc-spec > .is-mat dd { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
.tye-bc-spec > .is-size dd .nw { white-space: nowrap; }
.tye-bc-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0 14px 12px; font: 400 13px/1.45 var(--ct-font); color: var(--ct-warn-ink); }
.tye-bc-warn > svg { flex: none; margin-top: 1px; color: var(--ct-warn); }
.tye-bc-reason { margin: -2px 14px 12px; font: 400 14px/1.5 var(--ct-font); color: var(--ct-ink); overflow-wrap: anywhere; }
.tye-bc-fix { display: flex; align-items: center; gap: 8px; margin: 0 14px 12px; font: 400 13px/1.4 var(--ct-font); color: var(--ct-ink2); }
.tye-bc-load { display: flex; align-items: center; gap: 8px; margin: 0 14px 10px; font: 400 13px/1.4 var(--ct-font); color: var(--ct-ink3); }
.tye-bc-load > svg { animation: tye-bc-spin 1s linear infinite; }
/* the AI summary row (option B): 44 px, closed by default, opens in place */
.tye-bc-ai { margin: -4px 6px 4px; }
.tye-bc-ai-b {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; margin: 0; padding: 0 10px 0 8px; box-sizing: border-box;
  border: 0; border-radius: 12px; background: transparent; color: var(--ct-ink2); font: 600 13px/1 var(--ct-font); text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tye-bc-ai-b > svg:first-child { flex: none; color: var(--ct-ink3); }
.tye-bc-ai-b .c { font: 500 12.5px/1 var(--ct-font); color: var(--ct-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tye-bc-ai-b .cv { flex: none; margin-left: auto; color: var(--ct-ink2); }
.tye-bc-ai-body { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 14px; row-gap: 6px; margin: 2px 8px 10px; padding: 0; }
.tye-bc-ai-body[hidden] { display: none; }
.tye-bc-ai-body > div { display: contents; }
.tye-bc-ai-body dt { margin: 0; font: 600 12.5px/1.6 var(--ct-font); color: var(--ct-ink3); white-space: nowrap; }
.tye-bc-ai-body dd { margin: 0; font: 400 14px/1.6 var(--ct-font); color: var(--ct-ink2); overflow-wrap: anywhere; }
/* the share link (session only) */
.tye-bc-link { margin: 0 14px 12px; padding: 4px 4px 8px 12px; border-radius: 12px; background: var(--ct-field); }
.tye-bc-link .l1 { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.tye-bc-link .l1 > svg { flex: none; color: var(--ct-ink2); }
.tye-bc-link .u { flex: 1 1 auto; min-width: 0; font: 500 13px/1.55 var(--ct-mono); color: var(--ct-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ct-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bc-link .l2 { display: flex; align-items: center; gap: 6px; font: 400 12.5px/1.45 var(--ct-font); color: var(--ct-ink3); }
.tye-bc-link .l2 > svg { flex: none; }
.tye-bc-link .l2.is-ok > svg { color: var(--ct-ok); }
/* steps on the card (session only) */
.tye-bc-steps.tye-bs-steps { margin: 0 14px 12px 14px; }
/* footer: field pills, no primary pill on the card */
.tye-bc-f { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }
.tye-bc-f > button {
  height: 44px; border-radius: 22px; border: 0; margin: 0; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--ct-field); color: var(--ct-ink); font: 600 14px/1 var(--ct-font); white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; box-sizing: border-box;
}
.tye-bc-f > button > svg { flex: none; color: var(--ct-ink2); }
.tye-bc-f > button > svg:last-child:not(:first-child) { margin-left: -2px; }
.tye-bc-f > button.tye-bc-quiet { background: transparent; padding: 0 12px; }
.tye-bc-f > button.is-ok > svg:first-child { color: var(--ct-ok); }
.tye-bc-f > button.is-busy > svg:first-child { animation: tye-bc-spin 1s linear infinite; }
@container (max-width: 479px) { .tye-bc-f > button:not(.tye-bc-quiet) { flex: 1 1 0; justify-content: center; min-width: 0; } }
.tye-bc-f > button[disabled], .tye-bc-ib[disabled] { opacity: .45; cursor: default; }
.tye-bc button:active:not([disabled]), .tye-bs-tg:active { background-image: linear-gradient(var(--ct-press), var(--ct-press)); }
@media (hover: hover) {
  .tye-bc-f > button:hover:not([disabled]), .tye-bc-open:hover, .tye-bc-ib:hover:not([disabled]), .tye-bc-ai-b:hover, .tye-bs-tg:hover, .tye-bc-cp:hover { background-image: linear-gradient(var(--ct-hover), var(--ct-hover)); }
}
.tye-bc :focus-visible, .tye-bs :focus-visible { outline: 2px solid var(--ct-dot); outline-offset: 2px; }
.tye-bc .tye-bc-ai-b:focus-visible { outline-offset: -2px; }
.tye-bc button:focus:not(:focus-visible), .tye-bs button:focus:not(:focus-visible) { outline: none; }
/* FIX3: a card / line / strip that takes the focus itself (tabindex -1: the strip became the card, the chip's Details) - a ring for the keyboard only */
.tye-bc-root[tabindex="-1"]:focus, .tye-bs[tabindex="-1"]:focus { outline: none; }
.tye-bc-root[tabindex="-1"]:focus-visible, .tye-bs[tabindex="-1"]:focus-visible { outline: 2px solid var(--ct-dot); outline-offset: 2px; }

/* ---------- 5. the edit row (an AI edit's result) ---------- */
.tye-bc.tye-bc-edit { display: flex; align-items: center; gap: 10px; padding: 9px 4px 9px 14px; }
.tye-bc.tye-bc-edit.no-a { padding-right: 14px; }
.tye-bc-edit > svg.lead { flex: none; align-self: flex-start; margin-top: 1px; color: var(--ct-ok); }
.tye-bc-edit[data-state="editfail"] > svg.lead { color: var(--ct-err); }
.tye-bc-et { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tye-bc-et > b { font: 400 13.5px/1.45 var(--ct-font); color: var(--ct-ink); font-variant-numeric: tabular-nums; }
.tye-bc-et > b.err { font-weight: 600; color: var(--ct-err); }
.tye-bc-et > span { font: 400 12.5px/1.4 var(--ct-font); color: var(--ct-ink3); font-variant-numeric: tabular-nums; }
.tye-bc-et > span.why { font-size: 13.5px; line-height: 1.5; color: var(--ct-ink); }
.tye-bc-et > .tye-bc-fix { margin: 6px 0 0; }
.tye-bc-et > .tye-bc-link { margin: 6px 0 2px; }
.tye-bc-ea { flex: none; display: flex; gap: 8px; align-self: center; }
.tye-bc-ib.is-busy > svg { animation: tye-bc-spin 1s linear infinite; }
.tye-bc-ib.is-ok { color: var(--ct-ok); }

/* ---------- 6. collapsed lines (older results, a failure fixed in the next reply / tried again) ---------- */
.tye-bc-line { display: flex; align-items: center; gap: 8px; min-height: 24px; max-width: 560px; font: 400 13px/1.45 var(--ct-font); color: var(--ct-ink3); font-variant-numeric: tabular-nums; }
.tye-bc-line > svg { flex: none; }
.tye-bc-line > span { min-width: 0; overflow-wrap: anywhere; }
/* FIX1: option B on older replies - the folded trailer stays reachable from the collapsed line (quiet, closed by default) */
.tye-bc-lw { max-width: 560px; }
.tye-bc-lw > .tye-bc-line { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
.tye-bc-lai {
  display: inline-flex; align-items: center; gap: 4px; height: 44px; margin: 0 0 0 auto; padding: 0 6px 0 10px; box-sizing: border-box;
  border: 0; border-radius: 12px; background: transparent; color: var(--ct-ink3); font: 600 12.5px/1 var(--ct-font); white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tye-bc-lai > svg { flex: none; }
.tye-bc-lai:active { background-image: linear-gradient(var(--ct-press), var(--ct-press)); }
.tye-bc-lai:focus-visible { outline: 2px solid var(--ct-dot); outline-offset: -2px; }
.tye-bc-lai:focus:not(:focus-visible) { outline: none; }
@media (hover: hover) { .tye-bc-lai:hover { background-image: linear-gradient(var(--ct-hover), var(--ct-hover)); color: var(--ct-ink2); } }
@media (hover: hover) and (pointer: fine) { html:not(.tye-ts) .tye-bc-lai { height: 32px; } }
.tye-bc-lw > .tye-bc-ai-body { margin: 2px 8px 8px 24px; }
/* FIX2: the opened summary of an older line says first that the reply's size disagreed with the part (the live card's flag) */
.tye-bc-lw > .tye-bc-lmm { margin: 2px 8px 6px 24px; }
.tye-bc-lw > .tye-bc-lmm[hidden] { display: none; }
/* FIX2: on a phone the disclosure that wraps sits under its line's text (left), never at the right edge over the next user bubble */
@media (max-width: 420px) { .tye-bc-lw > .tye-bc-line > .tye-bc-lai { margin-left: 14px; } }
@media (forced-colors: active) { .tye-bc-lai { border: 1px solid ButtonText; } }

/* ---------- 7. the Export chooser: a house bottom sheet (phone, tablet portrait) or a 360 px popover at Export (wider) ---------- */
.tye-bx-scrim { position: fixed; inset: 0; z-index: 10030; background: var(--bc-scrim); }
.tye-bx {
  position: fixed; z-index: 10031; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden;
  background: var(--ct-sheet); color: var(--ct-ink); font-family: var(--ct-font); -webkit-font-smoothing: antialiased; text-align: left;
}
.tye-bx[data-mode="sheet"] {
  left: max(0px, calc(50% - 280px)); right: max(0px, calc(50% - 280px)); bottom: 0; max-height: min(86dvh, 720px);
  border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.18); padding-bottom: calc(14px + max(env(safe-area-inset-bottom, 0px), var(--ts-kbh, 0px)));
  animation: tye-bx-up 240ms var(--bc-ease) both; transition: transform 160ms var(--bc-ease);
}
@keyframes tye-bx-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.tye-bx[data-mode="pop"] { width: 360px; max-height: 480px; border: 1px solid var(--ct-line); border-radius: 18px; box-shadow: var(--bc-pop-shadow); padding-bottom: 12px; }
.tye-bx-grab { flex: none; height: 18px; padding-top: 8px; box-sizing: border-box; display: flex; justify-content: center; touch-action: none; }
.tye-bx-grab::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--bc-grab); }
.tye-bx-h { flex: none; display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 9px 6px 9px 14px; box-sizing: border-box; border-bottom: 1px solid var(--ct-line); touch-action: none; }
.tye-bx[data-mode="pop"] .tye-bx-h { min-height: 0; padding: 12px 14px 10px; }
.tye-bx-t { font: 600 15px/1.55 var(--ct-font); color: var(--ct-ink); }
.tye-bx[data-mode="sheet"] .tye-bx-t { line-height: 1.25; }
.tye-bx-s { margin-top: 3px; font: 400 12.5px/1.55 var(--ct-font); color: var(--ct-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bx-seg { flex: none; display: flex; gap: 3px; padding: 3px; margin: 12px 14px 6px; border-radius: 12px; background: var(--ct-field); }
.tye-bx-seg > button {
  flex: 1 1 0; min-width: 0; height: 44px; margin: 0; padding: 0 4px; border: 0; border-radius: 9px; background: transparent; color: var(--ct-ink2);
  display: flex; align-items: center; justify-content: center; gap: 8px; font: 500 14px/1 var(--ct-font); cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tye-bx-seg > button[aria-selected="true"], .tye-bx-seg > button[aria-checked="true"] { background: var(--bc-seg-on); box-shadow: var(--bc-seg-sh); color: var(--bc-acc-ink); font-weight: 600; }
.tye-bx.is-fine .tye-bx-seg > button { height: 36px; }
.tye-bx-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tye-bx-name { margin: 0; padding: 2px 14px 8px; font: 400 12.5px/1.55 var(--ct-font); color: var(--ct-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bx-name code { font: 500 12px/1.55 var(--ct-mono); color: var(--ct-ink2); background: none; padding: 0; }
.tye-bx-info { display: flex; gap: 8px; align-items: flex-start; margin: 0 14px 10px; font: 400 13px/1.45 var(--ct-font); color: var(--ct-ink3); }
.tye-bx-info > svg { flex: none; margin-top: 1px; }
.tye-bx-rows { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0 14px 2px; list-style: none; }
.tye-bx-rows > li { margin: 0; padding: 0; list-style: none; }
.tye-bx-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin: 0; padding: 4px 4px 4px 12px; box-sizing: border-box;
  border: 0; border-radius: 12px; background: var(--ct-field); color: var(--ct-ink); text-align: left; font-family: var(--ct-font); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tye-bx.is-fine .tye-bx-row { min-height: 44px; padding: 2px 4px 2px 12px; }
.tye-bx.is-fine .tye-bx-row .st { width: 36px; height: 36px; }
.tye-bx-row > .ic { flex: none; color: var(--ct-ink2); }
.tye-bx-row .tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tye-bx-row .nm { font: 500 15px/1.25 var(--ct-font); color: var(--ct-ink); }
.tye-bx-row .sub { font: 400 12.5px/1.55 var(--ct-font); color: var(--ct-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tye-bx-row[data-st="done"] .sub, .tye-bx-row[data-st="working"] .sub, .tye-bx-row[data-st="error"] .sub { color: var(--ct-ink2); }
.tye-bx-row .st { flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ct-ink2); }
.tye-bx-row[data-st="done"] .st { color: var(--ct-ok); }
.tye-bx-row[data-st="error"] .st { color: var(--ct-err); }
.tye-bx-row:active { background-image: linear-gradient(var(--ct-press), var(--ct-press)); }
@media (hover: hover) { .tye-bx-row:hover, .tye-bx-x:hover, .tye-bx-seg > button:hover:not([aria-selected="true"]) { background-image: linear-gradient(var(--ct-hover), var(--ct-hover)); } }
.tye-bx :focus-visible { outline: 2px solid var(--ct-dot); outline-offset: -2px; }
.tye-bx button:focus:not(:focus-visible) { outline: none; }

/* ---------- 8. Share: today's compose dialog restyled in the house material when the card opens it ---------- */
html body .tye-share-ov.tye-bc-share { background: var(--bc-scrim) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; align-items: flex-end !important; justify-content: center !important; }
html body .tye-share-ov.tye-bc-share[data-mode="pop"] { background: transparent !important; align-items: flex-start !important; justify-content: flex-start !important; }
html body .tye-share-ov.tye-bc-share .tye-share-card {
  position: relative; width: 100% !important; max-width: 560px !important; box-sizing: border-box; padding: 0 0 calc(14px + max(env(safe-area-inset-bottom, 0px), var(--ts-kbh, 0px))) !important;   /* FIX2: lifted by the shell's keyboard inset, as every house sheet */
  background: var(--ct-sheet) !important; color: var(--ct-ink) !important; border: 0 !important; border-radius: 22px 22px 0 0 !important;
  box-shadow: 0 -12px 40px rgba(0,0,0,.18) !important; font-family: var(--ct-font) !important; -webkit-font-smoothing: antialiased; max-height: 92dvh; overflow-y: auto;
}
html body .tye-share-ov.tye-bc-share[data-mode="pop"] .tye-share-card {
  position: fixed; width: 360px !important; border: 1px solid var(--ct-line) !important; border-radius: 18px !important; box-shadow: var(--bc-pop-shadow) !important; padding-bottom: 14px !important;
}
html body .tye-bc-share .tye-share-card::before { content: none; display: none; }   /* FIX2: the handle is a real element now (.tye-bcs-grab: swipe down closes) */
html body .tye-bc-share .tye-bcs-grab { height: 18px; margin: 0; }
html body .tye-bc-share[data-mode="sheet"] .tye-bcs-h { touch-action: none; }
html body .tye-bc-share .tye-share-card:focus { outline: none; }   /* (focus enters the dialog itself; its controls keep their rings) */
html body .tye-bc-share[data-mode="pop"] .tye-share-card::before { display: none; }
html body .tye-bc-share :is(.tye-share-eyebrow, .tye-share-h, .tye-share-sub, .tye-share-note, .tye-bcs-hide) { display: none !important; }
html body .tye-bc-share .tye-bcs-h { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 9px 6px 9px 14px; box-sizing: border-box; border-bottom: 1px solid var(--ct-line); margin-bottom: 14px; }
html body .tye-bc-share .tye-share-x {
  position: static !important; flex: none; width: 44px !important; height: 44px !important; border-radius: 22px !important; color: var(--ct-ink2) !important;
  background: transparent !important; display: inline-flex !important; align-items: center; justify-content: center; font-size: 0 !important; padding: 0 !important;
}
html body .tye-bc-share .tye-share-field { margin: 0 14px 14px !important; }
html body .tye-bc-share .tye-share-lab { display: block; margin: 0 0 8px !important; font: 600 13px/1.3 var(--ct-font) !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--ct-ink) !important; }
html body .tye-bc-share .tye-bcs-inp { position: relative; display: flex; align-items: center; height: 48px; border-radius: 12px; background: var(--ct-field); }
html body .tye-bc-share .tye-bcs-inp > svg { position: absolute; left: 14px; color: var(--ct-ink3); pointer-events: none; }
html body .tye-bc-share .tye-bcs-inp > .tye-share-inp { height: 48px !important; padding: 0 14px 0 42px !important; background: transparent !important; border: 0 !important; border-radius: 12px !important; color: var(--ct-ink) !important; font: 500 15px var(--ct-font) !important; }
html body .tye-bc-share .tye-share-inp::placeholder { color: var(--ct-ink3); opacity: 1; }
html body .tye-bc-share .tye-bcs-inp:focus-within { box-shadow: 0 0 0 2px var(--ct-dot); }
html body .tye-bc-share .tye-bcs-help { margin: 8px 0 0; font: 400 12.5px/1.45 var(--ct-font); color: var(--ct-ink3); }
html body .tye-bc-share .tye-bcs-help[hidden] { display: none; }
html body .tye-bc-share .tye-bcs-err { display: flex; align-items: flex-start; gap: 8px; margin: 0 14px 10px; font: 400 13px/1.45 var(--ct-font); color: var(--ct-ink); }   /* FIX7: Create refused (the card's part was replaced) */
html body .tye-bc-share .tye-bcs-err > svg { flex: none; margin-top: 2px; color: var(--ct-err); }
html body .tye-bc-share .tye-bcs-exp { margin: 0; }
html body .tye-bc-share .tye-bcs-exp > button { font-size: 13px; }
html body .tye-bc-share .tye-share-btn {
  height: 44px !important; border-radius: 22px !important; border: 0 !important; background: var(--ct-field) !important; color: var(--ct-ink) !important;
  font: 600 14px/1 var(--ct-font) !important; gap: 8px !important; padding: 0 16px !important;
}
html body .tye-bc-share .tye-share-btn > svg { flex: none; color: var(--ct-ink2); }
html body .tye-bc-share .tye-share-btn.pri { background: var(--ct-ink) !important; color: var(--ct-sheet) !important; }
html body .tye-bc-share .tye-share-btn.pri > svg { color: var(--ct-sheet); }
html body .tye-bc-share #tye-share-create { width: calc(100% - 28px) !important; margin: 4px 14px 0 !important; height: 48px !important; border-radius: 24px !important; }
html body .tye-bc-share .tye-bcs-link { margin: 0 14px !important; padding: 0 4px 0 12px; border-radius: 12px; background: var(--ct-field); align-items: center; gap: 8px !important; }
html body .tye-bc-share .tye-bcs-link > svg { flex: none; color: var(--ct-ink2); }
html body .tye-bc-share .tye-bcs-link > .tye-share-inp:focus { outline: none !important; box-shadow: none !important; }
html body .tye-bc-share .tye-bcs-link:focus-within { box-shadow: 0 0 0 2px var(--ct-dot); }
html body .tye-bc-share .tye-bcs-link > .tye-share-inp { flex: 1 1 auto; min-width: 0; height: 44px !important; padding: 0 !important; background: transparent !important; border: 0 !important; font: 500 13px/44px var(--ct-mono) !important; color: var(--ct-ink) !important; text-decoration: underline; }
html body .tye-bc-share #tye-share-copy { width: 44px !important; padding: 0 !important; background: transparent !important; color: var(--ct-ink2) !important; }
html body .tye-bc-share #tye-share-copy > span { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html body .tye-bc-share #tye-share-copy > svg { width: 20px; height: 20px; color: currentColor; }
html body .tye-bc-share .tye-bcs-ok { display: flex; align-items: center; gap: 6px; margin: 6px 14px 0 26px; font: 400 12.5px/1.45 var(--ct-font); color: var(--ct-ink3); }
html body .tye-bc-share .tye-bcs-ok > svg { color: var(--ct-ok); }
html body .tye-bc-share .tye-bcs-ok[hidden] { display: none; }
html body .tye-bc-share .tye-bcs-facts { margin: 12px 14px 4px; display: flex; flex-direction: column; gap: 6px; }
html body .tye-bc-share .tye-bcs-facts > p { display: flex; align-items: center; gap: 8px; margin: 0; font: 400 13px/1.45 var(--ct-font); color: var(--ct-ink2); }
html body .tye-bc-share .tye-bcs-facts > p > svg { flex: none; color: var(--ct-ink3); }
html body .tye-bc-share .tye-share-actions { margin: 12px 14px 0 !important; gap: 8px !important; }
html body .tye-bc-share #tye-share-qrbox { margin: 12px 14px 0 !important; }
html body .tye-bc-share :focus-visible { outline: 2px solid var(--ct-dot) !important; outline-offset: 2px; }

/* ---------- 11. step 3: the model chip (#tye-bc-mchip) - the live pill's glass and spot (TCS 1.3) ---------- */
/* touch: bottom-left, 10 px over the tab bar or over the sheet pill (--ts-pill), z 9004 (under R4T tool cards 9005 and toasts 9010);
   tablet landscape: x 16, over the tab bar only (the pill is centred, no collision); desktop: the CAD pane, 36 h, centred, under the
   ribbon (the phase file places it). The phase file moves it above the R4T live pill / bottom sheet and right of an R4T side card. */
#tye-bc-mchip {
  position: fixed; z-index: 9004; left: calc(env(safe-area-inset-left, 0px) + 8px); bottom: calc(var(--ts-space, 78px) + var(--ts-pill, 0px));
  height: 44px; max-width: min(300px, calc(100% - 16px)); box-sizing: border-box; border-radius: 22px; overflow: hidden;
  background: var(--bc-glass); -webkit-backdrop-filter: saturate(170%) blur(22px); backdrop-filter: saturate(170%) blur(22px);
  border: 1px solid var(--ct-line); box-shadow: var(--bc-pop-shadow); color: var(--ct-ink); font-family: var(--ct-font);
  -webkit-font-smoothing: antialiased; text-align: left; animation: tye-mc-in 160ms var(--bc-ease) both;
}
#tye-bc-mchip[hidden] { display: none !important; }
html.tye-ts.ts-kb #tye-bc-mchip, html.tye-ts.ts-page #tye-bc-mchip, html.tye-ts.ts-mpage #tye-bc-mchip { display: none !important; }
#tye-bc-mchip[data-at="touch-wide"] { left: calc(env(safe-area-inset-left, 0px) + 16px); bottom: var(--ts-space, 78px); }
#tye-bc-mchip[data-at="desk"] { z-index: 95; height: 36px; border-radius: 18px; transform: translateX(-50%); animation-name: tye-mc-in-d; }
@keyframes tye-mc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tye-mc-in-d { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translateX(-50%); } }
#tye-bc-mchip .tye-mc-b {
  display: flex; align-items: center; gap: 8px; height: 100%; max-width: 100%; margin: 0; padding: 0 14px 0 10px; box-sizing: border-box;
  border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#tye-bc-mchip .tye-mc-b[disabled] { cursor: default; color: inherit; opacity: 1; }
#tye-bc-mchip .tye-mc-ic { flex: none; width: 20px; height: 20px; display: grid; place-items: center; color: var(--ct-ink2); }
#tye-bc-mchip[data-kind="ok"] .tye-mc-ic { color: var(--ct-ok); }
#tye-bc-mchip[data-kind="warn"] .tye-mc-ic { color: var(--ct-warn); }
#tye-bc-mchip[data-kind="err"] .tye-mc-ic { color: var(--ct-err); }
#tye-bc-mchip .tye-mc-t { flex: 0 1 auto; min-width: 0; font: 600 13px/1.3 var(--ct-font); color: var(--ct-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tye-bc-mchip .tye-mc-m { flex: none; font: 500 13px/1.3 var(--ct-font); font-style: normal; color: var(--ct-ink3); white-space: nowrap; font-variant-numeric: tabular-nums; }
#tye-bc-mchip .tye-mc-m:empty { display: none; }
#tye-bc-mchip .tye-mc-cv { flex: none; display: none; color: var(--ct-ink3); margin: 0 -4px 0 -2px; }
#tye-bc-mchip[data-act] .tye-mc-cv { display: grid; }
#tye-bc-mchip[data-kind="work"] .tye-mc-cv { display: none; }
#tye-bc-mchip .tye-mc-l { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 1px; background: var(--ct-line2); overflow: hidden; pointer-events: none; }
#tye-bc-mchip[data-at="desk"] .tye-mc-l { bottom: 2px; }
#tye-bc-mchip:not([data-prog]) .tye-mc-l { display: none; }
#tye-bc-mchip .tye-mc-l > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 1px; background: var(--ct-ink2); transition: width .3s linear; }
#tye-bc-mchip[data-prog="ind"] .tye-mc-l > i { width: 30% !important; animation: tye-bc-slide 1.4s var(--bc-ease) infinite; }
#tye-bc-mchip.is-mini { width: 44px; }
#tye-bc-mchip.is-mini .tye-mc-b { padding: 0; justify-content: center; }
#tye-bc-mchip.is-mini :is(.tye-mc-t, .tye-mc-m, .tye-mc-cv) { display: none; }
#tye-bc-mchip[data-at="desk"].is-mini { width: 36px; }
#tye-bc-mchip .tye-mc-b:active:not([disabled]) { background-image: linear-gradient(var(--ct-press), var(--ct-press)); }
@media (hover: hover) { #tye-bc-mchip .tye-mc-b:hover:not([disabled]) { background-image: linear-gradient(var(--ct-hover), var(--ct-hover)); } }
#tye-bc-mchip .tye-mc-b:focus-visible { outline: 2px solid var(--ct-dot); outline-offset: -2px; }
#tye-bc-mchip .tye-mc-b:focus:not(:focus-visible) { outline: none; }
/* what the chip stands in for: the kernel's cards (visibility only - their show / hide is the inline display), the empty state */
html.tye-bc-mir-draw #tye-draw-prog, html.tye-bc-mir-imp #tye-import-prog { visibility: hidden !important; pointer-events: none !important; }
html.tye-bc-mc-busy #v3d-empty { visibility: hidden !important; }
/* one surface for one failure (spec 3.2.4): the ribbon's status mirror keeps the kernel's sentence, in neutral ink, while the chat shows the failure */
html.tye-bc-aifail body #mcm-bar .mcm-st-tool.is-err { color: var(--ct-ink3) !important; }

/* ---------- 12. step 3: the house toast (#toast, toast() stays in voice_ui.js; the phase file adds the icon and the text span) ---------- */
html.tye-bc-on body #toast#toast {
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: min(440px, calc(100vw - 32px)); min-height: 40px;
  box-sizing: border-box; padding: 8px 16px 8px 12px; border-radius: 20px; text-align: left; white-space: normal;
  background: var(--ct-sheet) !important; border: 1px solid var(--ct-line) !important; color: var(--ct-ink) !important;
  box-shadow: var(--bc-pop-shadow) !important; -webkit-backdrop-filter: none; backdrop-filter: none;
  font: 500 13px/1.3 var(--ct-font); -webkit-font-smoothing: antialiased; transition: opacity 160ms ease;
}
html.tye-bc-on body #toast .tye-tst-ic { flex: none; width: 18px; height: 18px; display: grid; place-items: center; color: var(--ct-ink2); }
html.tye-bc-on body #toast[data-bc-kind="ok"] .tye-tst-ic, html.tye-bc-on body #toast[data-bc-kind="save"] .tye-tst-ic, html.tye-bc-on body #toast[data-bc-kind="commit"] .tye-tst-ic { color: var(--ct-ok); }
html.tye-bc-on body #toast[data-bc-kind="err"] .tye-tst-ic { color: var(--ct-err); }
html.tye-bc-on body #toast .tye-tst-t { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
html.tye-bc-on body #toast .pm-dot { display: none; }
/* where: the touch Chat screen - 8 px above the composer card; desktop - the pane that owns the action (chat: 16 above the composer;
   CAD: 16 above the sheet pill), centred in it; the touch model screens keep the shipped rule */
html.tye-ts.tye-bc-on[data-ts-view="chat"] body #toast#toast { bottom: var(--bc-toast-b, calc(var(--ts-space) + 12px)) !important; }
html.tye-bc-on:not(.tye-ts) body #toast#toast { left: var(--bc-toast-x, 50%); bottom: var(--bc-toast-b, 90px); }

/* ---------- 13. step 3: pick-edit / re-parametrize rows (session only, the edit row's look; no actions) ---------- */
.tye-bc.tye-bc-pick > svg.lead { color: var(--ct-ok); }
.tye-bc.tye-bc-pick[data-state="err"] > svg.lead { color: var(--ct-err); }
.tye-bc.tye-bc-pick[data-state="info"] > svg.lead { color: var(--ct-ink2); }
.tye-bc.tye-bc-pick .tye-bc-et > b { overflow-wrap: anywhere; }

/* ---------- 9. reduced motion: static mark, no spinner turn, no pulse, instant sheets ---------- */
@media (prefers-reduced-motion: reduce) {
  .tye-bc-hex .r1 { display: none; }
  .tye-bc-hex .f, .tye-bs-bar > i.c, .tye-bs-bar.is-ind > i.ind, .tye-bc-spin, .tye-bs-st[data-s="cur"] > svg, .tye-bc-load > svg,
  .tye-bc-f > button.is-busy > svg:first-child, .tye-bc-ib.is-busy > svg, .tye-bc.is-grow > *, .tye-bx[data-mode="sheet"] { animation: none !important; }
  .tye-bs-bar.is-ind > i.ind { width: 100%; opacity: .35; }
  .tye-bs-bar.is-cont > i.fill, .tye-bx[data-mode="sheet"] { transition: none !important; }
  #tye-bc-mchip, #tye-bc-mchip[data-at="desk"] { animation: none !important; }
  #tye-bc-mchip[data-prog="ind"] .tye-mc-l > i { animation: none !important; width: 100% !important; opacity: .35; }
  #tye-bc-mchip .tye-mc-l > i { transition: none !important; }
  html.tye-bc-on body #toast#toast { transition: none !important; }
  html body .tye-share-ov.tye-bc-share, html body .tye-share-ov.tye-bc-share .tye-share-card { animation: none !important; transition: none !important; }   /* FIX2: the adopted Share sheet appears without its fade */
  .tye-bc-hex .f1 { fill-opacity: .35; } .tye-bc-hex .f2 { fill-opacity: .35; } .tye-bc-hex .f3 { fill-opacity: .35; }
}
/* ---------- 10. forced colours: cards, rows and pills keep visible edges ---------- */
@media (forced-colors: active) {
  .tye-bc, .tye-bs, .tye-bx, .tye-bx-row, .tye-bc-f > button, .tye-bx-seg > button[aria-selected="true"], #tye-bc-mchip, html.tye-bc-on body #toast#toast { border: 1px solid CanvasText; }
  .tye-bs-bar > i.d, .tye-bs-bar > i.c, .tye-bs-bar > i.fill { background: Highlight; }
}
/* end BUILD_CHAT_2026Q4 build_chat.css */
