:root {
  font-family: system-ui, sans-serif;
  color: #172337;
  background: #f3f5f8;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 1px solid #c7d1df;
  border-radius: 7px;
  padding: 8px 12px;
  background: white;
  color: #20354f;
  cursor: pointer;
}
button:hover {
  background: #e8eff8;
}
button:disabled {
  opacity: 0.5;
}
input,
select {
  border: 1px solid #bcc8d8;
  border-radius: 6px;
  padding: 9px;
  background: white;
  color: #172337;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid #3779b8;
  outline-offset: 2px;
}
a {
  color: #1c5790;
}
header {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid #dce3eb;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
}
.badge {
  font-size: 10px;
  padding: 3px 6px;
  color: #586c86;
  background: #eef2f7;
  border-radius: 5px;
  margin-left: 6px;
}
.grow {
  flex: 1;
}
.desk {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  height: calc(100dvh - 62px);
  min-height: 440px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
  border: 0;
  border-right: 1px solid #dce3eb;
  border-radius: 0;
  padding: 18px 14px;
  min-height: 0;
}
#new-chat {
  display: grid;
  gap: 9px;
}
#new-chat input,
#chat-search {
  width: 100%;
  min-width: 0;
  font-size: 12px;
}
.primary {
  background: #24496f;
  color: white;
  border-color: #24496f;
}
.primary:hover {
  background: #315f8e;
}
#tabs {
  flex: 1;
  min-height: 80px;
  overflow: auto;
}
#tabs button {
  display: block;
  width: 100%;
  margin: 3px 0;
  text-align: left;
  border-color: transparent;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#tabs button:hover {
  background: #e9eef5;
}
#tabs button[aria-selected='true'] {
  background: #dfe9f4;
  color: #193c61;
  border-color: #cbd9e9;
}
#tabs button.archived {
  color: #65758a;
}
.list-label {
  font-size: 11px;
  font-weight: 600;
  color: #738296;
  margin: 18px 10px 6px;
}
.account {
  display: grid;
  gap: 8px;
  border-top: 1px solid #dde4ed;
  padding-top: 14px;
}
.account small {
  color: #65758a;
  font-size: 11px;
}
.account button {
  font-size: 12px;
}
.account .hint {
  padding: 0;
  margin: 3px 0;
  line-height: 1.6;
}
.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#message {
  min-height: 34px;
  padding: 9px 18px;
  color: #50637a;
  font-size: 12px;
}
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 12px;
  padding: 0 14px 14px;
}
.workspace.files-hidden {
  grid-template-columns: minmax(0, 1fr);
}
[hidden] {
  display: none !important;
}
.empty {
  color: #9aabc2;
  max-width: 460px;
  margin: 16vh auto;
  padding: 24px;
  line-height: 1.7;
}
.empty h2 {
  color: #dbe4f0;
  font-size: 22px;
  font-weight: 500;
}
.console {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
}
.consolebar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  color: #e5e7eb;
  background: #1c293c;
}
.consolebar button {
  font-size: 12px;
  background: #283a51;
  color: #e5e7eb;
  border-color: #42536a;
}
.consolebar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.consolebar button,
.consolebar summary {
  white-space: nowrap;
}
.chat-actions summary {
  cursor: pointer;
  padding: 8px;
  font-size: 12px;
}
.chat-actions > div {
  position: absolute;
  top: 48px;
  right: 130px;
  z-index: 5;
  padding: 8px;
  border: 1px solid #435570;
  border-radius: 8px;
  background: #1c293c;
  box-shadow: 0 8px 30px #0004;
  display: grid;
  gap: 6px;
}
#terminal {
  flex: 1;
  min-height: 0;
  padding: 10px 10px 0;
}
.hint {
  font-size: 11px;
  color: #8191a8;
  padding: 0 12px;
}
.xterm {
  height: 100%;
}
aside {
  background: white;
  border: 1px solid #dce3eb;
  border-radius: 10px;
  padding: 14px;
  overflow: auto;
}
.filebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filebar button {
  font-size: 11px;
}
.upload {
  display: block;
  padding: 12px;
  border: 1px dashed #9aacbf;
  border-radius: 7px;
}
.upload input {
  width: 100%;
  font-size: 11px;
  margin-top: 8px;
  padding: 0;
  border: 0;
}
.file {
  border-bottom: 1px solid #e5eaf1;
  padding: 12px 0;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.file strong {
  width: 100%;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.file button {
  font-size: 11px;
  padding: 5px 7px;
}
#folder {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.card {
  max-width: 460px;
  margin: 10vh auto;
  background: white;
  border: 1px solid #dce3eb;
  border-radius: 12px;
  padding: 30px;
}
.card h1 {
  font-size: 24px;
}
.card form,
dialog form {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}
.card label,
dialog label {
  display: grid;
  gap: 6px;
}
.card button[type='submit'] {
  background: #204a73;
  color: white;
}
.note {
  font-size: 12px;
  color: #6b7c91;
}
.card #message {
  padding: 12px 0;
}
.card pre {
  white-space: pre-wrap;
}
#qr {
  max-width: 190px;
}
dialog {
  border: 1px solid #b6c2d2;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  padding: 20px;
}
dialog::backdrop {
  background: #14223799;
}
.copy-image {
  display: block;
  margin: 12px 0 0;
}
#preview-body img {
  max-width: 80vw;
  max-height: 75vh;
}
#preview-body iframe {
  width: 75vw;
  height: 75vh;
  border: 0;
}
#preview-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 75vw;
}
#invite-code {
  display: block;
  overflow-wrap: anywhere;
  margin: 12px 0;
}
@media (max-width: 1150px) {
  .desk {
    grid-template-columns: 208px minmax(0, 1fr);
  }
  .workspace {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }
  #file-panel {
    position: absolute;
    right: 14px;
    top: 50px;
    bottom: 14px;
    width: 272px;
    z-index: 4;
    box-shadow: -6px 8px 30px #0002;
  }
  header small {
    display: none;
  }
}
@media (max-width: 700px) {
  header {
    padding: 10px;
    gap: 8px;
  }
  header strong {
    font-size: 12px;
  }
  header .badge,
  header > span:not(.grow) {
    display: none;
  }
  header button {
    font-size: 11px;
    padding: 7px;
  }
  .desk {
    grid-template-columns: 150px minmax(0, 1fr);
  }
  .sidebar {
    padding: 12px 8px;
  }
  .workspace {
    padding: 0 6px 6px;
  }
  .consolebar {
    flex-wrap: wrap;
    gap: 4px;
  }
  .consolebar strong {
    width: 100%;
  }
  .consolebar button {
    padding: 6px;
    font-size: 11px;
  }
  .chat-actions > div {
    top: 75px;
    right: 6px;
  }
  .hint {
    font-size: 10px;
  }
}
.file-root {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.file-root button {
  font-size: 11px;
  padding: 6px;
}
#file-root {
  flex: 1;
  text-align: left;
}
#file-root[aria-pressed='true'] {
  background: #e7eff9;
}
#files {
  font-size: 12px;
}
#files small {
  display: block;
  color: #7b8ba1;
  padding: 8px 0;
}
.folder-row {
  display: flex;
  gap: 4px;
  padding: 6px 0;
  align-items: center;
}
.folder-row button {
  font-size: 11px;
  padding: 5px;
}
.folder-row .folder-toggle {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  border-color: transparent;
}
[role='treeitem'][aria-selected='true'] > .folder-row .folder-toggle {
  background: #e7eff9;
}
.tree-children {
  border-left: 1px solid #dde5ee;
  margin-left: 6px;
  padding-left: 10px;
}
