:root {
  color-scheme: light;
  --v4-ink: #202239;
  --v4-muted: #666a7f;
  --v4-line: #e4e4ef;
  --v4-page: #f7f7fb;
  --v4-surface: rgba(255, 255, 255, .78);
  --v4-surface-strong: #fff;
  --v4-lilac: #ebe6ff;
  --v4-lilac-strong: #7354d8;
  --v4-lilac-deep: #48318e;
  --v4-pink: #f8e8f0;
  --v4-good: #26775d;
  --v4-warn: #a46921;
  --v4-danger: #bd4f58;
  --v4-shadow: 0 18px 60px rgba(40, 32, 77, .07);
  --v4-custom-background: none;
  --v4-custom-background-dim: .12;
  --v4-panel-opacity: .88;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--v4-page);
  color: var(--v4-ink);
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--v4-page); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(115, 84, 216, .42); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .56; }
[hidden] { display: none !important; }

.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 20; padding: .7rem 1rem; border-radius: .75rem; background: var(--v4-ink); color: #fff; }
.skip-link:focus { top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.v4-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  background:
    linear-gradient(rgba(247, 247, 251, var(--v4-custom-background-dim)), rgba(247, 247, 251, var(--v4-custom-background-dim))),
    var(--v4-custom-background),
    radial-gradient(circle at 12% 0, rgba(225, 217, 255, .9), transparent 24rem),
    radial-gradient(circle at 96% 100%, rgba(255, 224, 238, .7), transparent 27rem),
    var(--v4-page);
  background-attachment: scroll;
  background-position: center;
  background-size: cover;
}

.v4-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.25rem 1rem;
  border-right: 1px solid rgba(225, 225, 237, .86);
  background: rgba(252, 252, 255, var(--v4-panel-opacity));
  backdrop-filter: none;
}

.v4-presence, .v4-command, .v4-quiet, #v4Navigation button, .v4-text-button, .v4-secondary, .v4-add, .v4-icon-button {
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
}

.v4-presence {
  display: flex;
  align-items: center;
  gap: .72rem;
  padding: .7rem;
  border: 1px solid rgba(226, 221, 246, .9);
  border-radius: 1.1rem;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 255, 255, .93), rgba(248, 246, 255, .82));
  box-shadow: 0 12px 30px rgba(69, 43, 142, .055);
}

.v4-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: .83rem;
  background: linear-gradient(135deg, #f0e9ff, #cfc1ff);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .9), 0 8px 18px rgba(95, 62, 190, .16);
  color: var(--v4-lilac-deep);
  font-size: .9rem;
  font-weight: 780;
}

.v4-avatar-large { width: 3.9rem; height: 3.9rem; border-radius: 1.3rem; font-size: 1.15rem; }
.v4-presence strong, .v4-presence small { display: block; }
.v4-presence strong { font-size: .82rem; }
.v4-presence small { margin-top: .2rem; color: var(--v4-muted); font-size: .72rem; }

#v4Navigation { display: grid; gap: .16rem; }
#v4Navigation button {
  padding: .66rem .78rem;
  border-radius: .75rem;
  color: #5a5c6e;
  font-size: .9rem;
  font-weight: 590;
  text-align: left;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
