

.cw {
  --cw-bg: #0f1116; --cw-surface: #171a21; --cw-surface-2: #1f232c; --cw-surface-3: #2a2f3a;
  --cw-border: #2b313c; --cw-border-strong: #3d4553;
  --cw-text: #eceef3; --cw-text-2: #b9c0cc; --cw-text-3: #8f98a8;
  --cw-accent: #8c86f8; --cw-accent-hover: #a29dff; --cw-accent-soft: #262550; --cw-accent-text: #b7b3ff; --cw-on-accent: #100f2c;
  --cw-ok: #6fd6a0; --cw-ok-soft: #12301f; --cw-warn: #f2bb62; --cw-warn-soft: #38290a; --cw-danger: #ff9488; --cw-danger-soft: #401a19;
  --cw-ring: rgba(140, 134, 248, .42);
  --cw-hl: #2f2d63;
  --cw-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -16px rgba(0, 0, 0, .6);
  --cw-r-sm: 6px; --cw-r-md: 10px; --cw-r-lg: 14px; --cw-r-xl: 20px;
  --cw-ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
.cw[data-cw-theme="light"] {
  --cw-bg: #f5f6f8; --cw-surface: #ffffff; --cw-surface-2: #f2f4f7; --cw-surface-3: #e7eaef;
  --cw-border: #e0e4ea; --cw-border-strong: #c4ccd6;
  --cw-text: #171a21; --cw-text-2: #475061; --cw-text-3: #667083;
  --cw-accent: #4a43d4; --cw-accent-hover: #3b35b8; --cw-accent-soft: #ecebfc; --cw-accent-text: #3e38c2; --cw-on-accent: #ffffff;
  --cw-ok: #146c43; --cw-ok-soft: #e2f3e9; --cw-warn: #8a5300; --cw-warn-soft: #fcefd3; --cw-danger: #b83227; --cw-danger-soft: #fce7e4;
  --cw-ring: rgba(74, 67, 212, .32);
  --cw-hl: #e3e1fb;
  --cw-shadow: 0 1px 2px rgba(23, 26, 33, .06), 0 8px 24px -18px rgba(23, 26, 33, .25);
  color-scheme: light;
}

:root { --g-track: rgba(253, 253, 251, .16); --g-line: rgba(253, 253, 251, .16); --g-hover: rgba(253, 253, 251, .06); }
:root[data-theme="light"] { --g-track: rgba(21, 20, 26, .14); --g-line: rgba(21, 20, 26, .18); --g-hover: rgba(21, 20, 26, .05); }

html, body { height: 100%; }
body { overflow: hidden; background: var(--bg); color: var(--text); }
.sprite { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
.demo { display: grid; grid-template-rows: auto auto minmax(0, 1fr); block-size: 100vh; block-size: 100dvh; }

.i { inline-size: 20px; block-size: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .flip { transform: scaleX(-1); }

.site-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-block-size: 48px; padding-inline: var(--space-4); background: var(--bg-deep); border-block-end: 1px solid var(--border);
}
.is-embed .site-bar { display: none; }
.site-back { display: inline-flex; align-items: center; gap: var(--space-2); min-block-size: 44px; color: var(--text); text-decoration: none; font: 500 var(--fs-small)/1 var(--font-body); }
.site-back:hover { color: var(--link); }
.site-back:focus-visible, .g-btn:focus-visible, .end-again:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ra-g-violet); border-radius: var(--radius-sm); }
.site-tag { margin: 0; color: var(--text-muted); font-size: var(--fs-small); text-align: end; }

