:root {
  color-scheme: light;
  --ink: #182b40;
  --muted: #5a6c7b;
  --paper: #f6f7f4;
  --navy: #123b64;
  --blue: #135db6;
  --line: #d9e1e6;
  --terminal: #0b1623;
  font-family: "Avenir Next", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: var(--app-height, 100dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
main {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  min-height: 44px;
  padding: 8px 14px;
  font-weight: 600;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
input:focus,
textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
a {
  color: inherit;
}
h1,
h2,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.masthead {
  flex: none;
  height: 76px;
  padding: 12px max(22px, env(safe-area-inset-right)) 12px
    max(22px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.chat-open .masthead {
  display: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 22px;
  letter-spacing: -0.7px;
}
.brand b {
  font-weight: 400;
  color: var(--muted);
}
.brand img {
  border-radius: 12px;
}
.quiet {
  color: var(--muted);
  font-size: 13px;
}
.notice {
  flex: none;
  padding: 12px 22px;
  background: #fff1d4;
  color: #624207;
  font-size: 14px;
  line-height: 1.5;
  border-bottom: 1px solid #e7d5a5;
}
.primary {
  background: var(--blue);
  color: white;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.primary:hover {
  background: var(--navy);
}
.pairing {
  max-width: 460px;
  padding: 44px 26px 28px;
  margin: auto;
}
.pairing h1 {
  font-size: 38px;
  line-height: 1.25;
  letter-spacing: -1.6px;
  margin: 24px 0 16px;
  font-weight: 650;
}
.lead {
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}
.pairing form {
  margin-top: 32px;
  display: grid;
  gap: 12px;
}
.pairing label {
  font-weight: 600;
  font-size: 14px;
}
.pairing input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #b7c5d1;
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
}
.pairing .primary {
  padding: 15px 18px;
  font-size: 16px;
}
.pair-footnote {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin: 20px 0;
}
.pairing details {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.pairing summary {
  cursor: pointer;
  min-height: 32px;
}
.pairing code {
  font-size: 12px;
}
.pair-visual {
  height: 90px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
}
.desktop-shape {
  width: 134px;
  height: 82px;
  border: 2px solid var(--navy);
  border-radius: 7px;
  padding: 10px 13px;
  display: block;
  position: relative;
  background: #fff;
}
.desktop-shape:after {
  content: "";
  position: absolute;
  width: 52px;
  bottom: -9px;
  left: 39px;
  border-bottom: 3px solid var(--navy);
}
.desktop-shape span {
  position: absolute;
  font: 28px monospace;
  top: 6px;
  left: 12px;
}
.desktop-shape i {
  display: block;
  height: 4px;
  background: #c3d4e3;
  border-radius: 2px;
  margin: 8px 0 0 22px;
  width: 57px;
}
.desktop-shape i:nth-of-type(2) {
  width: 40px;
  background: var(--blue);
}
.desktop-shape i:nth-of-type(3) {
  width: 62px;
}
.connection-line {
  width: 46px;
  border-top: 2px dashed #809fb9;
}
.phone-shape {
  height: 74px;
  width: 40px;
  border: 2px solid var(--navy);
  border-radius: 9px;
  text-align: center;
  padding-top: 12px;
  font: 32px monospace;
  background: #fff;
}
.workspace {
  display: grid;
  grid-template-columns: 350px 1fr;
  height: 100%;
  max-width: 1500px;
  margin: auto;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  padding: 25px 20px 8px;
}
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.host {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin-bottom: 7px;
}
.list-heading h1 {
  font-size: 29px;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.list-heading h1 span {
  font-size: 14px;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
  background: #e5ebed;
  border-radius: 20px;
  padding: 3px 9px;
}
.icon-button {
  font-size: 25px;
  padding: 6px;
  min-width: 44px;
  border-radius: 9px;
}
.icon-button:hover {
  background: #e5ebed;
}
.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46745d;
  flex: none;
}
.dot.offline {
  background: #ad6b16;
}
.search-label {
  display: block;
  margin: 20px 0 14px;
}
.search-label input {
  background: #fff;
  width: 100%;
  padding: 11px 13px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 16px;
}
.sessions {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.project-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 18px 9px 8px;
}
.session-card {
  display: flex;
  width: 100%;
  gap: 12px;
  text-align: left;
  border-radius: 10px;
  align-items: center;
  margin-bottom: 3px;
  padding: 14px 10px;
}
.session-card:hover {
  background: #e9edf0;
}
.session-card.selected {
  background: #e2eaf3;
}
.session-glyph {
  width: 35px;
  height: 35px;
  flex: none;
  border: 1px solid #c0cfdb;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-family: Menlo, monospace;
  font-weight: 600;
  font-size: 13px;
  background: #fff;
}
.session-copy {
  min-width: 0;
  flex: 1;
}
.session-name {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-meta {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-chevron {
  color: #71889b;
  font-size: 20px;
}
.list-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  padding: 10px;
}
.logout {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 14px;
  flex: none;
}
.empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}
.empty > span {
  font-size: 50px;
  color: #8ba4bb;
  margin-bottom: 20px;
}
.empty h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 14px;
}
.empty p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}
.detail {
  min-width: 0;
  min-height: 0;
  background: #fff;
}
.session-view {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.session-options {
  flex: none;
}
.session-options > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: calc(100% - 76px);
  min-height: 44px;
  margin: 8px 18px 8px auto;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f0f3f5;
  list-style: none;
  font-size: 12px;
  cursor: pointer;
}
.session-options > summary::-webkit-details-marker {
  display: none;
}
#focus-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.focus-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #46745d;
}
body:has(#connection-dot.offline) .focus-dot {
  background: #ad6b16;
}
.session-options[open] .expand-icon {
  transform: rotate(180deg);
}
.focus-back {
  position: absolute;
  top: 8px;
  left: 8px;
}
.session-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  min-height: 84px;
  flex: none;
  border-bottom: 1px solid var(--line);
}
.session-heading > div {
  min-width: 0;
  flex: 1;
}
.session-heading p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.session-heading h2 {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent {
  font-size: 11px;
  padding: 5px 9px;
  background: #edf1f4;
  border-radius: 5px;
  color: var(--muted);
  max-width: 85px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#back {
  display: none;
}
.output-toolbar {
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  flex: none;
  font-size: 11px;
  gap: 10px;
  border-bottom: 1px solid #edf1f4;
}
.output-toolbar button {
  font-size: 12px;
  white-space: nowrap;
}
.output-toolbar button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px #182b4014;
}
.view-switch {
  display: flex;
  background: #edf1f4;
  border-radius: 12px;
  padding: 3px;
}
.view-switch button {
  border-radius: 9px;
  min-width: 64px;
}
.conversation {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px max(24px, calc((100% - 720px) / 2));
  overscroll-behavior: contain;
  scroll-padding: 24px;
}
.user-message {
  max-width: 85%;
  width: fit-content;
  margin: 0 0 24px auto;
}
.user-message p {
  border-radius: 20px 20px 5px 20px;
  background: #edf2f6;
  padding: 14px 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.65;
}
.message-state {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  padding-top: 6px;
}
.message-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-size: 13px;
  margin-bottom: 14px;
}
.orca-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  border-radius: 50%;
}
#screen-status {
  font-size: 11px;
  color: var(--muted);
}
.output-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 18px;
}
.output {
  overflow: auto;
  margin: 0;
  padding: 0;
  font:
    16px/1.8 "Avenir Next",
    "PingFang SC",
    system-ui,
    sans-serif;
  tab-size: 4;
  overscroll-behavior: contain;
}
.output.wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.session-view:not(.terminal-mode) .output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.terminal-mode .conversation {
  background: var(--terminal);
  color: #dce6ef;
  padding: 18px 22px;
}
.terminal-mode .output {
  font:
    13px/1.75 "SFMono-Regular",
    Menlo,
    Consolas,
    monospace;
}
.terminal-mode #sent-messages,
.terminal-mode .output-note,
.terminal-mode .message-heading {
  display: none;
}
.latest {
  position: absolute;
  right: 24px;
  bottom: 204px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 4px 14px #182b4014;
  font-size: 12px;
}
.composer {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px max(16px, env(safe-area-inset-bottom));
  flex: none;
  background: #fff;
}
.terminal-tools summary {
  width: fit-content;
  min-height: 40px;
  padding: 12px 0;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.key-row {
  display: flex;
  gap: 4px;
  padding: 6px 0;
  justify-content: space-between;
}
.key-row button {
  min-width: 40px;
  font-size: 12px;
  color: var(--muted);
  padding: 5px 10px;
}
.key-row button:hover {
  background: #edf1f4;
  border-radius: 7px;
}
.key-row .interrupt {
  color: #9b463a;
  margin-left: auto;
}
.composer textarea {
  display: block;
  width: 100%;
  border: 1px solid #c0cfdb;
  border-radius: 18px;
  resize: none;
  max-height: 25dvh;
  min-height: 64px;
  padding: 12px 64px 12px 16px;
  font-size: 16px;
  line-height: 1.5;
  background: #fafcfd;
  color: var(--ink);
}
.message-input {
  position: relative;
}
.send-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}
.send-button:hover:not(:disabled) {
  background: var(--navy);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 390px;
  width: calc(100% - 36px);
  padding: 26px;
  color: var(--ink);
}
dialog::backdrop {
  background: #0b162380;
}
dialog h2 {
  font-size: 22px;
}
dialog p {
  line-height: 1.8;
  font-size: 14px;
  color: var(--muted);
  margin: 18px 0;
}
dialog .primary {
  width: 100%;
  justify-content: center;
}
@media (min-width: 701px) {
  .workspace.session-open.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .workspace.session-open.sidebar-collapsed .sidebar {
    display: none;
  }
}
@media (max-width: 700px) {
  #toggle-sidebar {
    display: none;
  }
  .masthead {
    height: 65px;
    padding-left: 20px;
    padding-right: 16px;
  }
  .brand {
    font-size: 20px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .workspace {
    display: block;
  }
  .sidebar {
    height: 100%;
    border-right: 0;
    padding: 24px 18px max(10px, env(safe-area-inset-bottom));
  }
  .detail {
    display: none;
    height: 100%;
  }
  .workspace.session-open .sidebar {
    display: none;
  }
  .workspace.session-open .detail {
    display: block;
  }
  #back {
    display: block;
  }
  .session-heading {
    padding: 12px 14px 12px 8px;
    min-height: 78px;
  }
  .session-heading h2 {
    font-size: 15px;
  }
  .session-heading .agent {
    max-width: 62px;
  }
  .conversation {
    padding: 22px 18px;
  }
  .output-toolbar {
    padding: 6px 16px;
  }
  .composer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .view-hint {
    font-size: 10px;
  }
  .latest {
    right: 18px;
    bottom: 190px;
  }
  .pairing {
    padding-top: 38px;
  }
  .pairing h1 {
    font-size: 36px;
  }
  .session-card {
    padding: 15px 10px;
  }
  .session-name {
    font-size: 15px;
  }
}
@media (max-width: 700px) and (max-height: 480px) {
  .masthead {
    height: 48px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .brand img {
    width: 28px;
    height: 28px;
  }
  .session-heading {
    min-height: 58px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .key-row {
    padding: 0;
  }
  .composer {
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .composer textarea {
    min-height: 60px;
    height: 60px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background 0.12s ease;
  }
}
