:root {
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  color: #25343d;
  background: #f3f5f4;
  font-synthesis: none;
  color-scheme: light;
  --ink: #17242c;
  --steel: #426e83;
  --line: #dbe3e5;
  --muted: #7f929c;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #4389a9; outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: 268px minmax(0,1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.navigator { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #192831; color: #c6d4da; border-right: 1px solid #31414a; }
.brand { height: 78px; flex: none; padding: 0 22px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid #34434b; }
.brand-symbol { width: 31px; height: 31px; position: relative; border: 1.5px solid #dce7ea; transform: skew(-12deg); }
.brand-symbol span { position: absolute; background: #dce7ea; }
.brand-symbol span:first-child { width: 1.5px; height: 27px; left: 14px; top: 1px; transform: rotate(28deg); }
.brand-symbol span:nth-child(2) { width: 17px; height: 1.5px; left: 5px; top: 18px; }
.brand-symbol span:last-child { width: 6px; height: 6px; right: -4px; bottom: -4px; background: #c39b63; }
.brand-wordmark strong, .brand-wordmark small { display: block; }
.brand-wordmark strong { color: #f2f6f7; font-size: 14px; letter-spacing: .12em; white-space: nowrap; }
.brand-wordmark small { margin-top: 6px; color: #8096a1; font-size: 9px; letter-spacing: .17em; font-weight: 700; }
.sidebar-project { padding: 25px 18px 19px; border-bottom: 1px solid #34434b; }
.sidebar-label, .nav-section-title, .navigator-footer { font-size: 10px; font-weight: 750; letter-spacing: .14em; }
.sidebar-label { color: #8398a2; margin: 0 0 11px 5px; }
.selected-project { display: flex; gap: 11px; align-items: center; min-width: 0; background: #263943; border: 1px solid #3b5360; padding: 10px; border-radius: 6px; }
.project-figure, .project-card-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: #456b7e; color: #fff; font-size: 15px; font-weight: 700; border-radius: 3px; }
.selected-project-text { min-width: 0; }
.selected-project-text strong, .selected-project-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selected-project-text strong { color: #f0f5f6; font-size: 12px; font-weight: 650; }
.selected-project-text small { margin-top: 3px; color: #9cb0b9; font-size: 10px; letter-spacing: .08em; }
.navigator-scroll { min-height: 0; flex: 1; overflow: auto; padding: 18px 0; }
.nav-section-title { color: #8ea2ad; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; margin: 0 0 8px; }
.nav-section-title span:last-child { color: #758b96; letter-spacing: 0; }
.conversations-title { margin-top: 29px; }
.tree-items { display: grid; gap: 2px; }
.tree-item { min-height: 38px; width: 100%; border: 0; border-left: 3px solid transparent; background: transparent; color: #bdcbd2; text-align: left; display: flex; align-items: center; gap: 10px; padding: 7px 17px; font-size: 12px; transition: background .15s, color .15s; }
.tree-item:hover { background: #253b46; color: #f2f6f8; }
.tree-item.active { border-left-color: #77b7d0; background: #2b4653; color: #fff; font-weight: 650; }
.tree-icon { flex: none; font-size: 14px; width: 20px; text-align: center; color: #8eaebb; }
.tree-item .item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item small { margin-left: auto; color: #829ba7; }
.tree-empty { padding: 10px 20px; color: #748b96; font-size: 12px; }
.navigator-actions { border-top: 1px solid #34434b; padding: 13px 12px; display: grid; gap: 2px; }
.navigator-actions button { border: 0; background: transparent; color: #b5c6ce; text-align: left; border-radius: 4px; min-height: 35px; padding: 5px 10px; font-size: 12px; }
.navigator-actions button:hover { color: #fff; background: #2a414c; }
.nav-action-icon { display: inline-block; font-size: 17px; width: 26px; color: #94b5c4; vertical-align: -1px; }
.navigator-footer { height: 38px; flex: none; border-top: 1px solid #34434b; display: flex; align-items: center; gap: 8px; padding: 0 18px; color: #78909b; }
.navigator-footer span:last-child { margin-left: auto; letter-spacing: 0; }
.footer-square { width: 6px; height: 6px; background: #bc9867; }

.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.titlebar { height: 56px; flex: none; display: flex; align-items: center; gap: 18px; padding: 0 25px; background: #fff; border-bottom: 1px solid var(--line); }
.menu-button { display: none; border: 0; background: none; width: 32px; padding: 5px; }
.menu-button span { display: block; height: 2px; background: #3c5664; margin: 5px 0; }
.title-location { min-width: 0; font-size: 11px; color: #8ca0a9; font-weight: 700; letter-spacing: .08em; display: flex; align-items: center; gap: 12px; }
.title-location strong { color: #334a55; letter-spacing: 0; font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-slash { color: #bdc9ce; font-size: 17px; font-weight: 300; }
.title-spacer { flex: 1; }
.top-state { display: flex; align-items: center; gap: 9px; color: #627780; font-size: 11px; font-weight: 650; white-space: nowrap; }
.state-dot { height: 7px; width: 7px; border-radius: 50%; background: #bd9865; box-shadow: 0 0 0 3px #f3eadf; }
.state-dot.online { background: #5a9a78; box-shadow: 0 0 0 3px #e5f2e9; }
.state-dot.offline { background: #c97062; box-shadow: 0 0 0 3px #f7e7e3; }
.avatar { width: 28px; height: 28px; flex: none; display: grid; place-items: center; background: #e6ecef; color: #395360; font-size: 10px; font-weight: 800; border-radius: 50%; }
.workbench { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0,1fr) 276px; }
.main-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f8faf9; }
.document-header { flex: none; min-height: 117px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; padding: 19px 36px 18px; }
.document-heading { min-width: 0; }
.section-kicker { font-size: 10px; font-weight: 800; color: #7390a0; letter-spacing: .14em; }
.section-kicker span:first-child { margin: 0 6px; color: #c3ced2; }
.document-header h1 { margin: 9px 0 5px; font-size: 23px; line-height: 1.2; font-weight: 660; letter-spacing: -.025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-header p { margin: 0; font-size: 12px; line-height: 1.5; color: #8c9ca4; }
.new-conversation { flex: none; display: flex; align-items: center; gap: 9px; padding: 10px 13px; background: #fff; border: 1px solid #b8c8cf; border-radius: 5px; color: #385a6b; font-size: 12px; font-weight: 700; transition: border-color .15s, background .15s; }
.new-conversation:hover { border-color: #6a98ac; background: #f5fafb; }
.new-conversation span { font-size: 18px; line-height: 12px; font-weight: 400; }
.document-strip { height: 36px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 36px; border-top: 1px solid #e6ecee; border-bottom: 1px solid #dce5e7; background: #f1f5f5; color: #597380; font-size: 11px; font-weight: 650; overflow: hidden; white-space: nowrap; }
.strip-marker { width: 4px; height: 15px; flex: none; background: #568ba3; }
.document-strip #tab-title { overflow: hidden; text-overflow: ellipsis; }
.strip-end { margin-left: auto; color: #9baeb7; font-size: 9px; letter-spacing: .13em; font-weight: 800; }
.chat-scroll { min-height: 0; flex: 1; overflow: auto; background: #f8faf9; }
.empty-state { max-width: 820px; margin: 0 auto; padding: clamp(30px,7vh,75px) 44px 54px; }
.empty-index { display: flex; align-items: center; gap: 10px; color: #78929f; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.empty-index span:first-child { color: #b58e5d; }
.index-rule { width: 27px; height: 1px; background: #a8bac3; }
.empty-plan { height: 101px; display: flex; align-items: center; margin: 5px 0 8px; }
.plan-outline { width: 120px; height: 70px; border: 2px solid #9bb6c2; position: relative; transform: skew(-12deg); }
.plan-outline:before { content: ""; position: absolute; left: 39px; top: 0; bottom: 0; border-left: 2px solid #afc3cb; }
.plan-outline:after { content: ""; position: absolute; left: 39px; right: 0; top: 27px; border-top: 2px solid #afc3cb; }
.plan-room { position: absolute; display: block; border: 1px solid #bfd0d6; }
.plan-room.one { width: 24px; height: 17px; right: 10px; bottom: 8px; }
.plan-room.two { width: 10px; height: 10px; left: 9px; top: 9px; }
.plan-door { position: absolute; width: 11px; height: 11px; border: 2px solid #c69b61; border-right: 0; border-bottom: 0; right: -5px; top: 19px; transform: rotate(45deg); }
.empty-state h2 { margin: 0 0 12px; color: #20323d; font-size: clamp(24px,2.4vw,32px); font-weight: 670; letter-spacing: -.035em; }
.empty-state p { max-width: 590px; margin: 0; color: #758992; font-size: 14px; line-height: 1.7; }
.suggestion-label { margin: 38px 0 12px; font-size: 10px; letter-spacing: .17em; color: #8199a4; font-weight: 800; }
.suggestion-grid { max-width: 620px; display: grid; gap: 8px; }
.suggestion { min-height: 49px; display: flex; align-items: center; gap: 17px; border: 1px solid #d9e4e7; border-radius: 5px; background: #fff; padding: 9px 14px; color: #395460; text-align: left; box-shadow: 0 2px 10px rgba(37,62,73,.025); transition: border-color .15s, box-shadow .15s; }
.suggestion:hover { border-color: #92b3c2; box-shadow: 0 4px 14px rgba(37,62,73,.08); }
.suggestion span { color: #b68e5b; font-size: 10px; font-weight: 800; letter-spacing: .06em; border-right: 1px solid #e0e8eb; padding-right: 15px; }
.suggestion strong { font-size: 12px; font-weight: 650; }
.suggestion i { margin-left: auto; color: #7fa1b0; font-size: 17px; font-style: normal; }
.message-list { max-width: 920px; margin: 0 auto; padding: 30px 42px 50px; }
.message { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 15px; margin: 0 0 30px; }
.message-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: #416f83; border-radius: 4px; font-size: 10px; font-weight: 800; }
.message.user .message-icon { color: #78684d; background: #e9e1d4; }
.message-top { display: flex; align-items: center; gap: 12px; margin: 2px 0 8px; color: #a1b0b7; font-size: 11px; }
.message-top strong { color: #405864; font-size: 12px; font-weight: 700; }
.message-body { border: 1px solid #dce6e8; border-radius: 5px; background: #fff; padding: 16px 19px; color: #344851; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 2px 9px rgba(37,62,73,.025); }
.message.user .message-body { background: #f0f4f5; border-color: #e2eaec; }
.message.error .message-body { background: #fff6f4; border-color: #e6c3bc; color: #915549; }
.composer-region { flex: none; padding: 12px 35px 14px; background: #fff; border-top: 1px solid #dce6e8; box-shadow: 0 -4px 18px rgba(43,67,76,.025); }
.request-status { min-height: 0; margin: 0 0 6px; color: #5e8798; font-size: 11px; }
.request-status:empty { display: none; }
.composer { display: flex; align-items: flex-end; gap: 10px; border: 1px solid #bbcdd5; border-radius: 7px; padding: 7px; background: #fff; box-shadow: 0 2px 12px rgba(45,73,84,.045); }
.composer:focus-within { border-color: #5388a1; box-shadow: 0 0 0 3px #e9f3f6; }
.composer textarea { min-width: 0; min-height: 47px; max-height: 160px; resize: vertical; border: 0; outline: 0; flex: 1; padding: 10px; background: transparent; color: #263b45; font-size: 14px; line-height: 1.45; }
.composer textarea::placeholder { color: #9aabb2; }
.send-button { flex: none; height: 38px; display: flex; align-items: center; gap: 16px; border: 0; border-radius: 4px; background: #315f75; color: #fff; padding: 0 15px; font-size: 12px; font-weight: 750; transition: background .15s; }
.send-button:hover { background: #254f63; }
.send-button span { font-size: 18px; font-weight: 400; }
.composer-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; color: #9aaab1; font-size: 9px; font-weight: 700; letter-spacing: .065em; }
.composer-hint i { font-style: normal; margin: 0 5px; }

.inspector { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fff; }
.inspector-heading { height: 49px; flex: none; padding: 0 19px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); color: #6d8794; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.inspector-heading span:last-child { font-size: 16px; color: #91a9b4; }
.inspector-scroll { min-height: 0; flex: 1; overflow: auto; }
.property-section { padding: 23px 19px; border-bottom: 1px solid #e3eaec; }
.property-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 0 0 15px; color: #597584; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.section-count { color: #9bafb8; font-size: 9px; letter-spacing: .04em; white-space: nowrap; }
.project-card { display: flex; align-items: center; gap: 10px; }
.project-card-icon { width: 35px; height: 35px; background: #e4eef2; color: #517a8e; }
.project-card strong, .project-card span { display: block; }
.project-card strong { color: #344d5a; font-size: 12px; }
.project-card span:not(.project-card-icon) { color: #91a4ad; margin-top: 3px; font-size: 10px; }
.muted-copy { margin: 13px 0 0; color: #8a9da5; font-size: 11px; line-height: 1.6; }
.memory-preview { display: grid; gap: 7px; }
.memory-item { border-left: 2px solid #95b2bf; background: #f5f8f8; padding: 9px 10px; color: #526b77; font-size: 11px; line-height: 1.5; }
.memory-item small { display: block; margin-bottom: 4px; color: #78929f; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.memory-none { color: #95a7af; font-size: 11px; line-height: 1.5; }
.text-button { margin-top: 13px; border: 0; background: none; color: #3d7690; padding: 0; font-size: 11px; font-weight: 750; }
.text-button:hover { text-decoration: underline; }
.status-row { min-height: 31px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #657b85; font-size: 11px; }
.status-tag { padding: 4px 6px; border-radius: 3px; font-size: 10px; white-space: nowrap; }
.status-tag.offline { background: #f4ede4; color: #98714f; }
.status-tag.neutral { background: #edf1f2; color: #8799a1; }
.workflow { list-style: none; margin: 0; padding: 0; }
.workflow li { min-height: 29px; display: flex; align-items: center; gap: 10px; color: #526d7a; font-size: 11px; }
.workflow li i { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border: 1px solid #c2d3da; border-radius: 3px; font-size: 9px; font-style: normal; font-weight: 750; color: #6d8d9d; }
.workflow li.disabled { color: #aab8be; }
.workflow li.disabled i { color: #aebdc3; border-color: #dbe4e7; }
.statusbar { height: 27px; flex: none; display: flex; align-items: center; gap: 11px; padding: 0 15px; background: #263d49; color: #b9cbd3; font-size: 9px; font-weight: 700; letter-spacing: .085em; }
.statusbar-icon { width: 6px; height: 6px; background: #82b49a; }
.status-divider { height: 12px; width: 1px; background: #66808c; }
.status-spacer { flex: 1; }
#footer-connection { color: #a8d4ba; }

.modal { width: min(490px,calc(100vw - 28px)); padding: 0; border: 1px solid #adc1c9; border-radius: 7px; background: #fff; color: #2b3d46; box-shadow: 0 24px 80px rgba(10,29,39,.34); }
.modal::backdrop { background: rgba(13,31,41,.56); }
.modal-heading { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; background: #20333e; color: #dce7eb; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.modal-close { border: 0; background: none; color: #b3c7cf; font-size: 23px; line-height: 1; }
.modal-content { padding: 22px 25px 25px; }
.modal h2 { margin: 0 0 7px; font-size: 22px; letter-spacing: -.025em; }
.modal p { margin: 0 0 20px; color: #82949c; font-size: 12px; line-height: 1.55; }
.modal label { display: block; margin: 14px 0; color: #4c6775; font-size: 11px; font-weight: 750; }
.modal input, .modal textarea, .modal select { display: block; width: 100%; margin-top: 7px; border: 1px solid #bfced4; border-radius: 4px; padding: 10px 11px; color: #263e49; background: #fff; font-size: 13px; }
.modal textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; }
.primary-button, .secondary-button { border-radius: 4px; padding: 10px 14px; font-size: 12px; font-weight: 750; }
.primary-button { border: 1px solid #315f75; background: #315f75; color: #fff; }
.secondary-button { border: 1px solid #c4d1d6; background: #fff; color: #56717e; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 42px; transform: translate(-50%,14px); max-width: min(500px,90vw); padding: 10px 15px; border-left: 3px solid #c49a61; background: #20343e; color: #fff; opacity: 0; pointer-events: none; font-size: 12px; box-shadow: 0 12px 30px rgba(10,30,39,.2); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 236px minmax(0,1fr); }
  .workbench { grid-template-columns: minmax(0,1fr) 244px; }
  .brand { padding: 0 16px; }
  .document-header { padding-left: 27px; padding-right: 27px; }
  .document-strip { padding-left: 27px; padding-right: 27px; }
  .composer-region { padding-left: 27px; padding-right: 27px; }
}
@media (max-width: 900px) {
  .workbench { grid-template-columns: minmax(0,1fr); }
  .inspector { display: none; }
}
@media (max-width: 690px) {
  .app-shell { display: block; }
  .navigator { position: fixed; z-index: 10; top: 0; bottom: 0; left: 0; width: min(280px,85vw); visibility: hidden; transform: translateX(-105%); box-shadow: 8px 0 32px rgba(13,34,44,.25); transition: transform .2s, visibility .2s; }
  .navigator.mobile-open { visibility: visible; transform: translateX(0); }
  .workspace { height: 100vh; height: 100dvh; }
  .titlebar { height: 51px; padding: 0 13px; gap: 10px; }
  .menu-button { display: block; }
  .title-location { gap: 8px; }
  .title-location span:first-child { display: none; }
  .location-slash { display: none; }
  .title-location strong { max-width: 36vw; }
  .avatar { display: none; }
  .top-state { font-size: 10px; }
  .document-header { min-height: 104px; padding: 17px; gap: 12px; }
  .document-header h1 { font-size: 19px; }
  .document-header p { font-size: 11px; }
  .new-conversation { padding: 8px; font-size: 0; }
  .new-conversation span { font-size: 21px; }
  .document-strip { height: 31px; padding: 0 17px; }
  .strip-end { display: none; }
  .empty-state { padding: 30px 22px 38px; }
  .empty-plan { height: 78px; transform: scale(.75); transform-origin: left center; }
  .empty-state h2 { font-size: 24px; }
  .empty-state p { font-size: 12px; }
  .suggestion-label { margin-top: 25px; }
  .message-list { padding: 22px 16px 30px; }
  .composer-region { padding: 8px 11px 11px; }
  .composer-hint span:last-child { display: none; }
  .statusbar { height: 24px; }
  .statusbar #footer-project { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .navigator, .tree-item, .new-conversation, .suggestion, .send-button, .toast { transition: none; }
}