.guide {
  display: flex; align-items: center; gap: var(--space-2) var(--space-4);
  min-block-size: 56px; padding: 6px var(--space-4); background: var(--bg-deep); border-block-end: 1px solid var(--border);
}
.g-step { display: flex; align-items: center; gap: 10px; flex: none; }
.g-segs { display: flex; gap: 4px; }
.g-segs i { display: block; inline-size: 18px; block-size: 3px; border-radius: 2px; background: var(--g-track); transition: opacity .3s; }
.g-segs i.is-done { background: var(--link); }
.g-segs i.is-now { background: var(--text); }
.g-num { display: none; font: 500 var(--fs-mono)/1 var(--font-mono); color: var(--text-muted); letter-spacing: var(--tracking-mono); }
.g-name { font: 600 .9375rem/1.2 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.g-hint { flex: 1 1 auto; min-inline-size: 0; margin: 0; font-size: var(--fs-small); line-height: 1.35; color: var(--text-muted); }
.g-actions { display: flex; gap: var(--space-2); flex: none; margin-inline-start: auto; }
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-block-size: 44px; min-inline-size: 44px; padding: 0 14px;
  border: 1px solid var(--g-line); border-radius: var(--radius-md); background: transparent;
  color: var(--text); font: 500 var(--fs-small)/1 var(--font-body); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.g-btn:hover { background: var(--g-hover); }
.g-btn .i { inline-size: 18px; block-size: 18px; }
.g-btn[hidden] { display: none; }
.g-short { display: none; }

.cw {
  position: relative; min-block-size: 0; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "main" "bottom";
  background: var(--cw-bg); color: var(--cw-text); font: 400 .9375rem/1.6 var(--font-body);
}
:where(.cw) button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cw :focus-visible { outline: 2px solid var(--cw-accent); outline-offset: 2px; }
:where(.cw) :where(h1, h2, h3, p) { margin: 0; }

.cw-logo { inline-size: 32px; block-size: 32px; flex: none; }
.cw-logo .lb { fill: var(--cw-accent); }
.cw-logo .lf { fill: var(--cw-on-accent); }
.cw-logo .ll { fill: none; stroke: var(--cw-on-accent); }

.rail { display: none; }
.cw-top {
  grid-area: top; display: flex; align-items: center; gap: 10px;
  block-size: 3.5rem; padding-inline: var(--space-4);
  background: var(--cw-surface); border-block-end: 1px solid var(--cw-border);
}
.cw-main { grid-area: main; min-block-size: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: var(--space-4) var(--space-4) var(--space-7); }
.cw-content { max-inline-size: 60rem; margin-inline: auto; }
.cw-bottom {
  grid-area: bottom; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  block-size: 3.75rem; background: var(--cw-surface); border-block-start: 1px solid var(--cw-border);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-inline-size: 0; border: 0; background: transparent; color: var(--cw-text-3); font-size: .75rem; font-weight: 500;
}
.tab .i { inline-size: 22px; block-size: 22px; }
.tab[aria-current="page"] { color: var(--cw-accent-text); }
.tab[aria-current="page"] .i { stroke-width: 2.1; }

@media (min-width: 900px) {
  .cw { grid-template-columns: 15.5rem minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "rail main"; }
  .rail {
    grid-area: rail; display: flex; flex-direction: column; gap: var(--space-4); min-block-size: 0; overflow-y: auto;
    padding: var(--space-4) var(--space-3); background: var(--cw-surface); border-inline-end: 1px solid var(--cw-border);
  }
  .cw-top, .cw-bottom { display: none; }
  .cw-main { padding: 2rem 2rem 3rem; }
}

.rail-head { display: flex; align-items: center; gap: 10px; padding: 4px var(--space-2); }
.brand { font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; }
.room {
  display: flex; align-items: center; gap: 10px; inline-size: 100%; min-block-size: 52px; padding: 6px 10px;
  border: 1px solid var(--cw-border); border-radius: var(--cw-r-lg); background: var(--cw-surface-2); text-align: start;
}
.room:hover { border-color: var(--cw-border-strong); }
.room .i { color: var(--cw-text-3); margin-inline-start: auto; inline-size: 18px; block-size: 18px; }
.avatar { display: grid; place-items: center; inline-size: 32px; block-size: 32px; flex: none; border-radius: 8px; background: var(--cw-accent-soft); color: var(--cw-accent-text); font-weight: 600; font-size: .875rem; }
.room-text { display: grid; min-inline-size: 0; }
.room-label { font-size: .75rem; line-height: 1.2; color: var(--cw-text-3); }
.room-name { font-weight: 600; font-size: .9375rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room--top { inline-size: auto; min-inline-size: 0; min-block-size: 44px; padding-block: 4px; padding-inline: 12px 8px; border-radius: var(--cw-r-md); flex: 0 1 auto; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-block-size: 44px; padding: 0 12px;
  border: 0; border-radius: var(--cw-r-md); background: transparent; color: var(--cw-text-2); font-weight: 500; text-align: start;
}
.nav-item:hover { background: var(--cw-surface-2); color: var(--cw-text); }
.nav-item[aria-current="page"] { background: var(--cw-accent-soft); color: var(--cw-accent-text); }
.nav-dot { display: none; inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--cw-accent); }
.has-news .nav-dot { display: block; }
.nav-item .nav-dot { margin-inline-start: auto; }
.tab .nav-dot { position: absolute; inset-block-start: 10px; inset-inline-end: calc(50% - 16px); }
.rail-foot { margin-block-start: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) 4px 0; border-block-start: 1px solid var(--cw-border); }
.cost {
  display: inline-flex; align-items: center; gap: 6px; min-block-size: 2rem; padding: 0 10px;
  border: 1px solid var(--cw-border); border-radius: 999px; color: var(--cw-text-2); font-size: .8125rem; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.cost .i { inline-size: 16px; block-size: 16px; color: var(--cw-text-3); }
.cost b { font-weight: 600; color: var(--cw-text); }
.cw-top .cost { margin-inline-start: auto; }
.icon-btn { display: inline-grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem; border: 0; border-radius: var(--cw-r-md); background: transparent; color: var(--cw-text-2); }
.icon-btn:hover { background: var(--cw-surface-2); color: var(--cw-text); }

.card { padding: var(--space-4); border: 1px solid var(--cw-border); border-radius: var(--cw-r-lg); background: var(--cw-surface); box-shadow: var(--cw-shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-block-size: 2.75rem; padding: 0 16px; border: 1px solid var(--cw-border-strong); border-radius: var(--cw-r-md);
  background: var(--cw-surface-2); color: var(--cw-text); font-weight: 600; line-height: 1.2; text-align: center;
}
.btn:hover { border-color: var(--cw-text-3); }
.btn .i { inline-size: 18px; block-size: 18px; }
.btn.primary { background: var(--cw-accent); border-color: var(--cw-accent); color: var(--cw-on-accent); }
.btn.primary:hover { background: var(--cw-accent-hover); border-color: var(--cw-accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--cw-accent-text); padding-inline: 12px; }
.btn.ghost:hover { background: var(--cw-accent-soft); }
.btn:disabled, .chip:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { border-color: var(--cw-border-strong); }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2); min-block-size: 2.75rem; padding: 6px 14px;
  border: 1px solid var(--cw-border-strong); border-radius: 999px; background: transparent;
  color: var(--cw-text); font-size: .875rem; font-weight: 500; line-height: 1.35; text-align: start;
}
.chip .i { inline-size: 18px; block-size: 18px; color: var(--cw-text-3); }

