@font-face {
  font-family: Public Sans;
  src: url(/fonts/public-sans.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: JetBrains Mono;
  src: url(/fonts/jetbrains-mono.woff2) format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family:
    Public Sans,
    system-ui,
    sans-serif;
  color: #e9edf2;
  background: #05080c;
  --muted: #b2bcc6;
  --line: #242d36;
  --red: #e2452c;
  --accent: #ff7a5e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
select,
input {
  min-height: 44px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #0c1116;
  border-radius: 8px;
  padding: 10px 16px;
}
button:hover:not(:disabled) {
  border-color: var(--muted);
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button.primary {
  background: var(--red);
  border-color: var(--red);
  color: white;
  font-weight: 600;
}
a {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input,
select,
textarea {
  background: #0c1116;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.025em;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 16px;
  margin-top: 24px;
}
p {
  line-height: 1.6;
}
label {
  font-size: 13px;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  font:
    27px JetBrains Mono,
    monospace;
  letter-spacing: 0.04em;
}
.brand img {
  border-radius: 7px;
}
.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  overflow: hidden;
}
.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #0c1116;
  border-right: 1px solid var(--line);
}
.rail > .brand {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.server {
  padding: 20px 22px;
}
.server strong {
  display: block;
  margin-bottom: 7px;
  font-weight: 500;
}
.connection {
  color: var(--muted);
  font-size: 13px;
}
.new-task {
  margin: 0 20px 25px;
}
.section-label {
  color: var(--muted);
  font-size: 11px;
  font-family:
    JetBrains Mono,
    monospace;
  margin: 0 22px 10px;
}
.rail nav {
  overflow: auto;
  flex: 1;
  padding: 0 10px;
}
.session {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 6px;
  gap: 14px;
  padding: 15px 14px;
  background: transparent;
  position: relative;
}
.session + .session {
  border-top: 1px solid #171c22;
}
.session.selected {
  background: #221b1a;
}
.session.selected:before {
  position: absolute;
  content: "";
  background: var(--red);
  width: 4px;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 5px;
}
.session .glyph {
  font-size: 22px;
}
.session-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.session-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
  font-size: 14px;
}
.session small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.rail footer {
  padding: 15px 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.rail footer button {
  border: 0;
  text-align: left;
  padding-left: 6px;
}
.rail footer span {
  padding-left: 6px;
}
main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 24px;
  padding: 25px 10px;
  border-bottom: 1px solid var(--line);
}
#room-title {
  overflow-wrap: anywhere;
}
#room-detail {
  color: var(--muted);
  font-size: 14px;
  margin-top: 7px;
}
.room-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
#room-state {
  font-size: 13px;
  white-space: nowrap;
}
#connection {
  font-size: 12px;
  color: var(--muted);
  padding: 9px 34px;
  min-height: 33px;
}
#connection.stale {
  color: #ffd67e;
  background: #211b10;
}
#message-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 34px 30px;
}
#messages {
  max-width: 760px;
  margin: 0 auto;
}
.empty {
  color: var(--muted);
  text-align: center;
  margin: 12vh auto;
  max-width: 360px;
  line-height: 1.7;
}
.message {
  margin: 0 0 25px;
  min-width: 0;
}
.message-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.message-meta time {
  font-size: 11px;
  color: #84909c;
}
.message.user {
  margin-left: auto;
  max-width: 85%;
}
.message.user .message-meta {
  justify-content: flex-end;
}
.message-body {
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.message.user .message-body {
  background: #171c22;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 18px;
}
.message.assistant .message-body {
  background: #0c1116;
  border: 1px solid #1a242e;
  border-radius: 10px;
  padding: 16px 18px;
}
.message.permission {
  border: 1px solid #655025;
  background: #191711;
  border-radius: 12px;
  padding: 22px;
}
.permission .message-body {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
.permission-label {
  font:
    12px JetBrains Mono,
    monospace;
  color: #ffd67e;
  margin-bottom: 14px;
  display: block;
}
.decision-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.decision-buttons button {
  flex: 1;
  min-width: 100px;
}
.permission-foot {
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
}
pre {
  font:
    12px/1.7 JetBrains Mono,
    monospace;
  white-space: pre;
  overflow: auto;
  max-width: 100%;
  background: #05080c;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin: 12px 0;
}
code {
  font-family:
    JetBrains Mono,
    monospace;
}
.file-link {
  display: block;
  border: 1px solid var(--line);
  padding: 12px 15px;
  border-radius: 7px;
  margin-top: 10px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.compose-area {
  padding: 10px 24px max(20px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.compose-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 10px;
  background: #0c1116;
}
textarea {
  flex: 1;
  resize: none;
  border: 0;
  background: transparent;
  line-height: 1.55;
  min-height: 46px;
  max-height: 130px;
  padding: 11px 6px;
}
.icon-button {
  font-size: 25px;
  min-width: 44px;
  min-height: 46px;
  padding: 5px 12px;
}
#attach {
  border: 0;
  color: var(--muted);
}
.compose-hint {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: #84909c;
  font-size: 10px;
  margin: 10px 3px 0;
}
#workspace-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
#workspace {
  max-width: 80%;
  min-height: 44px;
  padding: 8px;
  font-size: 12px;
}
#pending-files {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12px;
}
#pending-files button {
  font-size: 12px;
  margin-bottom: 10px;
}
#error,
#settings-error,
#pair-error {
  color: #ff93b2;
  font-size: 13px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.mobile-header,
