:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #243a34;
  background: #f6f5f1;
  font-size: 14px;
  --green: #163f35;
  --muted: #74817b;
  --line: #e4e8e1;
  --paper: #fff;
  --accent: #ddedc7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: inherit;
  padding: 10px 14px;
  font-weight: 600;
}
button:hover {
  background: #f0f4ed;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
button.primary:hover {
  background: #235547;
}
button.quiet {
  background: transparent;
  border-color: transparent;
}
button.danger {
  color: #b33b37;
}
.small {
  font-size: 12px;
  padding: 7px 10px;
}
a {
  color: #276d55;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1.2px;
  font-weight: 650;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.6px;
}
h3 {
  font-size: 14px;
}
p {
  line-height: 1.7;
}
label {
  display: grid;
  gap: 8px;
  color: #4c6057;
  font-size: 12px;
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dce2d9;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #243a34;
}
textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.7;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #658f72;
  outline-color: #658f72;
}
.field {
  margin-bottom: 18px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #78897c;
  text-transform: uppercase;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--green);
  color: #e6f1cd;
  font-size: 18px;
  font-weight: 400;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 4px 7px;
  background: #edf1e9;
  font-size: 10px;
  color: #4a6356;
  white-space: nowrap;
}
.tag.active {
  background: #dfeecf;
  color: #416332;
}
.tag.warn {
  background: #fff0d4;
  color: #966915;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #84a86a;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 15px;
}
.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-story {
  background: #e5eada;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-story h1 {
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.2;
  max-width: 550px;
  margin-bottom: 24px;
}
.auth-story p {
  max-width: 370px;
  color: #65745e;
}
.story-art {
  width: 230px;
  height: 160px;
  position: relative;
  margin: 48px 0;
}
.story-art span {
  position: absolute;
  border: 1px solid #aebda1;
  border-radius: 12px;
  background: #f5f7ee;
  width: 155px;
  height: 110px;
  transform: rotate(-7deg);
  top: 0;
  left: 0;
  padding: 17px;
  box-shadow: 0 10px 30px #3849280c;
}
.story-art span:nth-child(2) {
  transform: rotate(4deg);
  top: 22px;
  left: 42px;
  background: #cadbb4;
}
.story-art span:nth-child(3) {
  transform: rotate(-2deg);
  top: 43px;
  left: 80px;
  background: var(--green);
  color: #dae8c6;
  font-size: 30px;
}
.auth-form {
  display: grid;
  place-items: center;
  padding: 40px;
  background: #fafbf7;
}
.auth-card {
  width: min(100%, 360px);
}
.auth-card h2 {
  font-size: 27px;
  margin-bottom: 10px;
}
.auth-card form {
  margin-top: 30px;
}
.auth-card button.primary {
  width: 100%;
  margin-top: 6px;
}
.error {
  color: #b33b37;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  height: 100dvh;
}
.sidebar {
  background: #eef0e8;
  border-right: 1px solid #dce2d6;
  display: flex;
  flex-direction: column;
  padding: 27px 17px 16px;
  overflow: auto;
}
.sidebar .brand {
  padding: 0 7px 30px;
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  margin-bottom: 5px;
  font-size: 12px;
  color: #5e7064;
  padding: 12px;
}
.nav-button.selected {
  background: #dce7ce;
  color: #284638;
}
.section-label {
  display: flex;
  justify-content: space-between;
  padding: 27px 12px 10px;
  font-size: 10px;
  letter-spacing: 1.3px;
  color: #869180;
  font-weight: 700;
}
.project-button {
  width: 100%;
  text-align: left;
  padding: 13px 12px;
  margin: 3px 0;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
}
.project-button.selected {
  background: #fff;
  border-color: #dce3d5;
  box-shadow: 0 2px 5px #17331a03;
}
.project-button .project-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  background: #e9eee1;
  border-radius: 7px;
  color: #657e4d;
  flex-shrink: 0;
}
.project-button span.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot {
  margin-top: auto;
  padding: 25px 7px 0;
}
.avatar {
  background: #d8e0cf;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.user-meta {
  min-width: 0;
  flex: 1;
}
.user-meta strong {
  display: block;
  font-size: 12px;
}
.user-meta span {
  font-size: 10px;
  color: #89917f;
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar {
  height: 76px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbf8;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.breadcrumb {
  font-size: 12px;
  color: #8b948a;
}
.breadcrumb strong {
  color: #334c40;
  margin-left: 10px;
  font-weight: 600;
}
.main-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.welcome {
  padding: 48px 48px 30px;
  max-width: 1180px;
  margin: auto;
}
.welcome-head {
  margin-bottom: 34px;
}
.welcome-head h1 {
  margin: 10px 0 8px;
}
.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 17px;
}
.project-card {
  border: 1px solid #dfe4d8;
  border-radius: 15px;
  background: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 17px;
  min-height: 240px;
}
.project-card h2 {
  font-size: 19px;
  margin: 0;
}
.project-card p {
  font-size: 12px;
  word-break: break-all;
  margin: 0;
  color: #7d897c;
}
.project-card .card-bottom {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: auto;
}
.card-illustration {
  width: 38px;
  height: 38px;
  background: #edf2e4;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #688252;
}
.hint-panel {
  margin-top: 28px;
  background: #ecefe4;
  border: 1px solid #e0e6d6;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  gap: 18px;
  color: #63715e;
}
.hint-panel p {
  font-size: 12px;
  margin: 0;
}
.workspace {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
}
.chat-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.chat-toolbar {
  padding: 16px 28px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.chat-toolbar select {
  width: 180px;
  padding: 8px;
  font-size: 11px;
}
.chat-toolbar .spacer {
  flex: 1;
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 26px 36px;
  scroll-behavior: smooth;
}
.chat-empty {
  height: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}
.chat-empty .brand-mark {
  width: 48px;
  height: 48px;
  font-size: 26px;
  margin-bottom: 10px;
}
.chat-empty h2 {
  margin: 0;
}
.chat-empty p {
  font-size: 12px;
  max-width: 380px;
  color: #87917e;
}
.message {
  margin: 0 0 25px;
  max-width: 900px;
}
.message-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #798774;
  margin-bottom: 8px;
}
.message-body {
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.message.user {
  margin-left: 32px;
  padding: 15px 20px;
  background: #e8eddf;
  border-radius: 14px 14px 3px 14px;
}
.message.user .message-header {
  color: #75846b;
}
.message details {
  background: #f0f2ec;
  border: 1px solid #e3e7dc;
  border-radius: 9px;
  padding: 10px 13px;
  color: #6d7d64;
  font-size: 11px;
}
.message details pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 260px;
  overflow: auto;
  font-size: 11px;
}
.composer-wrap {
  padding: 10px 28px 20px;
}
.composer {
  background: white;
  border: 1px solid #dce3d4;
  border-radius: 14px;
  padding: 13px;
  box-shadow: 0 3px 10px #2a3d2004;
}
.composer textarea {
  border: 0;
  min-height: 76px;
  max-height: 200px;
  resize: none;
  padding: 4px;
  outline: none;
  font-size: 13px;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.composer-foot small {
  color: #97a18e;
  font-size: 10px;
}
.composer-help {
  text-align: center;
  font-size: 10px;
  color: #929d87;
  margin-top: 11px;
}
.attachment-chip {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 5px 8px;
  background: #edf2e5;
  border-radius: 6px;
  margin: 2px;
  font-size: 11px;
}
.attachment-chip button {
  padding: 0;
  border: 0;
  background: transparent;
}
.workspace-aside {
  border-left: 1px solid var(--line);
  background: #f9faf6;
  overflow: auto;
  padding: 24px 19px;
}
.aside-section {
  padding-bottom: 26px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.aside-section h3 {
  font-size: 11px;
  margin-bottom: 15px;
}
.aside-section p {
  font-size: 11px;
  color: #839078;
}
.file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid #e9ece4;
}
.file-info {
  min-width: 0;
  flex: 1;
}
.file-info a {
  display: block;
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
  color: #516444;
}
.file-info small {
  font-size: 9px;
  color: #98a08d;
}
.chat-link {
  font-size: 11px;
  padding: 9px 7px;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
  border: 0;
  background: transparent;
}
.chat-link.selected {
  background: #e9eedf;
}
.requests {
  padding: 0 28px;
}
.request-card {
  background: #fff7e8;
  border: 1px solid #e9d5ac;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 12px;
}
.request-card p {
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 140px;
  overflow: auto;
}
.request-card label {
  margin-bottom: 10px;
}
.request-card h3 {
  color: #866627;
}
.admin {
  padding: 30px;
  max-width: 1200px;
  margin: auto;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.admin-grid {
  display: grid;
  gap: 22px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 23px;
  overflow: auto;
}
.panel h2 {
  font-size: 16px;
  margin-bottom: 19px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  text-align: left;
  color: #94a08b;
  font-size: 10px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
}
td {
  padding: 14px 8px;
  border-bottom: 1px solid #f0f2ec;
  vertical-align: middle;
}
td:last-child {
  text-align: right;
}
td select {
  padding: 7px;
  font-size: 11px;
  min-width: 115px;
}
td .row {
  justify-content: flex-end;
}
.empty-note {
  padding: 35px;
  text-align: center;
  color: #8a9782;
  font-size: 12px;
}
dialog {
  border: 1px solid #dce3d4;
  border-radius: 16px;
  padding: 30px;
  width: min(500px, calc(100% - 32px));
  box-shadow: 0 30px 100px #122e2433;
  color: inherit;
}
dialog::backdrop {
  background: #142d2666;
  backdrop-filter: blur(3px);
}
dialog h2 {
  margin-bottom: 9px;
}
dialog p {
  font-size: 12px;
  color: #788970;
}
dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 23px;
}
.secret {
  font-family: monospace;
  overflow-wrap: anywhere;
  background: #f0f4e8;
  border: 1px solid #dfe6d5;
  padding: 14px;
  border-radius: 8px;
  user-select: all;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #254f40;
  color: white;
  border-radius: 10px;
  padding: 13px 22px;
  max-width: 90vw;
  z-index: 10;
  font-size: 12px;
  box-shadow: 0 8px 30px #163f3522;
}
.mobile-menu {
  display: none;
}
#connection {
  font-size: 10px;
}
.login-code {
  background: #ecf0e3;
  padding: 12px;
  border-radius: 8px;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.login-code strong {
  display: block;
  font-size: 23px;
  margin: 12px 0;
  letter-spacing: 2px;
}
.busy-indicator {
  font-size: 11px;
  color: #7b9068;
  padding: 8px 0;
}
.busy-indicator:before {
  content: "●";
  margin-right: 8px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .welcome {
    padding: 32px;
  }
  .messages {
    padding: 22px;
  }
  .topbar {
    padding: 0 22px;
  }
}
@media (max-width: 850px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-aside {
    display: none;
  }
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .auth-story {
    padding: 35px;
  }
  .auth-story h1 {
    font-size: 40px;
  }
  .chat-toolbar {
    padding: 14px;
  }
  .composer-wrap {
    padding: 10px 16px 15px;
  }
  .requests {
    padding: 0 16px;
  }
  .admin {
    padding: 20px;
  }
  .welcome {
    padding: 25px;
  }
}
@media (max-width: 620px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-story {
    display: none;
  }
  .auth-form {
    padding: 28px;
    min-height: 100vh;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 5;
    top: 65px;
    bottom: 0;
    width: 240px;
    box-shadow: 10px 0 40px #1d38282a;
  }
  .shell.menu-open .sidebar {
    display: flex;
  }
  .topbar {
    height: 65px;
    padding: 0 16px;
  }
  .mobile-menu {
    display: inline-block;
    padding: 5px 8px;
  }
  .breadcrumb {
    font-size: 11px;
  }
  .topbar .tag {
    display: none;
  }
  .welcome {
    padding: 28px 18px;
  }
  .welcome h1 {
    font-size: 26px;
  }
  .chat-toolbar select {
    width: 130px;
  }
  .chat-toolbar button {
    font-size: 10px;
    padding: 8px;
  }
  .messages {
    padding: 18px;
  }
  .message.user {
    margin-left: 15px;
  }
  .panel {
    padding: 16px;
  }
  .admin {
    padding: 16px;
  }
  .workspace-aside.mobile-files {
    display: block;
    position: fixed;
    inset: 65px 0 0;
    background: #f9faf6;
    z-index: 4;
  }
  .file-toggle {
    display: inline-block;
  }
  .composer-foot small {
    display: none;
  }
}
@media (min-width: 851px) {
  .file-toggle {
    display: none;
  }
}

@media (max-width: 850px) {
  .workspace-aside.mobile-files {
    display: block;
    position: fixed;
    inset: 76px 0 0;
    background: #f9faf6;
    z-index: 4;
  }
}

.github-panel p {
  line-height: 1.7;
  margin: 12px 0;
}
.github-panel h2 {
  margin-bottom: 4px;
}
.github-actions {
  flex-wrap: wrap;
  gap: 16px;
}
.button-link {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
  margin-bottom: 10px;
  color: var(--muted);
}
@media (max-width: 620px) {
  .github-panel > .row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
  }
}