@media (hover: hover) { .chip:hover:not(:disabled):not([aria-pressed="true"]) { border-color: var(--cw-text-3); background: var(--cw-surface-2); } }
.chip[aria-pressed="true"] { background: var(--cw-accent-soft); border-color: var(--cw-accent); color: var(--cw-accent-text); }
.chip[aria-pressed="true"] .i { color: var(--cw-accent-text); }

.note { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--cw-r-md); background: var(--cw-accent-soft); }
.note > .i { color: var(--cw-accent-text); margin-block-start: 2px; }
.note.warn { background: var(--cw-warn-soft); }
.note.warn > .i { color: var(--cw-warn); }
.note.ok { background: var(--cw-ok-soft); }
.note.ok > .i { color: var(--cw-ok); }
.note.quiet { background: var(--cw-surface-2); }
.note.quiet > .i { color: var(--cw-text-3); }

.pill { display: inline-flex; align-items: center; gap: 6px; min-block-size: 1.5rem; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.2; white-space: nowrap; background: var(--cw-surface-3); color: var(--cw-text-2); }
.pill.ok { background: var(--cw-ok-soft); color: var(--cw-ok); }
.pill.accent { background: var(--cw-accent-soft); color: var(--cw-accent-text); }
.pill.warn { background: var(--cw-warn-soft); color: var(--cw-warn); }

.status { display: inline-flex; align-items: center; gap: 6px; min-block-size: 1.75rem; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--cw-surface-3); color: var(--cw-text-2); }
.status .i { inline-size: 14px; block-size: 14px; stroke-width: 2.2; }
.status.running { background: var(--cw-accent-soft); color: var(--cw-accent-text); }
.status.wait { background: var(--cw-warn-soft); color: var(--cw-warn); }
.status.done { background: var(--cw-ok-soft); color: var(--cw-ok); }
.spin { animation: cw-spin .9s linear infinite; }
@keyframes cw-spin { to { transform: rotate(360deg); } }

.progress { position: relative; block-size: 3px; border-radius: 2px; overflow: hidden; background: var(--cw-surface-3); }
.progress i { position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 40%; border-radius: 2px; background: var(--cw-accent); animation: cw-slide 1.3s var(--cw-ease) infinite; }
@keyframes cw-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
[dir="rtl"] .progress i { animation-name: cw-slide-rtl; }
@keyframes cw-slide-rtl { from { transform: translateX(100%); } to { transform: translateX(-260%); } }

.page-head { margin-block-end: var(--space-5); }
.page-head h1 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; margin-block-end: 4px; }
.page-head p { color: var(--cw-text-2); max-inline-size: 62ch; }
.section-title { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; margin-block-end: var(--space-3); }
.sub-label { font-size: .8125rem; color: var(--cw-text-3); margin-block-end: var(--space-2); }
.sub-label--strong { font-size: .875rem; font-weight: 600; color: var(--cw-text); }

.compose { display: grid; gap: var(--space-4); }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-block-end: calc(-1 * var(--space-2)); }
.field-head .field-label { font-weight: 600; font-size: .875rem; }
.count { font-size: .75rem; color: var(--cw-text-3); font-variant-numeric: tabular-nums; }