.mobile-connection {
  display: none;
}
.pairing {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}
.pair-card {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 15px;
}
.pair-card .brand {
  margin-bottom: 25px;
}
.pair-card p {
  color: var(--muted);
  font-size: 14px;
}
.pair-card label {
  margin-bottom: -8px;
}
.pair-card button {
  margin-top: 8px;
}
dialog {
  background: #0c1116;
  color: #e9edf2;
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(540px, calc(100% - 28px));
  padding: 25px;
  max-height: calc(100dvh - 40px);
  overflow: auto;
}
dialog::backdrop {
  background: #000b;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
dialog p {
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0;
}
dialog select {
  margin-left: 10px;
}
#devices > div {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
#devices button {
  font-size: 12px;
  flex-shrink: 0;
}
#logout {
  margin-top: 24px;
  color: var(--accent);
}
#drawer {
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(330px, 90vw);
  border-radius: 0;
}
#drawer > button {
  width: 100%;
  margin-bottom: 16px;
}
.state-running {
  color: #6fb9f0;
}
.state-awaiting_approval {
  color: #ffd67e;
}
.state-done {
  color: #8eee98;
}
.state-failed {
  color: #ff93b2;
}
.state-cancelled {
  color: #cb86db;
}
.state-idle {
  color: var(--muted);
}
@media (max-width: 720px) {
  .app {
    display: block;
  }
  .rail {
    display: none;
  }
  main {
    height: 100dvh;
  }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 4px;
  }
  .mobile-header .brand {
    font-size: 24px;
    gap: 10px;
  }
  .mobile-header button {
    background: transparent;
    border: 0;
  }
  .mobile-connection {
    display: flex;
    gap: 10px;
    padding: 8px 20px 16px;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
  }
  .conversation-header {
    margin: 0;
    padding: 18px 20px;
    gap: 12px;
    align-items: flex-start;
  }
  .conversation-header h1 {
    font-size: 21px;
  }
  .conversation-header p {
    font-size: 12px;
  }
  .room-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
    max-width: 135px;
  }
  #room-state {
    font-size: 11px;
    white-space: normal;
  }
  .room-actions button {
    font-size: 11px;
    padding: 6px 12px;
    min-height: 44px;
  }
  #connection {
    padding: 7px 20px;
    font-size: 10px;
    min-height: 26px;
  }
  #message-scroll {
    padding: 14px 20px 20px;
  }
  .message-body {
    font-size: 14px;
  }
  .message.user {
    max-width: 93%;
  }
  .message.permission {
    padding: 16px;
  }
  .permission-label {
    font-size: 10px;
  }
  .decision-buttons {
    gap: 8px;
  }
  .decision-buttons button {
    font-size: 12px;
    min-width: 90px;
    padding: 10px;
  }
  .compose-area {
    padding: 10px 14px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
  }
  .compose-box {
    padding: 5px;
    gap: 3px;
  }
  textarea {
    font-size: 16px;
  }
  .compose-hint {
    justify-content: center;
    font-size: 10px;
  }
  .compose-hint span:first-child {
    display: none;
  }
  .empty {
    margin: 8vh auto;
  }
  .message-meta {
    font-size: 11px;
  }
  dialog {
    padding: 20px;
  }
  .dialog-heading h2 {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

#activity {
  color: #b2bcc6;
  font-size: 12px;
  margin-bottom: 6px;
}
#activity:empty {
  display: none;
}
#attach {
  display: grid;
  place-items: center;
}