#v4Navigation button:hover { background: rgba(235, 230, 255, .62); color: var(--v4-lilac-deep); }
#v4Navigation button[aria-current] { background: linear-gradient(110deg, #eae3ff, #f5f1ff); color: var(--v4-lilac-deep); box-shadow: inset 0 0 0 1px rgba(123, 92, 218, .08); }
.v4-quiet { margin-top: auto; padding: .65rem .78rem; border-radius: .75rem; color: var(--v4-muted); font-size: .82rem; text-align: left; }
.v4-quiet:hover { background: #f2f2f8; color: var(--v4-ink); }

.v4-workspace { min-width: 0; }
.v4-topbar { position: sticky; z-index: 4; top: 0; height: 4.25rem; display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; border-bottom: 1px solid rgba(225, 225, 237, .75); background: rgba(247, 247, 251, var(--v4-panel-opacity)); backdrop-filter: none; }
.v4-topbar-actions { display: flex; align-items: center; gap: .85rem; }
.v4-topbar-actions > span { color: var(--v4-muted); font-size: .78rem; }
.v4-command { display: flex; align-items: center; gap: 2.6rem; padding: .5rem .65rem .5rem .85rem; border: 1px solid var(--v4-line); border-radius: .8rem; background: rgba(255, 255, 255, .76); color: #4d4f63; font-size: .84rem; box-shadow: 0 4px 15px rgba(44, 34, 82, .025); }
.v4-command kbd { padding: .13rem .35rem; border: 1px solid #e6e5ed; border-radius: .35rem; background: #fff; color: #77798c; font-size: .68rem; }
.v4-attention-center { display: inline-flex; align-items: center; gap: .38rem; min-height: 2.25rem; padding: .42rem .65rem; border: 1px solid var(--v4-line); border-radius: .68rem; background: rgba(255, 255, 255, .78); color: #4b4661; font-size: .76rem; font-weight: 720; cursor: pointer; }
.v4-attention-center:hover, .v4-attention-center[aria-expanded="true"] { border-color: #cfc3f4; background: #f5f1ff; color: var(--v4-lilac-deep); }
#v4AttentionCount { min-width: 1.18rem; padding: .08rem .28rem; border-radius: 999px; background: #e7defe; color: #4f2ca2; font-size: .66rem; font-variant-numeric: tabular-nums; }
.v4-attention-panel { position: absolute; z-index: 8; top: calc(100% - .15rem); right: 1.5rem; width: min(25rem, calc(100vw - 2rem)); max-height: min(30rem, calc(100vh - 5.5rem)); overflow: auto; padding: .5rem; border: 1px solid var(--v4-line); border-radius: .95rem; background: var(--v4-surface-strong); box-shadow: 0 18px 48px rgba(44, 31, 84, .18); }
.v4-attention-panel ul { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.v4-attention-panel li > button { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .58rem; width: 100%; padding: .65rem; border: 1px solid transparent; border-radius: .68rem; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.v4-attention-panel li > button:hover, .v4-attention-panel li > button:focus-visible { border-color: #d7cdf2; background: #f8f5ff; }
.v4-attention-panel strong, .v4-attention-panel small { display: block; }
.v4-attention-panel strong { font-size: .78rem; line-height: 1.4; }
.v4-attention-panel small, .v4-attention-empty { margin-top: .2rem; color: var(--v4-muted); font-size: .7rem; line-height: 1.45; }
.v4-attention-empty { padding: .7rem; }
.v4-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.v4-page { width: min(1320px, 100%); margin: 0 auto; padding: clamp(1.25rem, 2.4vw, 2.6rem) clamp(1.1rem, 3vw, 3rem) 3rem; }
.v4-page-Console { width: 100%; max-width: none; }
.v4-page-Console .v4-page-head { max-width: 64rem; }
.v4-page-head { max-width: 47rem; margin-bottom: 2.2rem; }
.v4-page-head p, .v4-section-title p, .v4-chat-rail > p, .v4-chat-context p, .v4-chat-context-rail > p, .v4-artifact-library p, .v4-memory-side section > p, .v4-profile-editor section > p, .v4-profile-side section > p, .v4-console-section > p, .v4-delivery-intro p, .v4-group-behavior > div > p, .v4-admission-layout > section:first-child > p { margin: 0 0 .46rem; color: var(--v4-lilac-strong); font-size: .69rem; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.v4-page-head h1 { margin: 0; font-size: clamp(2.35rem, 4vw, 4.15rem); line-height: .99; letter-spacing: -.065em; }
.v4-page-head h1:focus { outline: 0; }
.v4-page-head > span { display: block; max-width: 42rem; margin-top: .8rem; color: var(--v4-muted); font-size: .98rem; line-height: 1.7; }
.v4-loading, .v4-empty { margin: 1rem 0; color: var(--v4-muted); font-size: .88rem; line-height: 1.6; }
.v4-error { color: var(--v4-danger); }

/* B2 object-led pages: compact evidence first, optional detail second. */
.v4-now-presence { display: flex; align-items: center; gap: .85rem; padding: .95rem 1.05rem; border: 1px solid #e7e0fa; border-radius: 1rem; background: linear-gradient(115deg, rgba(250, 248, 255, .96), rgba(255, 255, 255, .82)); box-shadow: 0 10px 26px rgba(68, 49, 135, .06); }
.v4-now-presence > div { display: grid; gap: .12rem; min-width: 0; }
.v4-now-presence p { margin: 0; color: var(--v4-lilac-strong); font-size: .68rem; font-weight: 760; letter-spacing: .09em; text-transform: uppercase; }
.v4-now-presence strong { font-size: 1rem; }
.v4-now-presence span { color: var(--v4-muted); font-size: .82rem; }
.v4-now-presence .v4-secondary { margin-left: auto; }
.v4-now-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-top: .9rem; align-items: start; }
.v4-now-section { min-width: 0; padding: 1rem; border: 1px solid var(--v4-line); border-radius: 1rem; background: var(--v4-surface); box-shadow: 0 10px 28px rgba(51, 39, 104, .045); }
.v4-now-section .v4-section-title { margin-bottom: .55rem; }
.v4-now-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .72rem 0; border-top: 1px solid #ece9f4; }
.v4-now-item:first-of-type { border-top: 0; }
.v4-now-item strong, .v4-now-item p, .v4-now-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v4-now-item strong { font-size: .86rem; }
.v4-now-item p, .v4-now-item small { margin: .25rem 0 0; color: var(--v4-muted); font-size: .72rem; }
.v4-now-item .v4-secondary { padding: .42rem .58rem; font-size: .72rem; }
.v4-now-idle { max-width: 58rem; margin: .9rem 0 0; padding: .75rem .9rem; border: 1px solid #e7e2f3; border-radius: .8rem; background: rgba(255, 255, 255, .64); color: var(--v4-muted); font-size: .82rem; line-height: 1.55; }

.v4-primary, .v4-secondary, .v4-add { display: inline-flex; align-items: center; justify-content: center; min-height: 2.35rem; padding: .53rem .84rem; border-radius: .72rem; font-size: .8rem; font-weight: 700; text-decoration: none; }
.v4-primary { border: 1px solid #5d3bc3; background: linear-gradient(135deg, #6b4bce, #5032ad); box-shadow: 0 8px 18px rgba(83, 54, 178, .22); color: #fff; cursor: pointer; }
.v4-primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.v4-secondary, .v4-add { border: 1px solid var(--v4-line); background: rgba(255, 255, 255, .86); color: #4b416e; }
.v4-secondary:hover, .v4-add:hover { border-color: #cfc3f4; background: #f6f3ff; }
.v4-text-button { padding: .3rem 0; color: var(--v4-lilac-deep); font-size: .78rem; font-weight: 710; text-align: left; }
.v4-text-button:hover { color: var(--v4-lilac-strong); }
.v4-inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.v4-inline-actions p { margin: 0; color: var(--v4-muted); font-size: .8rem; }

/* Today */
.v4-today-inbox { display: grid; max-width: 61rem; gap: .85rem; }
.v4-today-section { min-width: 0; padding: 1.05rem 1.15rem; border: 1px solid var(--v4-line); border-radius: 1.05rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.v4-section-title h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.025em; }
.v4-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.55rem; min-height: 1.55rem; padding: 0 .38rem; border-radius: 999px; background: #f0ebff; color: var(--v4-lilac-deep); font-size: .73rem; font-variant-numeric: tabular-nums; font-weight: 760; }
.v4-today-action, .v4-today-active { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .78rem 0; border-top: 1px solid #ecebf2; }
.v4-today-action h3, .v4-today-action p, .v4-today-active h3, .v4-today-active p { margin: 0; }
.v4-today-action h3, .v4-today-active h3 { font-size: .88rem; }
.v4-today-action p, .v4-today-active p { margin-top: .24rem; color: var(--v4-muted); font-size: .78rem; line-height: 1.48; }
.v4-today-action small, .v4-today-active small { display: block; margin-top: .28rem; color: var(--v4-muted); font-size: .69rem; }
.v4-today-active { grid-template-columns: minmax(0, 1fr) auto; }

/* Local navigation */
.v4-local-nav { display: flex; gap: .35rem; width: max-content; max-width: 100%; margin-bottom: 1.15rem; padding: .28rem; overflow-x: auto; border: 1px solid var(--v4-line); border-radius: .92rem; background: rgba(255, 255, 255, .68); }
.v4-local-nav button { min-height: 2.15rem; padding: .4rem .72rem; border: 0; border-radius: .62rem; background: transparent; color: #77788a; font-size: .78rem; font-weight: 650; white-space: nowrap; cursor: pointer; }
.v4-local-nav button[aria-current="true"], .v4-local-nav button[aria-current="page"] { background: #fff; box-shadow: 0 3px 12px rgba(47, 33, 89, .08); color: var(--v4-lilac-deep); }

/* QQ */
.v4-qq-surface, .v4-work-surface, .v4-console-surface { min-height: 22rem; }
.v4-qq-conversation-layout { display: grid; grid-template-columns: minmax(13rem, .54fr) minmax(0, 1.45fr); overflow: hidden; border: 1px solid var(--v4-line); border-radius: 1.35rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-thread-list { padding: 1.15rem; border-right: 1px solid var(--v4-line); }
.v4-thread-list > p { margin: 0 0 .35rem; color: var(--v4-lilac-strong); font-size: .69rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.v4-thread-list h2, .v4-trace h2, .v4-delivery-intro h2, .v4-group-behavior h2 { margin: 0; font-size: 1.08rem; letter-spacing: -.025em; }
.v4-thread { display: block; width: 100%; margin-top: .48rem; padding: .75rem; border: 1px solid transparent; border-radius: .75rem; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.v4-thread:hover { background: #f7f5ff; }
.v4-thread.selected { border-color: #ded3fb; background: #f1edff; }
.v4-thread strong, .v4-thread span { display: block; }
.v4-thread strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-thread span { margin-top: .25rem; color: var(--v4-muted); font-size: .7rem; }
.v4-trace { min-width: 0; padding: 1.65rem; background: linear-gradient(165deg, #fff, #faf9fe); }
.v4-trace > p { margin: 0 0 .45rem; color: var(--v4-lilac-strong); font-size: .69rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.v4-trace-message { display: block; width: 100%; max-width: 43rem; margin-top: .65rem; padding: .85rem 1rem; border: 1px solid #ebe8f3; border-radius: .85rem; background: #fff; color: inherit; text-align: left; }
.v4-trace-message.v4-group-message { cursor: pointer; }
.v4-trace-message.v4-group-message:hover { border-color: #cfc2fb; background: #fbfaff; }
.v4-trace-message strong { color: var(--v4-lilac-deep); font-size: .72rem; }
.v4-trace-message p { margin: .35rem 0 0; font-size: .86rem; line-height: 1.65; }
.v4-group-message small { display: block; margin-top: .42rem; color: var(--v4-muted); font-size: .68rem; }
.v4-group-message.assistant { border-color: #e4dafa; background: #f8f5ff; }
.v4-qq-retention-note { max-width: 54rem; margin: 0 0 .8rem; color: var(--v4-muted); font-size: .8rem; line-height: 1.55; }
.v4-qq-search { display: block; margin: .8rem 0 .35rem; }
.v4-qq-search input { width: 100%; padding: .55rem .65rem; border: 1px solid #dfdce9; border-radius: .62rem; background: #fff; color: var(--v4-ink); font-size: .76rem; }
.v4-load-more { width: 100%; margin-top: .8rem; }
.v4-qq-summary { display: grid; gap: .5rem; margin: .9rem 0; padding: .78rem .85rem; border: 1px solid #e5dff7; border-radius: .8rem; background: #faf8ff; }
.v4-qq-summary > p { margin: 0; color: var(--v4-lilac-deep); font-size: .71rem; font-weight: 760; letter-spacing: .07em; text-transform: uppercase; }
.v4-qq-summary > div { display: flex; flex-wrap: wrap; gap: .38rem; }
.v4-qq-summary > div > span { padding: .25rem .4rem; border-radius: .42rem; background: #fff; color: #5d566f; font-size: .7rem; }
.v4-qq-summary small { color: var(--v4-muted); font-size: .68rem; line-height: 1.5; }
.v4-object-inspector { display: grid; gap: .35rem; margin-top: .85rem; padding: .8rem .9rem; border-left: 3px solid var(--v4-lilac); border-radius: 0 .75rem .75rem 0; background: #f8f6ff; color: var(--v4-muted); font-size: .77rem; line-height: 1.55; }
.v4-object-inspector p, .v4-object-inspector strong { margin: 0; color: var(--v4-ink); }
.v4-object-inspector strong { font-size: .86rem; }
.v4-admission-layout { display: grid; grid-template-columns: minmax(16rem, .64fr) minmax(0, 1.45fr); gap: 1.1rem; padding: 1.35rem; border: 1px solid var(--v4-line); border-radius: 1.35rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-admission-layout > section:first-child { max-width: 17rem; }
.v4-admission-layout h2, .v4-admission-layout h3 { margin: 0; letter-spacing: -.025em; }
.v4-admission-layout > section:first-child > span { display: block; margin-top: .6rem; color: var(--v4-muted); font-size: .84rem; line-height: 1.65; }
.v4-admission-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.v4-admission-list > div { padding: 1rem; border: 1px solid #eceaf1; border-radius: 1rem; background: rgba(255, 255, 255, .66); }
.v4-admission-list h3 { margin-bottom: .8rem; font-size: .86rem; }
.v4-access-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) auto; gap: .45rem; align-items: center; padding: .45rem 0; border-top: 1px solid #efedf4; }
.v4-access-row input { min-width: 0; padding: .45rem; border: 1px solid #e3e0e9; border-radius: .5rem; background: #fff; }
.v4-access-row span { overflow: hidden; color: var(--v4-muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-access-row button { color: var(--v4-danger); font-size: .72rem; }
.v4-add { margin-top: .7rem; }
.v4-admission-layout > .v4-inline-actions { grid-column: 1 / -1; padding-top: .15rem; }
.v4-delivery-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.v4-delivery-intro > div > span { display: block; max-width: 40rem; margin-top: .5rem; color: var(--v4-muted); font-size: .86rem; }
.v4-truth-note { max-width: 18rem; color: var(--v4-muted); font-size: .73rem; line-height: 1.55; text-align: right; }
.v4-delivery-list { display: grid; gap: .65rem; }
.v4-delivery-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(9rem, .3fr); gap: 1rem; align-items: center; padding: 1rem 1.15rem; border: 1px solid var(--v4-line); border-radius: 1rem; background: var(--v4-surface); box-shadow: 0 8px 24px rgba(46, 34, 87, .04); }
.v4-delivery-item h3 { margin: .38rem 0 .26rem; font-size: .9rem; }
.v4-delivery-item p { margin: 0; color: var(--v4-muted); font-size: .78rem; line-height: 1.5; }
.v4-delivery-item > div:last-child { display: grid; justify-items: end; gap: .25rem; text-align: right; }
.v4-delivery-item > div:last-child strong { font-size: .78rem; }
.v4-delivery-item > div:last-child span { color: var(--v4-muted); font-size: .7rem; }
.v4-status { display: inline-flex; width: max-content; padding: .25rem .45rem; border-radius: .42rem; background: #f0eff3; color: #676879; font-size: .68rem; font-weight: 760; }
.v4-status.success, .v4-projection .success { background: #e7f7ef; color: var(--v4-good); }
.v4-status.warning { background: #fff1dc; color: var(--v4-warn); }
.v4-status.danger, .v4-projection .danger { background: #ffebec; color: var(--v4-danger); }
.v4-status.muted, .v4-projection .muted { background: #f0eff3; color: #737587; }
.v4-group-behavior { padding: 1.35rem; border: 1px solid var(--v4-line); border-radius: 1.35rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-group-behavior > div > span { display: block; max-width: 42rem; margin-top: .55rem; color: var(--v4-muted); font-size: .84rem; line-height: 1.65; }
.v4-group-policy-list { display: grid; gap: .62rem; margin-top: 1.25rem; }
.v4-group-policy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(10rem, .5fr) auto; gap: 1rem; align-items: end; padding: .9rem; border: 1px solid #eceaf1; border-radius: .9rem; background: #fff; }
.v4-group-policy strong, .v4-group-policy span { display: block; }
.v4-group-policy span { margin-top: .24rem; color: var(--v4-muted); font-size: .76rem; }
.v4-group-policy small { display: block; margin-top: .36rem; color: var(--v4-muted); font-size: .71rem; line-height: 1.5; }
.v4-group-policy label, .v4-group-policy select { display: grid; gap: .3rem; color: var(--v4-muted); font-size: .72rem; }
.v4-window-override-actions { justify-self: start; }
.v4-ambient-windows, .v4-window-override-form { display: grid; gap: .8rem; margin-top: 1.15rem; padding: 1rem; border: 1px solid #e3dcf8; border-radius: .95rem; background: linear-gradient(145deg, #fbfaff, #f4f0ff); }
.v4-ambient-windows header h3, .v4-window-override-form h3 { margin: 0; font-size: .92rem; }
.v4-ambient-windows header p, .v4-window-override-form > p { margin: .32rem 0 0; color: var(--v4-muted); font-size: .76rem; line-height: 1.55; }
.v4-ambient-window-fields { display: grid; grid-template-columns: minmax(13rem, .65fr) minmax(0, 1.35fr); gap: .75rem; align-items: start; }
.v4-ambient-window-fields > label, .v4-ambient-window-grid label { display: grid; gap: .32rem; color: #5d5b70; font-size: .76rem; font-weight: 650; }
.v4-ambient-window-fields input { width: 100%; min-width: 0; padding: .55rem; border: 1px solid #ddd8eb; border-radius: .58rem; background: #fff; color: var(--v4-ink); }
.v4-ambient-window-fields fieldset { min-width: 0; margin: 0; padding: .7rem; border: 1px solid #e2dcef; border-radius: .72rem; }
.v4-ambient-window-fields legend { padding: 0 .24rem; color: #5d5b70; font-size: .74rem; font-weight: 700; }
.v4-ambient-window-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.v4-ambient-window-grid > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; padding: .65rem; border-radius: .62rem; background: rgba(255, 255, 255, .76); }
.v4-ambient-window-grid strong { grid-column: 1 / -1; font-size: .74rem; }
.v4-window-override-form { grid-column: 1 / -1; margin-top: 0; }

/* Chat */
.v4-chat-workspace { display: grid; grid-template-columns: minmax(13rem, .44fr) minmax(0, 1.55fr) minmax(13rem, .44fr); min-height: 32rem; overflow: hidden; border: 1px solid var(--v4-line); border-radius: 1.35rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-chat-rail { padding: 1rem; border-right: 1px solid var(--v4-line); background: rgba(252, 251, 255, .65); }
.v4-new-chat { width: 100%; padding: .62rem; border: 1px dashed #cfc1f7; border-radius: .72rem; background: #f5f1ff; color: var(--v4-lilac-deep); font-size: .78rem; font-weight: 730; cursor: pointer; }
.v4-chat-rail > p { margin-top: 1.2rem; }
.v4-chat-thread { display: block; width: 100%; padding: .7rem 0; border: 0; border-bottom: 1px solid #eeecf3; background: none; color: inherit; text-align: left; cursor: pointer; }
.v4-chat-thread strong, .v4-chat-thread span { display: block; }
.v4-chat-thread strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-chat-thread span { margin-top: .28rem; color: var(--v4-muted); font-size: .68rem; }
.v4-chat-main { display: flex; min-width: 0; flex-direction: column; padding: 1.2rem; background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(250, 249, 254, .82)); }
.v4-chat-context { display: flex; align-items: center; gap: .7rem; padding-bottom: 1rem; border-bottom: 1px solid #ebeaf0; }
.v4-chat-context p { margin: 0 0 .2rem; }
.v4-chat-context strong { display: block; font-size: .88rem; }
.v4-chat-context .v4-text-button { margin-left: auto; }
.v4-chat-context-details { display: grid; gap: .25rem; margin-top: .7rem; padding: .7rem .8rem; border: 1px solid #e4ddf7; border-radius: .7rem; background: #f8f5ff; color: #5f5874; font-size: .76rem; line-height: 1.55; }
.v4-chat-context-details strong { color: var(--v4-lilac-deep); font-size: .72rem; }
.v4-transcript { flex: 1; min-height: 22rem; padding: 1.2rem .2rem; overflow: auto; }
.v4-message { width: fit-content; max-width: min(42rem, 88%); margin-bottom: .9rem; padding: .8rem .95rem; border-radius: .9rem; line-height: 1.6; }
.v4-message strong { font-size: .7rem; }
.v4-message p { margin: .22rem 0 0; font-size: .87rem; }
.v4-message.assistant { border: 1px solid #e5ddfb; background: #f4f0ff; }
.v4-message.user { margin-left: auto; border: 1px solid #e2e2eb; background: #fff; }
.v4-composer { padding-top: .9rem; border-top: 1px solid #e8e7ee; }
.v4-composer textarea { display: block; width: 100%; min-height: 4.5rem; padding: .2rem; border: 0; resize: vertical; background: transparent; color: var(--v4-ink); line-height: 1.55; outline: 0; }
.v4-composer > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .4rem; color: var(--v4-muted); font-size: .71rem; }
.v4-chat-context-rail { padding: 1.1rem; border-left: 1px solid var(--v4-line); background: rgba(249, 247, 253, .7); }
.v4-chat-context-rail h2 { margin: .6rem 0 .45rem; font-size: .78rem; }
.v4-context-object { display: block; width: 100%; padding: .62rem 0; border: 0; border-top: 1px solid #eceaf2; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.v4-context-object strong, .v4-context-object span { display: block; }
.v4-context-object strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-context-object span { margin-top: .2rem; color: var(--v4-muted); font-size: .68rem; }

/* Work */
.v4-work-list, .v4-approval-stack, .v4-plan-list, .v4-project-board { display: grid; gap: .65rem; }
.v4-work-list, .v4-approval-stack, .v4-plan-list { max-width: 60rem; }
.v4-work-item, .v4-plan-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .95rem 1.05rem; border: 1px solid var(--v4-line); border-radius: 1rem; background: var(--v4-surface); box-shadow: 0 7px 20px rgba(45, 30, 90, .035); }
.v4-work-item strong, .v4-plan-item strong { font-size: .86rem; }
.v4-work-item p, .v4-plan-item p { margin: .28rem 0 0; color: var(--v4-muted); font-size: .76rem; }
.v4-task-detail { max-width: 60rem; margin-top: .7rem; padding: .9rem 1rem; border-left: 3px solid var(--v4-lilac-strong); border-radius: 0 .8rem .8rem 0; background: #f0edfc; }
.v4-task-detail p { margin: .35rem 0 0; color: #66647a; font-size: .82rem; }
.v4-approval-review { max-width: 60rem; margin-bottom: .7rem; padding: .95rem 1.05rem; border: 1px solid #dfd3fb; border-radius: 1rem; background: #f7f4ff; }
.v4-approval-review > p { margin: 0 0 .35rem; color: var(--v4-lilac-strong); font-size: .7rem; font-weight: 760; }
.v4-approval-review h3 { margin: 0; font-size: .95rem; }
.v4-approval-review dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin: .8rem 0 0; }
.v4-approval-review dl div { min-width: 0; }
.v4-approval-review dt { color: var(--v4-muted); font-size: .68rem; }
.v4-approval-review dd { margin: .16rem 0 0; overflow-wrap: anywhere; color: #4d4664; font-size: .74rem; }
.v4-approval { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.2rem; padding: 1.15rem; border: 1px solid #eadcc8; border-radius: 1rem; background: linear-gradient(110deg, #fffdf9, #fff8ee); }
.v4-approval.selected { border-color: #bda9f2; box-shadow: 0 0 0 3px rgba(144, 109, 226, .13); }
.v4-approval h3 { margin: .48rem 0 .35rem; font-size: .95rem; }
.v4-approval p, .v4-approval span:last-child { margin: 0; color: #7d6d5b; font-size: .78rem; line-height: 1.55; }
.v4-approval .v4-inline-actions { align-content: center; }
.v4-project-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v4-project-card { min-height: 12rem; padding: 1rem; border: 1px solid var(--v4-line); border-radius: 1rem; background: linear-gradient(145deg, #fff, #faf9fe); }
.v4-project-card > span { color: var(--v4-lilac-strong); font-size: .7rem; font-weight: 760; }
.v4-project-card h3 { margin: .55rem 0 .4rem; font-size: .96rem; }
.v4-project-card p { min-height: 3rem; margin: 0; color: var(--v4-muted); font-size: .78rem; line-height: 1.55; }
.v4-project-card .v4-text-button { margin-top: 1rem; }

/* Artifacts */
.v4-artifact-layout { display: grid; grid-template-columns: minmax(14rem, .46fr) minmax(0, 1.54fr); overflow: hidden; border: 1px solid var(--v4-line); border-radius: 1.35rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-artifact-library { padding: 1.15rem; border-right: 1px solid var(--v4-line); background: rgba(251, 250, 255, .72); }
.v4-artifact-library h2 { margin: 0 0 .8rem; font-size: 1.05rem; }
.v4-artifact-item { display: block; width: 100%; padding: .75rem; border: 1px solid transparent; border-radius: .75rem; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.v4-artifact-item:hover { background: #f7f4ff; }
.v4-artifact-item.selected { border-color: #ddcffd; background: #f0ebff; }
.v4-artifact-item strong, .v4-artifact-item span { display: block; }
.v4-artifact-item strong { overflow: hidden; font-size: .81rem; text-overflow: ellipsis; white-space: nowrap; }
.v4-artifact-item span { margin-top: .25rem; color: var(--v4-muted); font-size: .7rem; }
#v4ArtifactDetail { min-width: 0; }
.v4-artifact-detail { padding: 1.65rem; }
.v4-artifact-detail > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.v4-artifact-detail header > div > span { color: var(--v4-lilac-strong); font-size: .7rem; font-weight: 770; }
.v4-artifact-detail h2 { margin: .45rem 0; font-size: 1.4rem; letter-spacing: -.04em; }
.v4-artifact-detail header p { max-width: 45rem; margin: 0; color: var(--v4-muted); font-size: .84rem; line-height: 1.6; }
.v4-artifact-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin-top: 1.35rem; }
.v4-artifact-columns section { padding: 1rem; border: 1px solid #eceaf1; border-radius: .9rem; background: #fff; }
.v4-artifact-columns h3 { margin: 0 0 .6rem; font-size: .82rem; }
.v4-version { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .58rem 0; border-top: 1px solid #f0eef4; }
.v4-version div { display: grid; gap: .15rem; }
.v4-version strong { font-size: .78rem; }
.v4-version span { color: var(--v4-muted); font-size: .7rem; }
.v4-projection { display: grid; gap: .3rem; padding: .55rem 0; border-top: 1px solid #f0eef4; }
.v4-projection strong { font-size: .77rem; }
.v4-projection span { color: var(--v4-muted); font-size: .71rem; line-height: 1.5; }
.v4-revise { display: grid; gap: .65rem; margin-top: 1.15rem; padding: 1rem; border: 1px solid #e2dcf7; border-radius: .9rem; background: #f8f6ff; }
.v4-revise label { display: grid; gap: .35rem; color: #514b68; font-size: .8rem; font-weight: 670; }
.v4-revise textarea { width: 100%; padding: .65rem; border: 1px solid #ddd9e9; border-radius: .65rem; resize: vertical; background: #fff; }
.v4-revise > div { display: flex; align-items: center; justify-content: space-between; gap: .8rem; color: var(--v4-muted); font-size: .72rem; }
.v4-revise p { margin: 0; color: var(--v4-muted); font-size: .78rem; }

/* Memory and profile */
.v4-memory-layout, .v4-profile-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(17rem, .64fr); gap: 1rem; }
.v4-memory-main { padding: 1.25rem; border: 1px solid var(--v4-line); border-radius: 1.35rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-memory-list { display: grid; gap: .48rem; }
.v4-memory-item { display: flex; align-items: flex-start; justify-content: space-between; gap: .9rem; padding: .9rem 0; border-top: 1px solid #ecebf2; }
.v4-memory-item span, .v4-memory-item small { color: var(--v4-muted); font-size: .7rem; }
.v4-memory-item p { margin: .4rem 0; font-size: .88rem; line-height: 1.55; }
.v4-memory-item > div:last-child { display: flex; gap: .5rem; align-items: center; }
.v4-icon-button { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: .5rem; color: var(--v4-danger); }
.v4-icon-button:hover { background: #ffeded; }
.v4-memory-side, .v4-profile-side { display: grid; align-content: start; gap: .75rem; }
.v4-memory-side > section, .v4-profile-side > section { padding: 1rem; border: 1px solid var(--v4-line); border-radius: 1rem; background: var(--v4-surface); box-shadow: 0 8px 24px rgba(45, 32, 90, .04); }
.v4-memory-side h2, .v4-profile-side h2 { margin: 0; font-size: .9rem; }
.v4-memory-side strong, .v4-memory-side span { display: block; }
.v4-memory-side strong { margin-top: .55rem; font-size: 1.2rem; }
.v4-memory-side span { margin-top: .25rem; color: var(--v4-muted); font-size: .75rem; }
.v4-learning-event { display: grid; gap: .2rem; padding: .55rem 0; border-top: 1px solid #ecebf2; }
.v4-learning-event strong { margin: 0; font-size: .76rem; }
.v4-learning-event span { margin: 0; font-size: .68rem; }
.v4-memory-form { display: grid; gap: .55rem; padding: 1rem; border: 1px solid #e0d9f7; border-radius: 1rem; background: linear-gradient(145deg, #faf8ff, #f1edff); }
.v4-memory-form h2 { margin: 0; font-size: .88rem; }
.v4-memory-form textarea, .v4-memory-form select { width: 100%; padding: .6rem; border: 1px solid #dcd8e8; border-radius: .6rem; resize: vertical; background: #fff; }
.v4-memory-form label { display: grid; gap: .3rem; color: #656177; font-size: .76rem; }
.v4-memory-form p { margin: 0; color: var(--v4-muted); font-size: .75rem; }
.v4-profile-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; padding: 1.25rem; border: 1px solid var(--v4-line); border-radius: 1.35rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-profile-editor section { display: grid; align-content: start; gap: .65rem; }
.v4-profile-editor h2 { margin: 0 0 .1rem; font-size: 1.08rem; }
.v4-profile-editor label { display: grid; gap: .3rem; color: #5d5c6e; font-size: .76rem; font-weight: 650; }
.v4-profile-editor input, .v4-profile-editor textarea { width: 100%; padding: .6rem; border: 1px solid #dddbe5; border-radius: .62rem; resize: vertical; background: rgba(255, 255, 255, .88); color: var(--v4-ink); }
.v4-profile-editor > .v4-inline-actions { grid-column: 1 / -1; padding-top: .5rem; border-top: 1px solid #ecebf2; }
.v4-profile-side > section > strong { display: block; margin-top: .5rem; color: #4b4661; font-size: .82rem; }
.v4-persona-preview { color: var(--v4-muted); font-size: .8rem; line-height: 1.55; }

/* Console */
.v4-console-section { min-height: 27rem; padding: 1.4rem; border: 1px solid var(--v4-line); border-radius: 1.35rem; background: rgba(255, 255, 255, .77); box-shadow: var(--v4-shadow); }
.v4-console-section h2 { margin: 0 0 1rem; font-size: 1.22rem; letter-spacing: -.03em; }
.v4-runtime-console { min-height: 0; }
.v4-runtime-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0; padding: .3rem; border: 1px solid #e3def2; border-radius: .8rem; background: #f8f6fd; }
.v4-runtime-nav button { min-height: 2.5rem; padding: .55rem .85rem; border: 0; border-radius: .58rem; background: transparent; color: #625b73; font: inherit; font-size: .78rem; font-weight: 720; cursor: pointer; }
.v4-runtime-nav button[aria-current="page"] { background: #fff; color: var(--v4-lilac-deep); box-shadow: 0 1px 7px rgba(54, 42, 100, .12); }
.v4-runtime-nav button:focus-visible { outline: 3px solid rgba(107, 74, 221, .42); outline-offset: 2px; }
[data-v4-runtime-panel] { min-width: 0; }
.v4-runtime-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.v4-runtime-summary article { display: grid; gap: .15rem; min-height: 5rem; align-content: center; padding: .9rem 1rem; border: 1px solid #e4dff0; border-radius: .8rem; background: #fff; }
.v4-runtime-summary strong { color: var(--v4-lilac-deep); font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.v4-runtime-summary span { color: var(--v4-muted); font-size: .75rem; }
.v4-runtime-item, .v4-plugin-item, .v4-dead-letter { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; min-width: 0; padding: .86rem 0; border-top: 1px solid #ecebf2; }
.v4-runtime-item > div:first-child, .v4-plugin-item > div:first-child, .v4-dead-letter > div:first-child { min-width: 0; flex: 1 1 auto; }
.v4-runtime-item strong, .v4-runtime-item span, .v4-plugin-item strong, .v4-plugin-item span, .v4-dead-letter strong, .v4-dead-letter span { display: block; }
.v4-runtime-item strong, .v4-runtime-item span, .v4-plugin-item strong, .v4-plugin-item span, .v4-dead-letter strong, .v4-dead-letter span { overflow-wrap: anywhere; word-break: break-word; }
.v4-runtime-item strong, .v4-plugin-item strong, .v4-dead-letter strong { font-size: .84rem; }
.v4-runtime-item span, .v4-plugin-item span, .v4-dead-letter span { margin-top: .23rem; color: var(--v4-muted); font-size: .74rem; }
.v4-executor-verification { display: inline-block; margin-top: .32rem; font-size: .68rem; font-weight: 700; }
.v4-executor-verified { color: #26714a; }
.v4-executor-failed { color: #a23d55; }
.v4-executor-stale, .v4-executor-pending { color: #8a5a13; }
.v4-role-binding { display: grid; gap: .55rem; margin-top: 1.2rem; padding: 1rem; border: 1px solid #e3def2; border-radius: .9rem; background: #f9f7ff; }
.v4-role-binding h3, .v4-role-binding p { margin: 0; }
.v4-role-binding h3 { font-size: .9rem; }
.v4-role-binding > p { color: var(--v4-muted); font-size: .78rem; line-height: 1.55; }
.v4-role-binding article { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(8rem, .8fr) minmax(8rem, .8fr) auto; gap: .7rem; align-items: end; padding: .72rem 0; border-top: 1px solid #e7e3f0; }
.v4-role-binding article strong, .v4-role-binding article span { display: block; }
.v4-role-binding article strong { font-size: .78rem; }
.v4-role-binding article span { margin-top: .2rem; color: var(--v4-muted); font-size: .75rem; }
.v4-role-binding .v4-role-work-executor { grid-template-columns: minmax(0, 1.1fr) minmax(8rem, .8fr) auto; }
.v4-role-eligibility { display: block; margin-top: .36rem; color: #9b4f60; font-size: .68rem; line-height: 1.45; }
.v4-role-binding label { display: grid; gap: .25rem; color: #666176; font-size: .68rem; }
.v4-role-binding select { min-width: 0; padding: .42rem; border: 1px solid #dcd8e7; border-radius: .5rem; background: #fff; }
.v4-console-actions, .v4-runtime-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.v4-console-actions { margin: 0 0 1rem; }
.v4-runtime-toolbar { display: flex; align-items: end; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; }
.v4-runtime-toolbar label { display: grid; flex: 1 1 20rem; gap: .3rem; max-width: 34rem; color: #666176; font-size: .72rem; }
.v4-runtime-toolbar input { min-height: 2.6rem; padding: .55rem .7rem; border: 1px solid #dcd8e7; border-radius: .6rem; background: #fff; color: var(--v4-ink); font: inherit; }
.v4-runtime-library { min-width: 0; margin-top: 0; padding: .95rem 1rem; border: 1px solid #e7e3f0; border-radius: .95rem; background: rgba(251, 250, 255, .72); }
.v4-runtime-library > header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding-bottom: .45rem; border-bottom: 1px solid #ecebf2; }
.v4-runtime-library > header h3, .v4-runtime-library > header p { margin: 0; }
.v4-runtime-library > header h3 { font-size: .92rem; }
.v4-runtime-library > header span { display: inline-block; margin-top: .18rem; color: var(--v4-lilac-deep); font-size: .71rem; font-weight: 740; }
.v4-runtime-library > header p { max-width: 13rem; color: var(--v4-muted); font-size: .71rem; line-height: 1.45; text-align: right; }
.v4-runtime-editor { display: grid; gap: .85rem; margin: 1rem 0; padding: 1rem; border: 1px solid #ddd5f2; border-radius: .95rem; background: #faf8ff; }
.v4-runtime-editor h3, .v4-runtime-editor p { margin: 0; }
.v4-runtime-editor h3 { font-size: .95rem; }
.v4-runtime-editor > div > span { display: block; margin-top: .25rem; color: var(--v4-muted); font-size: .76rem; line-height: 1.5; }
.v4-runtime-catalog { margin-top: 1.25rem; }
.v4-runtime-catalog > h3 { margin: 0 0 .3rem; }
.v4-runtime-collapsible { margin-top: .45rem; border-top: 1px solid #ecebf2; }
.v4-runtime-collapsible > summary { cursor: pointer; padding: .8rem 0; color: var(--v4-lilac-deep); font-size: .78rem; font-weight: 730; }
.v4-runtime-collapsible > summary:focus-visible { outline: 3px solid rgba(107, 74, 221, .38); outline-offset: 3px; border-radius: .35rem; }
.v4-runtime-collapsible[open] > summary { border-bottom: 1px solid #ecebf2; }
.v4-runtime-removal-note { display: block; margin-top: .3rem; color: #7a5c2d; font-size: .7rem; line-height: 1.45; }
.v4-runtime-pagination { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; padding-top: .8rem; border-top: 1px solid #ecebf2; }
.v4-runtime-pagination span { color: var(--v4-muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.v4-runtime-selection-note { display: block; color: var(--v4-muted); font-size: .68rem; line-height: 1.45; }
.v4-model-fetch-row { align-items: flex-start; margin: .1rem 0 .4rem; }
.v4-model-fetch-row .v4-runtime-editor-help { margin: 0; }
.v4-model-fetch-row + * { margin-top: .4rem; }
.v4-runtime-provider-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.v4-runtime-chip { min-height: 2.1rem; padding: .34rem .66rem; border: 1px solid #e3def2; border-radius: 999px; background: #fff; color: #625b73; font: inherit; font-size: .74rem; font-weight: 680; cursor: pointer; }
.v4-runtime-chip:hover { border-color: #cfc4f4; }
.v4-runtime-chip:focus-visible { outline: 3px solid rgba(107, 74, 221, .42); outline-offset: 2px; }
.v4-runtime-chip-active { border-color: var(--v4-lilac-deep); background: var(--v4-lilac-deep); color: #fff; }
:root[data-v4-theme="dark"] .v4-runtime-chip { border-color: #3c3a4d; background: #2a2937; color: #d9d6e8; }
:root[data-v4-theme="dark"] .v4-runtime-chip-active { border-color: #947bfa; background: #4f3a9e; color: #fff; }
.v4-runtime-option-details { margin-top: .35rem; }
.v4-runtime-option-details > summary { cursor: pointer; color: var(--v4-lilac-deep); font-size: .68rem; line-height: 1.45; }
.v4-runtime-option-details > select { width: 100%; min-width: 0; margin-top: .3rem; padding: .42rem; border: 1px solid #dcd8e7; border-radius: .5rem; background: #fff; color: inherit; font: inherit; }
.v4-executor-sections { display: grid; gap: 1rem; }
.v4-executor-sections > section, .v4-runtime-gate { padding: 1rem; border: 1px solid #e4dff0; border-radius: .9rem; background: #fff; }
.v4-executor-sections h3 { margin: 0 0 .55rem; font-size: .92rem; }
.v4-executor-candidates { margin-top: .85rem; padding-top: .75rem; border-top: 1px solid #ecebf2; }
.v4-executor-candidates h4 { margin: 0 0 .35rem; color: #5f596d; font-size: .76rem; }
.v4-runtime-gate { display: grid; gap: .35rem; border-style: dashed; background: #f8f7fb; }
.v4-runtime-gate strong { font-size: .88rem; }
.v4-runtime-gate span { color: #5f596d; font-size: .76rem; line-height: 1.55; }
.v4-runtime-gate small { color: #765d2e; font-size: .7rem; font-weight: 700; }
.v4-runtime-dialog { width: min(52rem, calc(100vw - 2rem)); max-height: min(48rem, calc(100vh - 2rem)); padding: 0; overflow: auto; border: 0; border-radius: 1rem; background: transparent; box-shadow: 0 24px 80px rgba(34, 27, 70, .3); }
.v4-runtime-dialog::backdrop { background: rgba(31, 27, 55, .38); backdrop-filter: blur(2px); }
.v4-runtime-dialog .v4-runtime-editor { margin: 0; border: 0; border-radius: 1rem; background: var(--v4-surface); }
.v4-model-discovery { display: grid; gap: .65rem; margin: .95rem 0; padding: .85rem; border: 1px solid #e3def2; border-radius: .75rem; background: #fbfaff; }
.v4-model-discovery legend { padding: 0 .3rem; color: #4e4665; font-size: .78rem; font-weight: 700; }
.v4-model-discovery p { margin: 0; color: var(--v4-muted); font-size: .74rem; line-height: 1.5; }
.v4-model-discovery label { display: grid; gap: .3rem; color: #575265; font-size: .74rem; }
.v4-model-discovery select { width: 100%; min-width: 0; padding: .5rem .56rem; border: 1px solid #dcd8e7; border-radius: .52rem; background: #fff; color: inherit; font: inherit; }
.v4-library-collapsible { display: block; margin-top: .5rem; border-top: 1px solid #ecebf2; }
.v4-library-collapsible > summary { cursor: pointer; padding: .78rem 0; color: var(--v4-lilac-deep); font-size: .78rem; font-weight: 730; }
.v4-library-collapsible > summary:focus-visible { outline: 3px solid rgba(107, 74, 221, .38); outline-offset: 3px; border-radius: .35rem; }
.v4-console-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.v4-console-form-grid label { display: grid; gap: .3rem; color: #575265; font-size: .74rem; }
.v4-console-form-grid input, .v4-console-form-grid select, .v4-console-form-grid textarea { min-width: 0; box-sizing: border-box; padding: .5rem .56rem; border: 1px solid #dcd8e7; border-radius: .52rem; background: #fff; color: inherit; font: inherit; }
.v4-console-form-grid .v4-check { display: flex; align-items: center; gap: .46rem; padding-top: .3rem; }
.v4-console-form-grid .v4-check input { min-width: auto; padding: 0; }
.v4-console-wide { grid-column: 1 / -1; }
.v4-runtime-profile { display: grid; gap: .7rem; margin: .95rem 0; padding: .85rem; border: 1px solid #e3def2; border-radius: .75rem; }
.v4-runtime-profile legend { padding: 0 .3rem; color: #4e4665; font-size: .78rem; font-weight: 700; }
.v4-operator-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.v4-operator-grid article { display: grid; gap: .4rem; min-height: 6rem; padding: 1rem; border: 1px solid #ebe9ef; border-radius: .85rem; background: #fbfbfd; color: #5c5e70; font-size: .82rem; line-height: 1.5; }
.v4-log-output { max-height: 27rem; margin: 1rem 0 0; padding: 1rem; overflow: auto; border: 1px solid #e6e3ed; border-radius: .8rem; background: #272438; color: #dcd9ec; font: .72rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.v4-note { color: var(--v4-muted); font-size: .8rem; line-height: 1.55; }

/* QQ research pilot: one group, explicit runtime states, body-free audit. */
.v4-group-research { display: grid; gap: 1rem; max-width: 66rem; padding: 1.25rem; border: 1px solid var(--v4-line); border-radius: 1.2rem; background: var(--v4-surface); box-shadow: var(--v4-shadow); }
.v4-group-research header { max-width: 48rem; }
.v4-group-research header p, .v4-research-audit > p { margin: 0 0 .45rem; color: var(--v4-lilac-strong); font-size: .69rem; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.v4-group-research h2, .v4-research-audit h3 { margin: 0; letter-spacing: -.025em; }
.v4-group-research header > span, .v4-research-audit > p, .v4-research-form > p { display: block; margin-top: .42rem; color: var(--v4-muted); font-size: .8rem; line-height: 1.55; }
.v4-research-state { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin: 0; }
.v4-research-state > div { padding: .75rem .85rem; border: 1px solid #e6e1f4; border-radius: .78rem; background: #faf8ff; }
.v4-research-state dt { color: var(--v4-muted); font-size: .7rem; }
.v4-research-state dd { margin: .28rem 0 0; color: var(--v4-ink); font-size: .82rem; font-weight: 740; }
.v4-research-form { display: grid; gap: .72rem; padding: 1rem; border: 1px solid #e3dcf8; border-radius: .95rem; background: linear-gradient(145deg, #fbfaff, #f4f0ff); }
.v4-research-form > label:not(.v4-check), .v4-research-limits label { display: grid; gap: .32rem; color: #5d5b70; font-size: .76rem; font-weight: 650; }
.v4-research-form select, .v4-research-form input[type="number"] { width: 100%; min-width: 0; padding: .55rem; border: 1px solid #ddd8eb; border-radius: .58rem; background: #fff; color: var(--v4-ink); }
.v4-research-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.v4-research-form > p { margin: 0; }
.v4-research-audit { display: grid; gap: .45rem; }
.v4-research-run { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .72rem 0; border-top: 1px solid #eceaf2; }
.v4-research-run strong, .v4-research-run span, .v4-research-run small { display: block; }
.v4-research-run strong { font-size: .82rem; }
.v4-research-run span, .v4-research-run small { margin-top: .22rem; color: var(--v4-muted); font-size: .71rem; line-height: 1.45; }
.v4-research-run small { margin-top: 0; text-align: right; }

/* Settings and login */
.v4-settings-layout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.v4-settings-layout > section { display: grid; align-content: start; gap: .7rem; min-height: 16rem; padding: 1.1rem; border: 1px solid var(--v4-line); border-radius: 1rem; background: var(--v4-surface); box-shadow: 0 8px 24px rgba(45, 32, 90, .04); }
.v4-settings-layout section > p { margin: 0; color: var(--v4-lilac-strong); font-size: .69rem; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.v4-settings-layout h2 { margin: 0 0 .25rem; font-size: 1rem; }
.v4-settings-layout label { display: grid; gap: .35rem; color: #605f71; font-size: .77rem; }
.v4-settings-layout input:not([type="checkbox"]), .v4-settings-layout select { width: 100%; padding: .55rem; border: 1px solid #dedce6; border-radius: .58rem; background: #fff; }
.v4-settings-layout input[type="range"] { accent-color: var(--v4-lilac-strong); }
.v4-check { display: flex !important; align-items: center; gap: .55rem; }
.v4-settings-layout > .v4-inline-actions { grid-column: 1 / -1; }
.v4-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 25rem); align-items: center; gap: 6rem; padding: 8vw; background: radial-gradient(circle at 16% 16%, #e8ddff, transparent 25rem), radial-gradient(circle at 92% 78%, #fde8f1, transparent 25rem), var(--v4-page); }
.v4-login-copy { max-width: 38rem; }
.v4-login-copy h1 { margin: .18em 0; font-size: clamp(3.6rem, 8vw, 7rem); line-height: .92; letter-spacing: -.085em; }
.v4-login-copy > p { color: var(--v4-lilac-strong); font-size: .84rem; font-weight: 750; }
.v4-login-copy > span:last-child { color: var(--v4-muted); line-height: 1.65; }
.v4-orb { display: block; width: 3.8rem; height: 3.8rem; border: 1px solid rgba(255, 255, 255, .82); border-radius: 1.35rem; background: linear-gradient(135deg, #f6eefe, #cfc1ff); box-shadow: 0 18px 42px rgba(91, 59, 179, .2); }
.v4-login-card { display: grid; gap: .75rem; padding: 1.5rem; border: 1px solid rgba(231, 228, 241, .9); border-radius: 1.3rem; background: rgba(255, 255, 255, .78); box-shadow: 0 24px 75px rgba(52, 38, 100, .1); backdrop-filter: blur(15px); }
.v4-login-card h2 { margin: 0; font-size: 1.25rem; }
.v4-login-card label { color: #5b5c6d; font-size: .8rem; }
.v4-login-card input { min-width: 0; padding: .68rem; border: 1px solid #dddae7; border-radius: .65rem; background: #fff; }
.v4-login-card p { min-height: 1.2rem; margin: 0; color: var(--v4-muted); font-size: .78rem; }

:root[data-v4-theme="dark"] { color-scheme: dark; --v4-ink: #ecebf5; --v4-muted: #aeacbd; --v4-line: #343245; --v4-page: #1d1c27; --v4-surface: rgba(40, 39, 53, .86); --v4-surface-strong: #292835; }
:root[data-v4-theme="dark"] .v4-sidebar, :root[data-v4-theme="dark"] .v4-topbar { background: rgba(30, 29, 40, .78); }
:root[data-v4-theme="dark"] .v4-primary { border-color: #947bfa; }
:root[data-v4-theme="dark"] .v4-secondary, :root[data-v4-theme="dark"] .v4-add, :root[data-v4-theme="dark"] .v4-local-nav, :root[data-v4-theme="dark"] .v4-local-nav button[aria-current="true"], :root[data-v4-theme="dark"] .v4-local-nav button[aria-current="page"], :root[data-v4-theme="dark"] .v4-admission-list > div, :root[data-v4-theme="dark"] .v4-artifact-columns section, :root[data-v4-theme="dark"] .v4-settings-layout input:not([type="checkbox"]), :root[data-v4-theme="dark"] .v4-settings-layout select { background: #2a2937; color: var(--v4-ink); }
:root[data-v4-theme="dark"] .v4-runtime-nav, :root[data-v4-theme="dark"] .v4-runtime-gate { background: #242330; }
:root[data-v4-theme="dark"] .v4-runtime-nav button[aria-current="page"], :root[data-v4-theme="dark"] .v4-runtime-summary article, :root[data-v4-theme="dark"] .v4-executor-sections > section, :root[data-v4-theme="dark"] .v4-runtime-toolbar input { background: #2a2937; color: var(--v4-ink); }
:root[data-v4-density="compact"] .v4-page { padding-top: 2rem; }
:root[data-v4-density="compact"] .v4-work-item, :root[data-v4-density="compact"] .v4-plan-item, :root[data-v4-density="compact"] .v4-delivery-item { padding-top: .65rem; padding-bottom: .65rem; }
:root[data-v4-motion="reduced"] *, :root[data-v4-motion="reduced"] *::before, :root[data-v4-motion="reduced"] *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }

@media (max-width: 1080px) {
  .v4-chat-workspace { grid-template-columns: 13rem minmax(0, 1fr); }
  .v4-chat-context-rail { display: none; }
  .v4-project-board, .v4-settings-layout, .v4-now-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-runtime-summary { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .v4-app { grid-template-columns: 1fr; }
  .v4-sidebar { position: sticky; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: .5rem; padding: .65rem; overflow-x: auto; }
  .v4-sidebar .v4-presence { min-width: max-content; }
  #v4Navigation { display: flex; }
  #v4Navigation button { min-width: max-content; }
  .v4-quiet { margin: 0 0 0 auto; min-width: max-content; }
  .v4-topbar { height: 3.75rem; padding: 0 .8rem; }
  .v4-topbar-actions > span { display: none; }
  .v4-attention-panel { right: .5rem; }
  .v4-page { padding: 2rem 1rem 3rem; }
  .v4-memory-layout, .v4-profile-layout, .v4-admission-layout, .v4-artifact-layout, .v4-now-grid { grid-template-columns: 1fr; }
  .v4-qq-conversation-layout, .v4-chat-workspace { grid-template-columns: 1fr; }
  .v4-thread-list, .v4-chat-rail { max-height: 14rem; overflow: auto; border-right: 0; border-bottom: 1px solid var(--v4-line); }
  .v4-chat-context-rail { display: block; border-top: 1px solid var(--v4-line); border-left: 0; }
  .v4-admission-list, .v4-artifact-columns, .v4-profile-editor, .v4-project-board, .v4-settings-layout, .v4-operator-grid, .v4-research-state, .v4-research-limits, .v4-ambient-window-fields, .v4-ambient-window-grid, .v4-console-form-grid { grid-template-columns: 1fr; }
  .v4-role-binding article { grid-template-columns: 1fr; }
  .v4-delivery-intro, .v4-artifact-detail > header, .v4-revise > div { align-items: flex-start; flex-direction: column; }
  .v4-truth-note { max-width: none; text-align: left; }
  .v4-delivery-item, .v4-work-item, .v4-plan-item, .v4-group-policy, .v4-approval, .v4-today-action, .v4-today-active { grid-template-columns: 1fr; }
  .v4-approval-review dl { grid-template-columns: 1fr; }
  .v4-delivery-item > div:last-child { justify-items: start; text-align: left; }
  .v4-login { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 1.2rem; }
  .v4-now-presence { align-items: flex-start; flex-wrap: wrap; }
  .v4-now-presence .v4-secondary { margin-left: 0; }
  .v4-now-item { grid-template-columns: 1fr; }
  .v4-now-item strong, .v4-now-item p, .v4-now-item small { white-space: normal; }
  .v4-research-run { align-items: flex-start; flex-direction: column; }
  .v4-research-run small { text-align: left; }
  .v4-page-head h1 { letter-spacing: normal; }
  .v4-runtime-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v4-runtime-toolbar { align-items: stretch; flex-direction: column; }
  .v4-runtime-toolbar label { flex: 0 0 auto; max-width: none; }
  .v4-runtime-pagination { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .v4-sidebar, .v4-topbar, .v4-now-presence, .v4-now-section, .v4-qq-conversation-layout, .v4-chat-workspace, .v4-object-inspector { border: 1px solid CanvasText; background: Canvas; color: CanvasText; box-shadow: none; }
  .v4-primary, .v4-secondary, .v4-thread, .v4-trace-message { forced-color-adjust: auto; border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
  .v4-thread.selected, .v4-chat-thread.selected, .v4-local-nav button[aria-current="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