.cbox {
  position: relative;
  display: block; inline-size: 100%; min-block-size: 2.75rem; padding: 9px 14px;
  border: 1px solid var(--cw-border-strong); border-radius: var(--cw-r-md); background: var(--cw-bg);
  color: var(--cw-text); font: 400 1rem/1.5 var(--font-body); overflow-wrap: anywhere; cursor: default;
}
.cbox--material { min-block-size: 3.4rem; padding-block: 12px; }
.cbox-ph { color: var(--cw-text-3); }
.cbox .caret { animation: none; }
.is-locked .cbox { color: var(--cw-text-2); background: var(--cw-surface-2); }
.field-note { min-block-size: 0; font-size: .8125rem; color: var(--cw-warn); margin-block: calc(-1 * var(--space-2)) 0; }
.field-note:empty { display: none; }
.where { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.compose-foot { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.btn--write { min-inline-size: 7.5rem; }
.is-locked .chip, .is-locked .btn--write { pointer-events: none; }

.latest { margin-block-start: var(--space-6); }
.pieces { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.empty-line { color: var(--cw-text-3); font-size: .875rem; padding: var(--space-4); border: 1px dashed var(--cw-border); border-radius: var(--cw-r-lg); text-align: center; }

.piece { display: grid; gap: var(--space-4); padding: var(--space-4); }
.piece-head { display: flex; align-items: center; gap: 12px; }
.piece-ic { display: grid; place-items: center; inline-size: 2.25rem; block-size: 2.25rem; flex: none; border-radius: var(--cw-r-md); background: var(--cw-accent-soft); color: var(--cw-accent-text); }
.piece-title { min-inline-size: 0; flex: 1; }
.piece-name { font-weight: 600; line-height: 1.3; }
.piece-sub { font-size: .8125rem; color: var(--cw-text-3); line-height: 1.35; overflow-wrap: anywhere; }

.mat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-block: 10px 0; border-block-start: 1px solid var(--cw-border); }
.mat-label { font-size: .75rem; color: var(--cw-text-3); margin-inline-end: 4px; }
.mat-chip { display: inline-flex; align-items: center; gap: 5px; min-block-size: 1.75rem; padding: 2px 10px; border: 1px dashed var(--cw-border-strong); border-radius: 999px; font-size: .75rem; color: var(--cw-text-3); transition: opacity .3s; }
.mat-chip .i { inline-size: 14px; block-size: 14px; stroke-width: 2.2; }
.mat-chip.is-on { border-style: solid; border-color: transparent; background: var(--cw-accent-soft); color: var(--cw-accent-text); }
.mat-chip[hidden] { display: none; }

.convo { display: grid; gap: var(--space-3); }
.msg { display: flex; gap: 10px; align-items: flex-start; max-inline-size: 44rem; }
.msg-ic { display: grid; place-items: center; inline-size: 2rem; block-size: 2rem; flex: none; border-radius: 50%; background: var(--cw-accent-soft); color: var(--cw-accent-text); }
.msg-ic .i { inline-size: 18px; block-size: 18px; }
.msg-body { min-inline-size: 0; padding: 10px 14px; border-radius: 4px var(--cw-r-lg) var(--cw-r-lg) var(--cw-r-lg); background: var(--cw-surface-2); }
.msg-name { font-size: .75rem; font-weight: 600; color: var(--cw-text-3); line-height: 1.3; margin-block-end: 2px; }
.msg-text { overflow-wrap: anywhere; }
.msg.you { margin-inline-start: auto; flex-direction: row-reverse; }
.msg.you .msg-ic { background: var(--cw-surface-3); color: var(--cw-text-2); }
.msg.you .msg-body { border-radius: var(--cw-r-lg) 4px var(--cw-r-lg) var(--cw-r-lg); background: var(--cw-accent-soft); }
[dir="rtl"] .msg-body { border-radius: var(--cw-r-lg) 4px var(--cw-r-lg) var(--cw-r-lg); }
[dir="rtl"] .msg.you .msg-body { border-radius: 4px var(--cw-r-lg) var(--cw-r-lg) var(--cw-r-lg); }

.ask { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--cw-accent); border-radius: var(--cw-r-lg); background: var(--cw-bg); box-shadow: 0 0 0 4px var(--cw-ring); }
.ask-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.ask-title { font-weight: 600; font-size: 1rem; }
.ask-count { font-size: .75rem; color: var(--cw-text-3); white-space: nowrap; }
.ask-prompt { color: var(--cw-text-2); margin-block-start: -6px; }
.answers { display: grid; gap: var(--space-2); }
.chip.answer { inline-size: 100%; border-radius: var(--cw-r-md); padding: 10px 14px; font-size: .9375rem; font-weight: 400; justify-content: flex-start; overflow-wrap: anywhere; }

.cbox-wrap { display: grid; gap: 6px; }
.cbox-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.cbox-row .cbox { flex: 1 1 14rem; inline-size: auto; min-inline-size: 0; }
.cbox-send { flex: none; margin-inline-start: auto; }
.cbox-send[aria-disabled="true"], .cbox-send[aria-disabled="true"]:hover { background: var(--cw-surface-2); border-color: var(--cw-border-strong); color: var(--cw-text-3); cursor: default; }
.cbox-note { font-size: .8125rem; color: var(--cw-warn); }
.cbox-note:empty { display: none; }
.cbox-hint { font-size: .75rem; line-height: 1.4; color: var(--cw-text-3); }
.chip.is-nudge { animation: cw-nudge .4s var(--cw-ease); }

.team { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); padding-block-start: 2px; }
.team::before { content: ""; position: absolute; inset-block-start: 21px; inset-inline: 12.5%; block-size: 1px; background: var(--cw-border-strong); }
.agent { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; min-inline-size: 0; }
.agent-ic { position: relative; display: grid; place-items: center; inline-size: 2.5rem; block-size: 2.5rem; border-radius: 50%; border: 1px solid var(--cw-border-strong); background: var(--cw-surface); color: var(--cw-text-3); transition: opacity .3s; }
.agent-ic .i { inline-size: 20px; block-size: 20px; }
.agent-ic::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-block-start-color: var(--cw-accent); opacity: 0; transition: opacity .2s; }
.agent-name { font-size: .75rem; font-weight: 600; line-height: 1.25; color: var(--cw-text-3); overflow-wrap: normal; }
.agent-badge { position: absolute; inset-block-start: -3px; inset-inline-end: -5px; display: none; place-items: center; inline-size: 18px; block-size: 18px; border-radius: 50%; }
.agent-badge .i { inline-size: 18px; block-size: 18px; stroke-width: 2.2; }
.agent[data-state="work"] .agent-ic { border-color: var(--cw-accent); background: var(--cw-accent-soft); color: var(--cw-accent-text); }
.agent[data-state="work"] .agent-ic::after { opacity: 1; animation: cw-spin .9s linear infinite; }
.agent[data-state="work"] .agent-name { color: var(--cw-text); }
.agent[data-state="done"] .agent-ic { color: var(--cw-ok); border-color: var(--cw-ok); }
.agent[data-state="done"] .agent-name { color: var(--cw-text-2); }
.agent[data-state="flag"] .agent-ic { color: var(--cw-warn); border-color: var(--cw-warn); background: var(--cw-warn-soft); }
.agent[data-state="flag"] .agent-name { color: var(--cw-text); }

