header,.row,.controls { display:flex; align-items:center; flex-wrap:wrap; gap:.85rem; }
header,.row { justify-content:space-between; }
.brand { font-weight:700; }
button,summary { cursor:pointer; }
.list,.login label { display:grid; }
.task { display:block; width:100%; padding:14px; text-align:left; }
.task strong,.task small { display:block; }
.tag { display:inline-block; }
.flow { border-left:3px solid; padding-left:1rem; }
dl { display:grid; grid-template-columns:max-content minmax(0,1fr); }
dd { margin:0; }
.wrap,code,dd,.task,.panel,.message { overflow-wrap:anywhere; }
.message,#chat-draft { white-space:pre-wrap; }
.detail { white-space:pre-line; }
#chat-draft { display:block; width:100%; margin:.4rem 0 .75rem; resize:vertical; }
button.link { border:0; background:none; text-decoration:underline; }
#loading { padding:2rem; }
:root {
  color-scheme: light;
  font: 15px/1.52 "Segoe UI", system-ui, sans-serif;
  --ink: #162c3a;
  --muted: #526672;
  --edge: #d5dee2;
  --paper: #fff;
  --canvas: #f5f7f8;
  --rail: #152c38;
  --rail-ink: #deeaee;
  --mint: #a8eaca;
  --green: #18684e;
  --mono: "Cascadia Code", Consolas, monospace;
  --rail-width: 223px;
  color: var(--ink);
  background: var(--canvas);
  accent-color: var(--green);
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: var(--canvas); caret-color: var(--green); }
::selection { color: #09291d; background: #b9f0d5; }
a, button.link { color: #126445; text-decoration-thickness: 1px; text-underline-offset: .2em; }
:where(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid #2878a8 !important; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
input, select, textarea { font-size: 1rem; font-weight: 400; }
button, input, select, #chat-draft, textarea { border: 1px solid #bdcbd1; border-radius: 6px; }
button { background: #fff; color: #183746; font-size: 14px; font-weight: 600; padding: 7px 13px; min-height: 36px; }
button:hover { background: #eaf2ee; border-color: #8aa99c; }
button.primary, button[aria-current=page] { color: white; background: #19634e; border-color: #19634e; }
button:disabled { opacity: .58; cursor: default; }
input, select, textarea, #chat-draft { max-width: 100%; background: white; padding: .65rem .8rem; color: var(--ink); }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.17; font-weight: 690; letter-spacing: -.039em; text-wrap: balance; }
h2 { font-size: 20px; line-height: 1.35; font-weight: 650; letter-spacing: -.025em; }
h3 { font-size: 16px; font-weight: 650; }
p { margin-block: .45rem; }
main > h1, main > .row:first-child { margin-bottom: 28px; }
main > h2 { margin: 31px 0 12px; }
.meta,.muted,dt,.task small { color: var(--muted); }
.meta { font-size: 13px; }
.shell { max-width: none; margin: 0; padding: 0; min-height: 100vh; }
.shell:has(> nav) { padding-left: var(--rail-width); }
.shell > header { min-height: 65px; padding: 0 clamp(24px,4.1vw,66px); flex-wrap: nowrap; border-bottom: 1px solid var(--edge); background: #fff; }
header .brand { display: flex; align-items: center; gap: 8px; font-size: 19px; letter-spacing: -.04em; }
header .brand b { color: var(--green); }
.shell:has(> nav) > header .brand { display: none; }
header .controls { display: flex; flex-wrap: nowrap; width: 100%; justify-content: space-between; margin: 0; }
header .meta { display: inline-flex; align-items: center; gap: 10px; overflow-wrap: anywhere; font-size: 14px; font-weight: 600; }
header .meta::before { content: ""; height: 14px; width: 16px; border: 1.5px solid #647b87; border-radius: 3px; background: linear-gradient(to bottom,transparent 30%,#647b87 30% 40%,transparent 40%); flex-shrink: 0; }
header button { min-height: 34px; font-size: 13px; }
.shell > main { width: 100%; max-width: 1456px; padding: 40px clamp(24px,4.1vw,66px) 64px; margin: 0 auto; }
.shell > nav { position: fixed; inset: 0 auto 0 0; width: var(--rail-width); height: 100dvh; display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; overflow-y: auto; gap: 3px; padding: 0 12px 18px; margin: 0; background: var(--rail); color: var(--rail-ink); z-index: 5; scrollbar-color: #456371 var(--rail); }
.dt-rail-brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; flex: 0 0 80px; }
.dt-brand-name { font-size: 24px; font-weight: 670; letter-spacing: -.04em; color: #f3f8f9; }
.dt-mark { width: 32px; height: 32px; padding: 4px; color: var(--rail); border-radius: 8px; background: var(--mint); stroke-width: 1.8; }
.shell > nav > button { flex: 0 0 auto; border: 1px solid transparent; border-radius: 7px; display: flex; width: 100%; align-items: center; text-align: left; gap: 12px; min-height: 42px; padding: 8px 13px; color: #d2dfe4; background: transparent; font-size: 14px; font-weight: 510; }
.shell > nav > button:hover { background: #213d4c; color: #fff; }
.shell > nav > button[aria-current=page],.shell[data-page=projects] nav button[data-key=projects] { background: var(--mint); color: #102d25; font-weight: 670; }
nav :focus-visible { outline-color: #fff !important; outline-offset: -3px !important; }
.dt-nav-icon { flex: 0 0 18px; width: 18px; height: 18px; }
nav [data-key=feedback] { margin-top: auto; }
nav [data-key=environments] { margin-bottom: 28px; }
.dt-menu,.dt-backdrop { display: none; }
.panel,article { margin: 0 0 12px; padding: 19px 21px; border: 1px solid var(--edge); border-radius: 9px; background: var(--paper); box-shadow: none; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel > h2 { margin-bottom: 9px; }
.controls { gap: 7px; margin: 9px 0; }
form label { display: grid; gap: 5px; margin: 10px 0; color: #405561; font-size: 14px; font-weight: 550; }
form label:has(input[type=checkbox]),form label:has(input[type=radio]) { display: flex; align-items: center; gap: 9px; }
form .controls { align-items: end; }
main > .error { margin-bottom: 16px; }
.error { color: #7f3029; background: #fff2ee; border-left: 3px solid #b24f3c; border-radius: 4px; }
main .flow { border-color: #94c3aa; }
main .flow summary { font-weight: 600; }
.list { gap: 0; border: 1px solid var(--edge); background: white; border-radius: 9px; overflow: clip; }
.list .task { width: 100%; padding: 16px 20px 19px; border: 0; border-radius: 0; border-bottom: 1px solid var(--edge); text-align: left; }
.list .task:last-child { border-bottom: 0; }
.list .task:focus-visible { outline-offset: -3px !important; }
.task .row { align-items: center; margin-bottom: 7px; }
.task .meta,.list .row .meta { color: #48616e; font: 600 12px/1.4 var(--mono); }
.task strong { font-size: 17px; font-weight: 650; line-height: 1.45; letter-spacing: -.012em; }
.task small { font-size: 14px; font-weight: 400; margin-top: 4px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 5px; color: #2a5a49; background: #e5f1e9; }
.tag[data-tone=wait] { background: #fbefd5; color: #715015; }
.tag[data-tone=work] { background: #e2edf8; color: #35587a; }
.tag[data-tone=neutral] { background: #edf0f3; color: #4b5c67; }
.tag[data-tone=issue] { background:#fae6df; color:#853e2e; }
dl { gap: .4rem 1rem; }
.login { width: min(100%,410px); max-width: 410px; margin: 11vh auto; padding: 28px; }
.login h1 { font-size: 29px; }
.login .primary { width: 100%; margin-top: 7px; }

.shell[data-page=team] main:has(> .dt-team-head) {
  display: grid; grid-template-columns: minmax(0,1.7fr) minmax(264px,1fr);
  column-gap: clamp(18px,2.2vw,36px); align-items: start;
}
.shell[data-page=team] main > * { min-width: 0; }
.shell[data-page=team] main > h1 { grid-column: 1 / -1; grid-row: 1; margin-bottom: 31px; }
.shell[data-page=team] main > .error { grid-column: 1 / -1; grid-row: auto; }
.dt-team-head { grid-column: 1; grid-row: 2; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 12px; }
.dt-team-head h2 { font-size: 19px; }
.dt-team-head small { color: var(--muted); font-size: 13px; }
.dt-overview {
  grid-column: 2; grid-row: 2 / span 6; align-self: start;
  background: #203e49; color: #f3f8f7;
  padding: clamp(20px,2.2vw,31px); border-radius: 12px; min-width: 0;
}
.dt-stat-label { display: block; font-weight: 550; font-size: 16px; color: #e2eff0; }
.dt-stat-number { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 18px; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.dt-stat-value { font-size: clamp(40px,4vw,58px); font-weight: 630; color: #c6f8dc; }
.dt-stat-total { font-size: 26px; font-weight: 450; color: #b5ced3; }
.dt-machines { display: grid; gap: 0; border-top: 1px solid #48616a; padding-top: 12px; }
.dt-machine { overflow-wrap: anywhere; font: 550 13px/1.4 var(--mono); color: #ecf4f3; }
.dt-device-line { display:flex; align-items:center; gap:8px; padding:6px 0; cursor:pointer; list-style:none; border-radius:3px; }
.dt-device-line::-webkit-details-marker { display:none; }
.dt-device-line::before { content:""; border: solid currentColor; border-width:0 1.5px 1.5px 0; width:5px; height:5px; transform:rotate(-45deg); margin:0 4px 0 2px; }
.dt-machine[open] > summary::before { transform:rotate(45deg); }
.dt-device-line:hover .dt-host { text-decoration:underline; text-underline-offset:3px; }
.dt-presence { margin-left:auto; font-variant-numeric:tabular-nums; font-size:12px; color:var(--mint); }
.dt-machine.is-partial .dt-presence { color:#f4d49c; }
.dt-device-sessions { border-left:1px solid #647d82; margin:1px 0 4px 5px; padding:0 0 0 14px; list-style:none; }
.dt-device-session { display:flex; align-items:baseline; gap:7px; padding:3px 0; font:500 12px/1.5 "Segoe UI",sans-serif; color:#d2e2e6; }
.dt-presence-state { margin-left:auto; color:var(--mint); font-size:11px; }
.is-offline .dt-presence-state { color:#f4d49c; }
.dt-role { grid-column: 1; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; grid-template-rows: auto auto; gap: 0 12px; align-items: center; min-height: 64px; padding: 10px 15px; margin: 0; border-radius: 0; border-bottom: 0; }
.dt-role[data-role=chief] { grid-row: 3; border-radius: 8px 8px 0 0; }
.dt-role[data-role=planner] { grid-row: 4; }
.dt-role[data-role=worker] { grid-row: 5; }
.dt-role[data-role=spec] { grid-row: 6; }
.dt-role[data-role=quality] { grid-row: 7; border-bottom: 1px solid var(--edge); border-radius: 0 0 8px 8px; }
.dt-role h2 { grid-column: 2; grid-row: 1; margin: 0; font-size: 15px; line-height: 1.35; letter-spacing: -.008em; }
.dt-role > strong,.dt-role > p:not([role=status]) { grid-column: 2; grid-row: 2; color: #536671; font-size: 13px; font-weight: 450; margin: 0; line-height: 1.5; }
.dt-role > p[role=status] { grid-column: 2 / -1; color: #815714; font-size: 13px; }
.dt-role-symbol { grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; height: 34px; width: 34px; border-radius: 8px; font: 650 15px var(--mono); color: #31506c; background: #e7eef5; }
[data-role=chief] .dt-role-symbol { background: #dcefe5; color: #24513f; }
[data-role=worker] .dt-role-symbol { background: #fbebdc; color: #785432; }
[data-role=spec] .dt-role-symbol { background: #eee9f7; color: #65517d; }
[data-role=quality] .dt-role-symbol { background: #e3eef0; color: #375d63; }
.dt-role-edit,.dt-form-toggle { grid-column: 3; grid-row: 1 / 3; font-size: 12px; font-weight: 600; min-height: 32px; padding: 4px 10px; }
.dt-role > .controls { grid-column: 1 / -1; padding-top: 8px; margin-bottom: 0; }
.dt-role > .controls:empty { display: none; }
.dt-form { grid-column: 1 / -1; margin: 10px 0 0; padding: 13px 16px; }
.dt-form:first-of-type { margin-top: 24px; }
.dt-form h2 { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 15px; margin: 0; }
.shell[data-page=team] main > h2,.shell[data-page=team] main > .dt-session,.shell[data-page=team] main > p,.shell[data-page=team] main > label { grid-column: 1 / -1; }
.dt-session > strong { font-size: 15px; }
.dt-session p, .dt-session li { font-size: 13px; }
.dt-session li { margin: 4px 0; }
.dt-session p { color: var(--muted); }
.dt-session ul { margin: 8px 0 0; padding-left: 21px; display: flex; flex-wrap: wrap; gap: 0 28px; }
@media(max-width:1090px) {
  :root { --rail-width: 196px; }
  .shell > main { padding-inline: 26px; }
  .shell > header { padding-inline: 26px; }
  .shell[data-page=team] main:has(> .dt-team-head) { grid-template-columns: minmax(0,1.5fr) minmax(215px,1fr); column-gap: 16px; }
  .dt-role { padding-inline: 10px; column-gap: 8px; }
}
@media(max-width:860px) and (min-width:761px) {
  :root { --rail-width: 180px; }
  .shell > main,.shell > header { padding-inline: 17px; }
  .shell > nav { padding-inline: 8px; }
  .shell > nav > button { gap: 8px; padding-inline: 8px; }
}
@media(max-width:760px) {
  .shell:has(> nav) { padding-left: 0; }
  .shell > header { min-height: 58px; gap: 10px; padding: 0 16px; }
  header .meta { font-size: 12px; gap: 7px; }
  header .controls { gap:6px; }
  .dt-menu { display: inline-grid; place-items: center; flex: 0 0 42px; min-height: 42px; padding: 8px; }
  .shell > nav { width: min(277px,82vw); transform: translateX(-101%); transition: transform .18s ease-out; z-index: 12; }
  .shell.dt-nav-open > nav { transform: translateX(0); }
  body:has(.shell.dt-nav-open) { overflow: hidden; }
  .dt-nav-open .dt-backdrop { position: fixed; inset: 0; z-index: 10; display: block; border-radius: 0; border: 0; width: 100%; height: 100%; background: rgb(13 31 42 / 55%); }
  .shell > main { padding: 23px 16px 40px; }
  h1 { font-size: 31px; }
  main > h1, main > .row:first-child,.shell[data-page=team] main > h1 { margin-bottom: 19px; }
  .shell[data-page=team] main:has(> .dt-team-head) { display: flex; flex-direction: column; align-items: stretch; }
  .dt-overview { padding: 16px 17px; display: grid; grid-template-columns: minmax(92px,.8fr) minmax(0,1.2fr); gap: 16px; align-items: center; width: 100%; margin-bottom: 22px; }
  .dt-stat-label { font-size: 13px; }
  .dt-stat-value { font-size: 35px; }
  .dt-stat-total { font-size: 20px; }
  .dt-stat-number { margin: 0; gap: 3px; }
  .dt-machines { border-top: 0; border-left: 1px solid #526a73; padding: 0 0 0 12px; }
  .dt-machine { font-size: 12px; }
  .dt-device-line { padding:6px 0; gap:4px; }
  .dt-device-sessions { margin-left:3px; padding-left:6px; }
  .dt-device-session { gap:3px; font-size:11px; }
  .dt-team-head { padding-bottom: 9px; }
  .dt-role { min-height: 62px; }
  .dt-role-edit,.dt-form-toggle { min-height: 38px; }
  .dt-form:first-of-type { margin-top: 16px; }
  .list .task { padding: 13px 14px; }
  .task .row { gap: 5px; }
  .panel,article { max-width: 100%; }
  .panel:not(.dt-role):not(.dt-form),article { padding: 15px; }
  .row > *,.controls > * { min-width: 0; }
  .dt-session ul { display: block; }
  dl { display: block; }
  dd { margin-bottom: 7px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition-duration: 0s !important; scroll-behavior: auto !important; } }

.shell[data-page=chat] > main { max-width: 1040px; }
.dt-chat {
  --chat-gutter: clamp(18px, 3vw, 38px);
  min-width: 0;
  border: 1px solid #cbd9d6;
  border-radius: 14px;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.dt-chat-room {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 13px;
  padding: 16px var(--chat-gutter);
}
.dt-chat-mark {
  display: grid;
  place-items: center;
  flex: 0 0 39px;
  height: 39px;
  border-radius: 10px;
  color: var(--mint);
  background: var(--rail);
}
.dt-chat-mark svg { width: 22px; height: 22px; }
.dt-chat-recipient { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 8px; min-width: 0; }
.dt-chat-recipient .dt-chat-endpoint { grid-column: 1 / -1; overflow-wrap: anywhere; }
.dt-chat-room label, .dt-chat-tools label, .dt-chat-composer label { color: #405b59; font-size: 13px; font-weight: 600; }
.dt-chat-endpoint { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.dt-chat-availability {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.dt-chat-availability::before { content: ""; flex: 0 0 7px; height: 7px; border-radius: 50%; background: #77878d; }
.dt-chat-availability[data-available=true] { color: var(--green); }
.dt-chat-availability[data-available=true]::before { background: #288662; }
.dt-chat-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  padding: 10px var(--chat-gutter);
  border-block: 1px solid var(--edge);
  background: #f8faf9;
}
.dt-chat-tools select { min-width: 0; max-width: min(100%, 32ch); }
.dt-chat-tools button { margin-inline-start: auto; }
.dt-chat-log {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-height: min(56vh, 680px);
  overflow: auto;
  overscroll-behavior-y: contain;
  padding: 20px var(--chat-gutter);
  scrollbar-color: #b2c7be transparent;
}
.dt-chat-empty { align-self: center; margin: 16px 0; color: var(--muted); text-align: center; }
.dt-chat-exchange { display: flex; flex-direction: column; gap: 9px; }
.dt-chat-turn {
  align-self: flex-start;
  min-width: 0;
  max-width: min(82%, 68ch);
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
}
.dt-chat-turn[data-side=owner] { align-self: flex-end; }
.dt-chat-stamp { margin: 0 0 4px; color: #475f63; font-size: 12px; font-weight: 600; }
.dt-chat-stamp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.dt-chat-state { font-weight: 400; }
.dt-chat-turn[data-side=owner] .dt-chat-stamp { justify-content: flex-end; }
.dt-chat-bubble { padding: 11px 15px; border-radius: 3px 14px 14px; background: #f1f5f4; }
.dt-chat-turn[data-side=owner] .dt-chat-bubble { border-radius: 14px 3px 14px 14px; background: #e5f3eb; }
.dt-chat-bubble p { margin: 0; white-space: pre-wrap; }
.dt-chat-bubble .controls { margin: 8px 0 0; }
.dt-chat-bubble button { max-width: 100%; overflow-wrap: anywhere; }
.dt-chat-composer {
  min-width: 0;
  margin: 0 var(--chat-gutter) var(--chat-gutter);
  padding: 13px 15px;
  border: 1px solid #aabfb7;
  border-radius: 12px;
}
.dt-chat-composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px #e4f2eb; }
.dt-chat-composer #chat-draft { min-height: 58px; margin: 5px 0 10px; }
.dt-chat-composer input[type=file] { min-width: 0; max-width: 100%; }
.dt-chat-composer input[type=file]::file-selector-button { cursor: pointer; color: var(--green); font-weight: 600; }
.dt-chat-composer .controls { overflow-wrap: anywhere; }
.dt-chat-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dt-chat-actions .primary:disabled { background: #dce7e1; border-color: #dce7e1; color: #435d51; opacity: 1; }
.dt-chat-error { padding: 8px 12px; border-inline-start: 3px solid #b24f3c; color: #7f3029; background: #fff2ee; }
@media(max-width: 760px) {
  .shell[data-page=chat] > main { padding-inline: 10px; }
  .dt-chat { --chat-gutter: 12px; border-radius: 11px; }
  .dt-chat-room { gap: 6px 8px; padding-block: 12px; }
  .dt-chat-mark { flex-basis: 32px; height: 32px; border-radius: 8px; }
  .dt-chat-tools { gap: 6px; }
  .dt-chat-tools select { flex: 1 1 120px; }
  .dt-chat-tools button { margin-inline-start: 0; }
  .dt-chat-log { gap: 12px; padding-block: 14px; max-height: 52dvh; }
  .dt-chat-turn { max-width: 92%; }
  .dt-chat-bubble { padding: 9px 12px; }
  .dt-chat-composer { padding: 10px; }
}

.dt-file-picker { display: grid; gap: 4px; padding: 9px 12px; background: #f6faf8; border: 1px dashed #adc3b8; border-radius: 8px; }
.dt-file-picker label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dt-file-picker input[type=file] { flex: 1 1 13rem; width: 100%; }
.dt-file-picker small, .dt-file-info small { color: var(--muted); font-size: 12px; }
.dt-attachment { display: flex; gap: 10px; align-items: center; min-width: 0; padding: 8px; margin-block: 6px; border: 1px solid var(--edge); border-radius: 8px; background: white; }
.dt-file-info { display: grid; gap: 2px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dt-file-info strong { font-size: 14px; font-weight: 600; }
.dt-file-info button { justify-self: start; color: var(--green); text-align: start; }
.dt-chat .dt-thumb { flex: 0 0 60px; height: 56px; min-height: 0; padding: 0; overflow: hidden; background: #edf2ef; border-radius: 6px; cursor: zoom-in; }
.dt-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.dt-remove { flex: none; }
.dt-lightbox { max-width: min(92vw, 1080px); max-height: 91dvh; padding: 12px; border: 1px solid var(--edge); border-radius: 12px; }
.dt-lightbox::backdrop { background: rgb(6 22 30 / 78%); }
.dt-lightbox header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 0 8px; overflow-wrap: anywhere; }
.dt-lightbox header button { flex: none; }
.dt-lightbox img { display: block; max-width: 100%; max-height: 73dvh; object-fit: contain; margin: auto; }
