/* Native title strip and persistent workspace panes. */
:root {
  color: #e9ebed;
  background: #151719;
  --bg: #151719;
  --sidebar: #191b1e;
  --panel: #1a1d20;
  --raised: #23272b;
  --inset: #151719;
  --hover: #292e33;
  --line: #2b3034;
  --line-strong: #3b4349;
  --text: #edf0f2;
  --subtle: #c2c9ce;
  --muted: #9da7af;
  --dim: #8a959e;
  --accent: #a6c8e0;
  --accent-panel: #222e37;
  --accent-line: #415767;
  --blue: #adcce3;
  --green: #a1d4ba;
  --amber: #e8c697;
  --radius: 9px;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
body { line-height: 1.55; }
::selection { background: #3b566a; }

.desktop-shell,
.desktop-shell.has-group-chat {
  --titlebar-height: 34px;
  --side-width: clamp(170px, var(--sidebar-user-width, 264px), max(170px, 23vw));
  --chat-width: clamp(250px, var(--group-chat-width, 390px), max(250px, 30vw));
  display: grid;
  grid-template: var(--titlebar-height) minmax(0,1fr) / var(--side-width) 4px minmax(0,1fr);
  height: 100dvh;
  min-height: 0;
  background: var(--bg);
}
.desktop-shell.has-group-chat {
  grid-template-columns: var(--side-width) 4px minmax(0,1fr) 4px var(--chat-width);
}
.window-strip {
  grid-area: 1 / 1 / 2 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid #ffffff0b;
  background: linear-gradient(#202327, #1c1f22);
  user-select: none;
}
.desktop-shell.native-shell { --titlebar-height: 0px; }
.native-shell .window-strip { display: none; }
.window-wordmark, .window-strip-state { display: inline-flex; align-items: center; gap: 6px; }
.window-wordmark { color: #edf0f2; font-size:calc(12px * var(--ui-scale, 1)); font-weight: 650; letter-spacing: .015em; }
.window-wordmark .product-mark { width: 15px; height: 15px; }
.window-strip-state { color: #a2acb4; font-size:calc(10.5px * var(--ui-scale, 1)); }
.window-strip-state i { width: 5px; height: 5px; border-radius: 50%; background: #a2acb4; }

[data-sidebar-slot] { grid-area: 2 / 1; min-width: 0; min-height: 0; }
[data-chat-slot] { display: contents; }
.desktop-shell .sidebar-resizer, .desktop-shell .group-resizer { grid-row: 2; background: transparent; }
.desktop-shell .sidebar-resizer::after, .desktop-shell .group-resizer::after { left: 1px; background: #ffffff0d; }
.desktop-shell :is(.sidebar-resizer, .group-resizer):is(:hover, :focus-visible),
.resizing-sidebar .desktop-shell .sidebar-resizer, .resizing-group .desktop-shell .group-resizer { background: #7da9c029; }
.desktop-shell .group-resizer[hidden] { display: none; }

.desktop-shell.native-shell .sidebar, .desktop-shell .sidebar {
  height: 100%;
  padding: 14px 11px 8px;
  background: linear-gradient(155deg, #25292e30, transparent 220px), var(--sidebar);
  border: 0;
}
.workspace-identity {
  display: block;
  margin: 2px 0 13px;
  padding: 0 8px;
  color: #bac3c9;
  font-size:calc(11px * var(--ui-scale, 1));
  font-weight: 550;
  line-height: 1.4;
}
.desktop-shell .nav-label { padding: 10px 8px 4px; color: #87939d; font-size:calc(10.5px * var(--ui-scale, 1)); }
.desktop-shell .nav-item {
  min-height: 32px;
  margin: 1px 0;
  padding: 5px 8px;
  border-color: transparent;
  border-radius: 6px;
  font-size:calc(12.5px * var(--ui-scale, 1));
  font-weight: 470;
}
.desktop-shell .nav-item svg { width: 16px; height: 16px; }
.desktop-shell .nav-item.active {
  color: var(--text);
  border-color: transparent;
  background: #ffffff0e;
}
.desktop-shell .nav-item.active svg { color: #b9d7e8; }
.desktop-shell .sidebar-workspace { margin-top: 11px; border-color: #ffffff0e; }
.desktop-shell .sidebar-bottom { padding-top: 8px; }
.desktop-shell .local-card { display: none; }
.workspace-link, .workspace-agent-row a { min-height: 28px; color: #adb8c0; }
.workspace-agent-row.org-depth-0 { --tree-tone: #d7b585; }
.workspace-agent-row.org-depth-1 { --tree-tone: #a4c8e2; }
.workspace-agent-row.org-depth-2 { --tree-tone: #9fc9bd; }
.workspace-agent-row a svg { color: var(--tree-tone, #a1acb4); }

.desktop-shell .content {
  grid-area: 2 / 3;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}
[data-workspace-header], [data-workspace-review], [data-workspace-dock] { flex: none; }
.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 4px 14px;
  gap: 8px;
  background: #181a1d;
  border-bottom: 1px solid #ffffff0e;
}
.workspace-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size:calc(12px * var(--ui-scale, 1)); color: #a9b3bb; }
.workspace-crumb i { color: #646d75; font-style: normal; }
.workspace-crumb span { white-space: nowrap; }
.workspace-crumb strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dce3e7; font-weight: 520; }
.workspace-controls { flex: 0 0 auto; }
.chrome-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; padding: 3px 8px; border-radius: 6px; font-size:calc(12px * var(--ui-scale, 1)); }
.chrome-button svg { width: 15px; height: 15px; }
.chrome-button.subtle { color: #a9b4bc; }
.chrome-button.subtle:hover { background: #ffffff0c; color: var(--text); }
.chrome-button.return-chat { background: #daebf5; color: #14232c; font-weight: 650; }
.chrome-button.return-chat:hover { background: white; }
.chrome-button.return-chat b { min-width: 16px; padding: 0 4px; border-radius: 4px; background: #aacae0; text-align: center; font-size:calc(10px * var(--ui-scale, 1)); }
.desktop-shell.native-shell .main, .desktop-shell .main {
  min-height: 0;
  height: auto;
  padding: 22px clamp(16px, 2.25vw, 34px) 32px;
  scrollbar-gutter: auto;
}
.desktop-shell .main > .page-heading { align-items: center; margin-bottom: 19px; }
.desktop-shell .main > .page-heading h1 { font-size:calc(25px * var(--ui-scale, 1)); font-weight: 630; letter-spacing: -.028em; }
.desktop-shell .main > .page-heading p { margin-top: 5px; font-size:calc(13px * var(--ui-scale, 1)); color: var(--muted); }
.desktop-shell .content:has(.project-ide) .main { padding: 0; }
.desktop-shell .panel { background: var(--panel); box-shadow: none; }
.desktop-shell .panel-head { border-color: #ffffff0d; }
.desktop-shell .button { min-height: 32px; border-radius: 6px; font-size:calc(12px * var(--ui-scale, 1)); }
.desktop-shell .button.small { min-height: 27px; }
.desktop-shell .button.primary { background: #dae5ed; border-color: #dae5ed; color: #171d22; box-shadow: none; }
.desktop-shell .button.primary:hover { background: #eff5fa; }
.desktop-shell .review-button { background: #eac691; border-color: #eac691; color: #282015; }
.desktop-shell .mission-table th { background: #191c1f; border-color: #ffffff12; color: #a8b2ba; }
.desktop-shell .mission-table td { border-color: #ffffff0b; padding-block: 11px; font-size:calc(12.5px * var(--ui-scale, 1)); }
.desktop-shell .mission-table tr:hover td { background: #ffffff05; }
.desktop-shell .mission-table .task-title { font-weight: 560; }
.desktop-shell .mission-table .subline { color: #929da6; }
.desktop-shell .filter.active { background: #2a3239; border-color: #343f48; }
.desktop-shell .review-shelf { margin-top: 8px; }
.desktop-shell .review-shelf.in-chat { margin-inline: 12px; }

.desktop-shell.native-shell .group-chat, .desktop-shell .group-chat {
  grid-area: 2 / 5;
  padding-top: 0;
  background: linear-gradient(150deg,#22262b40, transparent 260px), #191b1e;
}
.group-chat-header { min-height: 44px; padding: 4px 12px 4px 14px; }
.group-chat-controls .icon-button { width: 26px; height: 26px; }
.group-chat-context { padding-inline: 15px; min-height: 34px; }
.group-chat-scroll { position: relative; padding: 15px 12px 20px; overflow-anchor: none; }
.group-turn, .group-turn.own {
  display: grid;
  grid-template-columns: 25px minmax(0,1fr);
  align-items: start;
  gap: 9px;
  padding: 5px 7px 6px 5px;
  margin: 0 0 17px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.group-turn:last-child { margin-bottom: 2px; }
.group-avatar { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: #262c31; color: #b6c4ce; }
.group-avatar svg { width: 14px; height: 14px; }
.group-turn.own .group-avatar { background: #30414c; color: #d4e7f5; }
.group-turn-body { min-width: 0; }
.group-turn-head { min-height: 23px; align-items: baseline; gap: 6px; font-size:calc(12px * var(--ui-scale, 1)); }
.group-turn-head strong { font-weight: 620; color: #e2e7eb; }
.group-turn-head time { color: #97a3aa; }
.group-turn-head .recipient { color: #a9cfe6; font-weight: 540; }
.group-turn p {
  margin: 2px 0 0;
  color: #d3dbe0;
  font-size:calc(13px * var(--ui-scale, 1));
  line-height: 1.6;
}
.group-turn.own p { width: fit-content; max-width: 100%; padding: 6px 10px; border-radius: 7px; background: #25323d; color: #e4edf3; }
.group-event-kind { margin-top: 1px; color: #9caebc; }
.group-turn.is-new { animation: group-arrival 2s both; animation-delay: var(--arrival-delay, 0ms); }
@keyframes group-arrival {
  0%, 18% { background-color: #304957; box-shadow: inset 2px 0 #b2d9f2; }
  100% { background-color: transparent; box-shadow: inset 2px 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .group-turn.is-new { animation-timing-function: steps(1,end); }
}
.chat-new-messages {
  align-self: center;
  margin: 2px 0 8px;
  min-height: 27px;
  padding: 3px 10px;
  border: 1px solid #496579;
  border-radius: 6px;
  background: #253947;
  color: #d1e7f5;
  font-size:calc(11px * var(--ui-scale, 1));
}
.group-chat-form {
  margin: 0 12px 13px;
  border-color: #354049;
  background: #20252a;
}
.group-chat-form:focus-within { border-color: #6a899e; }
.group-chat-form textarea { min-height: 75px; padding: 10px 11px; }
.group-chat :is(select, .group-chat-context select) { background: #252b30; }
.group-chat-form-actions { padding: 4px 7px 7px; }

.organization-panel .org-tree {
  --node-width: 134px;
  --domain-card-width: var(--node-width);
  --branch-gap: 10px;
  --connector: 15px;
  --management-track: calc(3 * var(--node-width) + 2 * var(--branch-gap));
  --domains-track: calc(5 * var(--node-width) + 4 * var(--branch-gap));
  --tree-line: #647684;
  background-color: #16191c;
  background-image: radial-gradient(circle, #a2b6c321 .65px, transparent .85px);
  padding: 22px 17px 24px;
}
.organization-panel .org-root {
  width: max(100%, 1150px);
  margin-inline: auto;
}
.organization-panel .org-root:has(> .org-children[hidden]) { width: 100%; min-width: 0; }
.organization-panel .org-coordination,
.organization-panel .org-root:has(.org-domains:not([hidden])) > .org-coordination {
  grid-template-columns: minmax(var(--management-track),3fr) minmax(var(--domains-track),5fr);
}
.organization-panel .org-coordination > .org-node > .org-node-card { width: min(100%,242px); margin-inline: auto; }
.organization-panel .org-management {
  display: grid;
  grid-template-columns: repeat(3, minmax(var(--node-width), 1fr));
  gap: var(--branch-gap);
  padding: calc(2 * var(--connector)) 0 0;
  margin: 0;
  border: 0 !important;
}
.organization-panel .org-management[hidden] { display: none; }
.organization-panel .org-management::before {
  position: absolute;
  left: 50%;
  top: 0;
  height: var(--connector);
  border-left: 1px solid var(--tree-line);
  content: '';
}
.organization-panel .org-management::after {
  position: absolute;
  inset: var(--connector) calc((100% - 2 * var(--branch-gap)) / 6) auto;
  border-top: 1px solid var(--tree-line);
  content: '';
}
.organization-panel .org-management > .org-node::before {
  left: 50%;
  top: calc(-1 * var(--connector));
  width: 0;
  height: var(--connector);
  border-left: 1px solid var(--tree-line);
  border-top: 0;
}
.organization-panel .org-node {
  --role-icon: #a4b0ba;
  --role-edge: #39444b;
  --role-top: #23282c;
  --role-bottom: #1c2024;
}
.organization-panel .org-depth-0 {
  --role-icon: #e6c28c;
  --role-edge: #896d49;
  --role-top: #3a2f21;
  --role-bottom: #28221c;
}
.organization-panel .org-depth-1 {
  --role-icon: #a8d2ed;
  --role-edge: #4d718b;
  --role-top: #243b4d;
  --role-bottom: #1b2733;
}
.organization-panel .org-depth-2 {
  --role-icon: #a4d1c4;
  --role-edge: #48736b;
  --role-top: #243e38;
  --role-bottom: #1b2b28;
}
.organization-panel .org-node > .org-node-card {
  --role-icon: inherit;
  border-color: var(--role-edge);
  background: linear-gradient(148deg,var(--role-top),var(--role-bottom));
  border-radius: 8px;
}
.organization-panel .org-node > .org-node-card :is(.org-node-main, .org-toggle) > svg { color: var(--role-icon); }
.organization-panel .org-node-main { padding: 9px; gap: 6px; }
.organization-panel .org-node-main strong { font-size:calc(12.5px * var(--ui-scale, 1)); }
.organization-panel .org-node-main .org-node-duty { color: #bec9ce; line-height: 1.38; }
.organization-panel .org-specialists { gap: 7px; }
.organization-panel .org-node.org-participant > .org-node-card {
  border-color: color-mix(in srgb, var(--role-icon), white 18%);
  box-shadow: inset 0 0 0 1px #c2e4f020;
}
.organization-panel .org-participant-label { color: #cee6f2; }
.organization-panel .org-node-card:hover { filter: brightness(1.12); }

@media (max-width: 890px) {
  .desktop-shell.has-group-chat { grid-template-columns: var(--side-width) 4px minmax(0,1fr); }
  .desktop-shell .group-chat {
    inset: var(--titlebar-height) 0 0 auto;
    width: min(84vw, var(--group-chat-width));
    height: auto;
  }
}
@media (max-width: 560px) {
  .desktop-shell, .desktop-shell.has-group-chat { grid-template-columns: 45px 0 minmax(0,1fr); }
  .desktop-shell.native-shell .sidebar, .desktop-shell .sidebar { padding-inline: 3px; }
  .workspace-identity { display: none; }
  .workspace-crumb i, .workspace-crumb strong { display: none; }
}