.role { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-block-size: 1.6em; color: var(--cw-text-2); font-size: .875rem; }
.role strong { color: var(--cw-text); font-weight: 600; }
.role.is-swap { animation: cw-fade .35s var(--cw-ease); }
.run-row { display: grid; gap: 8px; }
.run-row[hidden] { display: none; }
.run-line { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--cw-accent-text); font-weight: 600; }
.run-line .i { inline-size: 16px; block-size: 16px; stroke-width: 2.2; }
.elapsed { font-weight: 400; color: var(--cw-text-3); font-variant-numeric: tabular-nums; }

.piece-body { display: grid; gap: var(--space-4); align-items: start; }
.text-col { display: grid; gap: var(--space-2); min-inline-size: 0; }
.text-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); flex-wrap: wrap; min-block-size: 2.75rem; }
.text-label { font-size: .8125rem; font-weight: 600; color: var(--cw-text-3); }
.yours-count { font-size: .8125rem; color: var(--cw-text-2); }
.yours-count b { color: var(--cw-accent-text); font-weight: 600; }

.draft {
  padding: 14px 18px 4px; border: 1px dashed var(--cw-border-strong); border-radius: var(--cw-r-md);
  background: var(--cw-surface); font-size: .9688rem; line-height: 1.65; overflow-wrap: anywhere; min-block-size: 8rem;
}
.draft.is-final { border-style: solid; border-color: var(--cw-border); background: var(--cw-bg); }
.draft p { margin: 0 -6px .85em; padding: 2px 6px; border-radius: 6px; }
.caret { display: inline-block; inline-size: 2px; block-size: 1.05em; margin-inline-start: 1px; vertical-align: -.15em; background: var(--cw-accent); animation: cw-blink 1s steps(1) infinite; }
@keyframes cw-blink { 50% { opacity: 0; } }
.draft p.is-out { opacity: 0; transition: opacity .18s ease; }
.draft p.is-in { animation: cw-fade .35s var(--cw-ease); }

.draft p.pass-ok, .draft p.pass-scan {
  background: linear-gradient(90deg, transparent 0 34%, var(--band) 34% 66%, transparent 66%) 100% 0 / 300% 100% no-repeat;
  animation: cw-pass 1.4s var(--cw-ease) forwards;
}
.draft p.pass-ok { --band: var(--cw-ok-soft); }
.draft p.pass-scan { --band: var(--cw-accent-soft); animation-duration: .45s; }
@keyframes cw-pass { to { background-position: 0 0; } }
.draft p.flag {
  background: linear-gradient(90deg, var(--cw-warn-soft) 50%, transparent 50%) 100% 0 / 200% 100% no-repeat;
  animation: cw-mark .6s var(--cw-ease) forwards;
  text-decoration: underline wavy var(--cw-warn); text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-skip-ink: none;
}
@keyframes cw-mark { to { background-position: 0 0; } }

.draft mark.yours {
  color: inherit; border-radius: 3px; padding: 1px 2px; margin: 0 -2px;
  background: linear-gradient(90deg, var(--cw-hl) 50%, transparent 50%) 100% 0 / 200% 100% no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-position .8s var(--cw-ease);
}
.draft.show-yours mark.yours { background-position: 0 0; }
[dir="rtl"] .draft mark.yours { background-image: linear-gradient(270deg, var(--cw-hl) 50%, transparent 50%); background-position: 0 0; }
[dir="rtl"] .draft.show-yours mark.yours { background-position: 100% 0; }

.toggle { display: inline-flex; align-items: center; gap: 8px; min-block-size: 2.75rem; padding: 0 12px; border: 1px solid var(--cw-border-strong); border-radius: 999px; background: transparent; font-size: .8125rem; font-weight: 600; color: var(--cw-text-2); }
.toggle .i { inline-size: 18px; block-size: 18px; }
.toggle[aria-pressed="true"] { border-color: var(--cw-accent); background: var(--cw-accent-soft); color: var(--cw-accent-text); }

.checks { display: grid; gap: var(--space-2); padding: 2px var(--space-4) var(--space-3); border: 1px solid var(--cw-border); border-radius: var(--cw-r-md); background: var(--cw-surface-2); }
.checks.is-shut { padding-block-end: 2px; }
.checks-head {
  display: flex; align-items: center; gap: 10px; inline-size: 100%; min-block-size: 44px; padding: 0;
  border: 0; background: transparent; font-size: .875rem; font-weight: 600; text-align: start; color: var(--cw-text);
}
.checks-head .ck-ic { inline-size: 18px; block-size: 18px; color: var(--cw-text-3); }
.checks-head .ck-chev { margin-inline-start: auto; inline-size: 18px; block-size: 18px; color: var(--cw-text-3); }
.checks.is-ok .checks-head, .checks.is-ok .checks-head .ck-ic { color: var(--cw-ok); }
.checks-body { display: grid; gap: var(--space-4); }
.checks.is-shut .checks-body { display: none; }
.cg-sum--rules { display: none; }
.cg { display: grid; gap: 2px; }
.cg + .cg { padding-block-start: var(--space-3); border-block-start: 1px solid var(--cw-border); }
.cg-title { font-size: .8125rem; font-weight: 600; color: var(--cw-text); }
.cg-sum { font-size: .75rem; color: var(--cw-text-3); margin-block-end: 4px; }
.cg-sum.ok { color: var(--cw-ok); font-weight: 600; }
.cg-list { list-style: none; margin: 0; padding: 0; display: grid; }
.check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0 10px; padding-block: 5px; }
.check > .i { inline-size: 18px; block-size: 18px; margin-block-start: 2px; color: var(--cw-text-3); stroke-width: 2; }
.check-lbl { font-size: .8125rem; line-height: 1.4; color: var(--cw-text); }
.check-dt { grid-column: 2; font-size: .75rem; line-height: 1.4; color: var(--cw-text-3); overflow-wrap: anywhere; }
.check-dt:empty { display: none; }
.check[data-state="pending"] .check-lbl { color: var(--cw-text-3); }
.check[data-state="run"] > .i { color: var(--cw-accent-text); }
.check[data-state="ok"] > .i { color: var(--cw-ok); }
.check[data-state="fail"] > .i { color: var(--cw-danger); }
.check[data-state="fail"] .check-dt { color: var(--cw-danger); }
.check[data-state="warn"] > .i { color: var(--cw-warn); }
.check[data-state="warn"] .check-dt { color: var(--cw-warn); }
.check.is-tick > .i { animation: cw-pop .35s var(--cw-ease); }
@keyframes cw-pop { from { transform: scale(.4); opacity: 0; } }
.fixed { display: inline-flex; align-items: center; gap: 4px; color: var(--cw-ok); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.fixed .i { inline-size: 14px; block-size: 14px; stroke-width: 2.2; }
.check .fixed { grid-column: 2; }

.challenge { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--cw-warn); border-radius: var(--cw-r-lg); background: var(--cw-bg); box-shadow: 0 0 0 4px var(--cw-warn-soft); animation: cw-rise .45s var(--cw-ease); }
.ch-head { display: flex; align-items: center; gap: 10px; }
.ch-ic { display: grid; place-items: center; inline-size: 2rem; block-size: 2rem; flex: none; border-radius: 50%; background: var(--cw-warn-soft); color: var(--cw-warn); }
.ch-ic .i { inline-size: 18px; block-size: 18px; }
.ch-who { font-size: .75rem; font-weight: 600; color: var(--cw-text-3); }
.ch-title { font-weight: 600; font-size: 1rem; line-height: 1.35; }
.ch-quote { margin: 0; padding: 8px 14px; border-inline-start: 3px solid var(--cw-warn); background: var(--cw-warn-soft); border-radius: 0 var(--cw-r-sm) var(--cw-r-sm) 0; color: var(--cw-text); font-style: italic; overflow-wrap: anywhere; }
[dir="rtl"] .ch-quote { border-radius: var(--cw-r-sm) 0 0 var(--cw-r-sm); }
.ch-why { color: var(--cw-text-2); }
.ch-cut { justify-self: start; }
.resolved { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--cw-r-md); background: var(--cw-ok-soft); animation: cw-fade .35s var(--cw-ease); }
.resolved .i { color: var(--cw-ok); margin-block-start: 2px; }
.resolved p { overflow-wrap: anywhere; }
.resolved b { font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.editor-panel { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--cw-r-md); background: var(--cw-surface-2); }
.editor-panel[hidden] { display: none; }
.ed-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: .8125rem; }
.ed-label strong { font-weight: 600; }
.ed-label span { color: var(--cw-text-2); }
.ed-note { font-size: .8125rem; color: var(--cw-text-2); }
.ed-note:empty { display: none; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: .75rem; color: var(--cw-text-3); }
.meta > * + *::before { content: "·"; margin-inline: 8px; color: var(--cw-text-3); }
.meta .fixed::before { color: var(--cw-text-3); font-weight: 400; }
.model-badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: var(--cw-surface-3); color: var(--cw-text-2); font-weight: 600; }
.meta .model-badge::before { content: none; }
.meta .model-badge { margin-inline-start: 8px; }
.learn { align-items: flex-start; }
.learn-body { display: grid; gap: 4px; min-inline-size: 0; }
.learn-who { font-size: .75rem; font-weight: 600; color: var(--cw-text-3); }
.learn .btn { justify-self: start; margin-block-start: 4px; margin-inline-start: -12px; }

.end {
  margin-block-start: var(--space-6); padding: var(--space-6) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-tint), var(--bg); color: var(--text); box-shadow: var(--elevation-2);
  animation: cw-rise .6s var(--cw-ease);
}
.end-title { font: 600 clamp(1.35rem, 1.1rem + 1vw, 1.75rem)/var(--lh-head) var(--font-display); letter-spacing: var(--tracking-display); max-inline-size: 26ch; text-wrap: balance; }
.end-body { margin-block: var(--space-3) 0; color: var(--text-muted); max-inline-size: 60ch; font-size: var(--fs-body); }
.end-line { margin-block: var(--space-4) 0; font: 500 var(--fs-lead)/1.4 var(--font-body); color: var(--text); max-inline-size: 40ch; text-wrap: balance; }
.end-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-5); margin-block-start: var(--space-6); }
.end-again {
  display: inline-flex; align-items: center; gap: var(--space-2); min-block-size: 44px; padding: 0 4px;
  border: 0; background: transparent; color: var(--link); font: 500 var(--fs-small)/1 var(--font-body);
}
.end-again:hover { text-decoration: underline; text-underline-offset: .2em; }
.end-again .i { inline-size: 18px; block-size: 18px; }

.files { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.file {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: start; min-block-size: 44px; padding: 12px 14px;
  border: 1px solid var(--cw-border); border-radius: var(--cw-r-md); background: var(--cw-surface); text-align: start;
}
.file:hover { border-color: var(--cw-border-strong); }
.file[aria-pressed="true"] { border-color: var(--cw-accent); background: var(--cw-accent-soft); }
.file > .i { grid-row: span 2; color: var(--cw-accent-text); margin-block-start: 2px; }
.file-name { font-weight: 600; line-height: 1.35; }
.file-desc { font-size: .8125rem; color: var(--cw-text-3); line-height: 1.4; }
.file-view { display: grid; gap: var(--space-4); margin-block-start: var(--space-4); }
.file-view h2 { font-size: 1.0625rem; font-weight: 600; }
.fv-sec { display: grid; gap: 6px; }
.fv-sec h3 { font-size: .8125rem; font-weight: 600; color: var(--cw-text-3); }
.fv-sec ul { margin: 0; padding-inline-start: 1.1em; display: grid; gap: 4px; }
.fv-sec li { padding-inline-start: 2px; }
.fv-sec li .pill { margin-inline-start: 8px; vertical-align: 1px; }
.fv-empty { color: var(--cw-text-3); font-size: .875rem; }
.li-new { animation: cw-fade .5s var(--cw-ease); }
.assistant { display: grid; gap: var(--space-3); margin-block-end: var(--space-4); }
.assistant-head { display: flex; align-items: center; gap: 10px; }
.assistant-head .msg-ic { inline-size: 2.25rem; block-size: 2.25rem; }
.assistant-name { font-size: 1rem; font-weight: 600; }
.assistant.is-asked { border-color: var(--cw-accent); box-shadow: 0 0 0 4px var(--cw-ring); }
.assistant-ask { color: var(--cw-text-2); }
.agents-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.agent-card { display: flex; flex-direction: column; gap: 8px; }
.ac-head { display: flex; align-items: center; gap: 10px; }
.ac-head .piece-ic { inline-size: 2rem; block-size: 2rem; }
.ac-head .i { inline-size: 18px; block-size: 18px; }
.ac-name { font-size: 1rem; font-weight: 600; line-height: 1.3; flex: 1; min-inline-size: 0; }
.ac-role { font-size: .875rem; color: var(--cw-text-2); line-height: 1.5; }
.ac-model { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: auto; padding-block-start: 4px; }
.mpill { display: inline-flex; align-items: center; min-block-size: 1.5rem; padding: 1px 9px; border: 1px solid var(--cw-border-strong); border-radius: 999px; font-size: .75rem; font-weight: 500; color: var(--cw-text-2); white-space: nowrap; }
.pill.line { background: transparent; border: 1px solid var(--cw-border-strong); color: var(--cw-text-3); }
.platforms { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); margin-block-start: var(--space-3); }
.platform-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--cw-border); border-radius: var(--cw-r-md); background: var(--cw-surface); }
.platform-row p { font-size: .8125rem; color: var(--cw-text-3); }
.platform-row b { display: block; font-weight: 600; color: var(--cw-text); font-size: .9375rem; }
.block-gap { margin-block-start: var(--space-6); }
.quiet { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-7) var(--space-4); text-align: center; border: 1px dashed var(--cw-border); border-radius: var(--cw-r-lg); }
.quiet-ic { display: grid; place-items: center; inline-size: 3rem; block-size: 3rem; border-radius: 50%; background: var(--cw-accent-soft); color: var(--cw-accent-text); }
.quiet-ic .i { inline-size: 24px; block-size: 24px; }
.quiet h1 { font-size: 1.25rem; font-weight: 600; }
.quiet p { color: var(--cw-text-2); max-inline-size: 42ch; }
.quiet .quiet-note { color: var(--cw-text-3); font-size: .8125rem; }
.archive-list { display: grid; gap: var(--space-2); }
.arch { display: flex; align-items: center; gap: 12px; }
.arch-text { min-inline-size: 0; flex: 1; }
.arch-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.arch-sub { font-size: .8125rem; color: var(--cw-text-3); }

.veil { position: absolute; inset: 0; z-index: 20; background: rgba(5, 6, 9, .55); animation: cw-fade .2s ease; }
.veil[hidden], .sheet[hidden] { display: none; }
.sheet {
  position: absolute; inset-inline: 0; inset-block-end: 0; z-index: 21; display: grid; gap: 2px;
  padding: var(--space-3) var(--space-3) calc(var(--space-4) + env(safe-area-inset-bottom));
  border-radius: var(--cw-r-xl) var(--cw-r-xl) 0 0; background: var(--cw-surface); border-block-start: 1px solid var(--cw-border);
  box-shadow: 0 -12px 40px -12px rgba(0, 0, 0, .5); animation: cw-up .28s var(--cw-ease);
}
.sheet-title { font-size: .8125rem; font-weight: 600; color: var(--cw-text-3); padding: 4px 12px 8px; }
.sheet-item { display: flex; align-items: center; gap: 14px; min-block-size: 48px; padding: 0 12px; border: 0; border-radius: var(--cw-r-md); background: transparent; text-align: start; font-weight: 500; }
.sheet-item:hover { background: var(--cw-surface-2); }
.sheet-item .nav-dot { margin-inline-start: auto; }
.sheet-item[aria-current="page"] { color: var(--cw-accent-text); background: var(--cw-accent-soft); }

.toast {
  position: fixed; inset-inline: 0; inset-block-end: 84px; z-index: 50; inline-size: max-content; max-inline-size: calc(100% - 32px); margin-inline: auto;
  padding: 10px 16px; border-radius: var(--cw-r-md, 10px); background: #eceef3; color: #171a21; font: 500 .875rem/1.4 var(--font-body);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-on { opacity: 1; transform: none; }
@media (min-width: 900px) { .toast { inset-block-end: 28px; } }
.noscript { position: fixed; inset: auto 16px 16px; padding: 12px 16px; background: var(--surface); color: var(--text); border-radius: var(--radius-md); }
.sr-copy { position: fixed; inset-block-start: -1000px; margin: 0; white-space: pre-wrap; opacity: 0; }

@keyframes cw-fade { from { opacity: 0; } }
@keyframes cw-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes cw-up { from { transform: translateY(100%); } }

.cw [hidden] { display: none !important; }
.cw [tabindex="-1"]:focus { outline: none; }
.vh { position: absolute !important; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.piece { --pad: var(--space-4); container: piece / inline-size; }
@container piece (min-width: 680px) {
  .piece-body { grid-template-columns: minmax(0, 1fr) 17.5rem; }
  .checks, .checks.is-shut { padding: var(--space-3) var(--space-4); }
  .checks-head { display: none; }
  .checks.is-shut .checks-body { display: grid; }
  .cg-sum--rules { display: block; }
}

.crew { display: grid; gap: 10px; }
.piece.is-live:not(.is-asking) .crew {
  position: sticky; inset-block-start: calc(-1 * var(--space-4)); z-index: 3;
  margin: -10px calc(-1 * var(--pad)) 0; padding: 10px var(--pad) 12px;
  background: var(--cw-surface); box-shadow: 0 1px 0 var(--cw-border);
}

@container piece (max-width: 679px) {
  .crew { gap: 8px; }
  .agent-ic { inline-size: 2.25rem; block-size: 2.25rem; }
  .agent-ic .i { inline-size: 18px; block-size: 18px; }
  .team::before { inset-block-start: 18px; }
  .agent-name { font-size: .6875rem; }
  .role { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-block-size: 0; font-size: .8125rem; line-height: 1.45; }
  .role strong { display: none; }
  .run-row { gap: 6px; }
  .checks-body > .cg:first-child > .cg-title { display: none; }
}
.run-line .sep { color: var(--cw-text-3); font-weight: 400; }
.run-row.is-wait .progress { opacity: 0; }
.run-row.is-wait .run-line { color: var(--cw-warn); }
.agent[data-state="wait"] .agent-ic { border-style: dashed; border-color: var(--cw-warn); color: var(--cw-warn); }
.agent[data-state="wait"] .agent-name { color: var(--cw-text); }
.agent[data-state="done"] .agent-badge, .agent[data-state="flag"] .agent-badge { display: grid; background: var(--cw-surface); animation: cw-pop .35s var(--cw-ease); }
.agent[data-state="done"] .agent-badge { color: var(--cw-ok); }
.agent[data-state="flag"] .agent-badge { color: var(--cw-warn); }
.mat-chip.is-pop { animation: cw-nudge .4s var(--cw-ease); }
@keyframes cw-nudge { from { transform: scale(.86); opacity: .5; } }

.msg, .ask { animation: cw-rise .4s var(--cw-ease); }
.convo.is-folding { opacity: 0; transition: opacity .3s ease; }

.draft p.over { background: var(--cw-danger-soft); }
.p-note { display: flex; align-items: center; gap: 6px; margin-block-start: 4px; font-size: .75rem; font-weight: 600; line-height: 1.35; color: var(--cw-danger); }
.p-note.ok { color: var(--cw-ok); }
.p-note .i { inline-size: 14px; block-size: 14px; stroke-width: 2.2; }
.ch-slot:empty { display: none; }

.piece-foot { display: grid; gap: var(--space-3); padding-block-start: var(--space-3); border-block-start: 1px solid var(--cw-border); }
.learn-slot:empty { display: none; }
.learn { animation: cw-rise .45s var(--cw-ease); }

@media (max-width: 599px) {
  .guide { padding: 6px var(--space-2) 6px var(--space-4); gap: var(--space-2); min-block-size: 52px; }
  .g-segs, .g-name { display: none; }
  .g-num { display: inline; }
  .g-hint { font-size: .8125rem; line-height: 1.3; }
  .g-long { display: none; }
  .g-short { display: inline; }
  .g-btn { padding: 0 10px; }
  .g-icon { padding: 0; inline-size: 44px; }
  .site-tag { display: none; }
  .piece { --pad: var(--space-3); padding: var(--space-3); gap: var(--space-3); }
  .ask, .challenge { padding: var(--space-3); }
  .draft { padding: 12px 14px 2px; }
  .end { padding: var(--space-5) var(--space-4); }
  .end .ra-btn-wrap, .end .ra-btn { inline-size: 100%; }
  .team::before { inset-inline: 12.5%; }
}
@media (max-width: 359px) {
  .cw-top .cost { display: none; }
  .end { padding-inline: var(--space-3); }
  .end .ra-btn { padding-inline: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  .spin, .agent[data-state="work"] .agent-ic::after, .progress i, .caret { animation: none !important; }
  .progress i { inline-size: 100%; opacity: .5; }
  .draft p.pass-ok, .draft p.pass-scan, .draft p.flag { animation: none; background-position: 0 0; }
  .draft p.pass-ok, .draft p.pass-scan { background: none; }
  .draft mark.yours { transition: none; }
  .challenge, .end, .resolved, .role.is-swap, .draft p.is-in, .li-new, .veil, .sheet, .check.is-tick > .i,
  .msg, .ask, .learn, .mat-chip.is-pop, .agent-badge, .chip.is-nudge { animation: none !important; }
  .convo.is-folding, .draft p.is-out { transition: none; }
  .toast { transition: none; }
}
