:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0b0b0b;
  color: #f3f0e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

html.remotePageRoot,
body.remotePage {
  background: #0b0b0b;
  overscroll-behavior: none;
}

button,
textarea {
  font: inherit;
}

button {
  border: 1px solid #4a4a4a;
  background: #171717;
  color: #f3f0e8;
  border-radius: 6px;
  padding: 10px 13px;
  cursor: pointer;
}

button:hover {
  background: #222;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.primary {
  background: #36345f;
  border-color: #5d5790;
}

.primary:hover {
  background: #403d70;
}

.danger {
  color: #ffbeb3;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

textarea {
  width: 100%;
  border: 1px solid #333;
  border-radius: 6px;
  background: #050505;
  color: #f3f0e8;
  outline: none;
  padding: 12px;
  resize: none;
  line-height: 1.35;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  overflow-y: auto;
}

textarea:focus {
  border-color: #f3f0e8;
}

.message {
  width: 100%;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.58;
  padding: 10px 11px;
  border-radius: 6px;
  border: 1px solid #171717;
  background: #171717;
  color: #c8c8c8;
  font-weight: 400;
  overflow-wrap: anywhere;
  white-space: normal;
}

.message.user {
  align-self: flex-end;
  background: #36345f;
  border-color: #5d5790;
  color: #d0d0d0;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  transform-origin: right center;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: rgba(167, 139, 250, 0.2);
}

.message.user:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

.message.user:active,
.message.user.speechSelected {
  transform: scale(0.985);
  background: #454178;
  border-color: #8b83ca;
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.18);
}

.message.assistant {
  align-self: flex-start;
  background: transparent;
  border-color: transparent;
  color: #d1d5db;
  font-weight: 400;
}

/* Voice replies are preserved with a \"语音对话：\" prefix. Give only
   Codex's side of those exchanges a distinct green bubble; user messages
   intentionally retain their existing purple treatment. */
.message.assistant.liveVoiceAssistant {
  background: #174b35;
  border-color: #2f8a60;
  color: #e4f8ec;
}

.message.assistant.completion {
  border-color: transparent;
  background: transparent;
}

.message.assistant.thinking {
  font-size: 13px;
  line-height: 1.5;
}

.message.assistant.fullReply {
  padding: 7px 10px;
  border-left: 2px solid #52525b;
  border-radius: 0;
  background: transparent;
  color: #b9bec8;
  font-size: 12.5px;
  line-height: 1.48;
}

.message.assistant.fullReply h4 {
  margin: 0 0 6px;
  color: #d6d3d1;
  font-size: 1em;
  font-weight: 650;
}

.message.assistant.fullReply pre {
  max-height: 360px;
  overflow: auto;
  font-size: 11.5px;
}

.fullReply-reasoning .message.assistant.fullReply,
.fullReply-plan .message.assistant.fullReply {
  border-left-color: #7c6f9f;
}

.fullReply-tool-call .message.assistant.fullReply,
.fullReply-tool-output .message.assistant.fullReply,
.fullReply-mcp .message.assistant.fullReply {
  border-left-color: #64748b;
}

.fullReply-patch .message.assistant.fullReply {
  border-left-color: #4f7661;
}

.messageBlock {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 100%;
}

.messageBlock .message {
  max-width: 100%;
}

.assistantBlock {
  align-self: flex-start;
}

.userBlock {
  align-self: flex-end;
}

.userBlock .messageMeta {
  align-self: flex-end;
  text-align: right;
}

.messageMeta {
  color: #b9b3a8;
  font-size: 11px;
  line-height: 1.2;
}

.messageMetaBottom {
  padding-left: 2px;
}

.remoteLog.hideThoughts > .messageBlock.assistantBlock:not(.completionBlock),
.remoteLog.hideThoughts > .message.assistant:not(.completion),
.remoteLog.onlyMine > .messageBlock:not(.userBlock),
.remoteLog.onlyMine > .message:not(.user),
.remoteLog.hideThoughts > .remoteEvent {
  display: none;
}

.remoteLog.onlyMine > .remoteEvent {
  display: none;
}

.message p,
.message ul,
.message ol,
.message blockquote,
.message pre,
.message h1,
.message h2,
.message h3,
.message h4,
.message h5,
.message h6 {
  margin: 0 0 8px;
}

.message > :first-child {
  margin-top: 0;
}

.message > :last-child {
  margin-bottom: 0;
}

.message p {
  color: inherit;
}

.message strong,
.message b {
  color: #fde68a;
  font-weight: 800;
}

.message em,
.message i {
  color: #c4b5fd;
  font-style: italic;
}

.message del,
.message s {
  color: #9ca3af;
  text-decoration-color: #ef4444;
}

.message h1,
.message h2,
.message h3,
.message h4,
.message h5,
.message h6 {
  color: #e7e2d8;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: 0.01em;
  margin-top: 15px;
}

.message h1 {
  padding: 0 0 6px;
  border-bottom: 2px solid rgba(167, 139, 250, 0.5);
  color: #f8fafc;
  font-size: 1.55em;
}

.message h2 {
  padding: 0 0 5px;
  border-bottom: 1px solid rgba(147, 197, 253, 0.35);
  color: #ddd6fe;
  font-size: 1.38em;
}

.message h3 {
  color: #bfdbfe;
  font-size: 1.23em;
}

.message h4 {
  color: #bbf7d0;
  font-size: 1.12em;
}

.message h5 {
  color: #fde68a;
  font-size: 1.04em;
}

.message h6 {
  color: #cbd5e1;
  font-size: 0.96em;
}

.message h4.messageSectionTitle {
  margin: 12px 0 7px;
  padding: 2px 0 2px 9px;
  border-left: 3px solid #8b5cf6;
  color: #c4b5fd;
  font-size: 1.1em;
  line-height: 1.35;
}

.message ul,
.message ol {
  padding: 7px 10px 7px 29px;
  border-left: 2px solid rgba(139, 92, 246, 0.55);
  border-radius: 0 6px 6px 0;
  background: transparent;
}

.message li::marker {
  color: #a78bfa;
  font-weight: 800;
}

.message li + li {
  margin-top: 5px;
}

.message .markdownListDepth1 {
  margin-left: 14px;
}

.message .markdownListDepth2 {
  margin-left: 28px;
}

.message .markdownListDepth3 {
  margin-left: 42px;
}

.message .markdownTaskItem {
  list-style: none;
}

.markdownTaskMark {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin: 0 6px 0 -20px;
  border: 1px solid #64748b;
  border-radius: 3px;
  color: #052e16;
  font-size: 10px;
  line-height: 1;
  vertical-align: -1px;
}

.markdownTaskMark.checked {
  border-color: #4ade80;
  background: transparent;
  color: #4ade80;
}

.message blockquote {
  padding: 8px 10px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-left: 3px solid #60a5fa;
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: #dbeafe;
}

.markdownCalloutTitle {
  color: #bfdbfe;
  font-weight: 800;
}

.markdownCalloutBody:not(:first-child) {
  margin-top: 4px;
}

.markdownCallout-tip {
  border-color: rgba(74, 222, 128, 0.24) !important;
  border-left-color: #4ade80 !important;
  background: transparent !important;
}

.markdownCallout-tip .markdownCalloutTitle {
  color: #86efac;
}

.markdownCallout-important {
  border-color: rgba(167, 139, 250, 0.26) !important;
  border-left-color: #a78bfa !important;
  background: transparent !important;
}

.markdownCallout-important .markdownCalloutTitle {
  color: #c4b5fd;
}

.markdownCallout-warning,
.markdownCallout-caution {
  border-color: rgba(251, 191, 36, 0.24) !important;
  border-left-color: #fbbf24 !important;
  background: transparent !important;
}

.markdownCallout-warning .markdownCalloutTitle,
.markdownCallout-caution .markdownCalloutTitle {
  color: #fde68a;
}

.message code {
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fcd34d;
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 1px 4px;
}

.message pre {
  background: transparent;
  border: 1px solid #334155;
  color: #dbeafe;
  border-radius: 6px;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px;
}

.message pre code {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  display: block;
  padding: 0;
  white-space: pre;
}

.message .markdownTable {
  color: #d1fae5;
}

.message .markdownDivider {
  height: 1px;
  margin: 12px 0;
  border: 0;
  background: linear-gradient(90deg, transparent, #6d5ea8 15%, #6d5ea8 85%, transparent);
}

.messageLead {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1.08em;
  line-height: 1.4;
}

.messageLeadIcon {
  flex: 0 0 auto;
}

.messageLeadText {
  min-width: 0;
  font-weight: 800;
}

.messageLead-success {
  border-color: transparent;
  background: transparent;
  color: #bbf7d0;
}

.messageLead-thinking {
  border-color: transparent;
  background: transparent;
  color: #ddd6fe;
}

.messageLead-thinking .messageLeadText {
  font-weight: 400;
}

.message.assistant.thinking .messageLead {
  font-size: 1em;
}

.messageLead-warning {
  border-color: transparent;
  background: transparent;
  color: #fecaca;
}

.messageLead-info {
  border-color: transparent;
  background: transparent;
  color: #bfdbfe;
}

.message a {
  color: #93c5fd;
  font-weight: 650;
  text-decoration-color: rgba(147, 197, 253, 0.55);
  text-underline-offset: 2px;
}

.imageLink {
  display: block;
  margin: 4px 0;
}

.messageImage {
  display: block;
  max-width: min(100%, 420px);
  max-height: 320px;
  border: 1px solid #2f2f2f;
  border-radius: 6px;
  object-fit: contain;
  background: #050505;
}

.messageImage:hover {
  border-color: #777;
}

.remoteApp {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #0b0b0b;
  overflow: hidden;
}

.remoteTop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 4px 10px;
  border-bottom: 1px solid #2f2f2f;
  background: #111;
  position: sticky;
  top: 0;
  z-index: 8;
}

.remoteTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.remoteMetaStack {
  display: grid;
  grid-template-rows: 15px 13px;
  align-content: center;
  min-width: 0;
  line-height: 1;
  overflow: visible !important;
}

.remoteSubline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: visible !important;
}

.remoteTop span {
  color: #b9b3a8;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#remoteMeta {
  color: #f3f0e8;
  font-size: 13px;
  font-weight: 600;
  line-height: 15px;
}

.remoteMode {
  color: #8f8a82 !important;
  font-size: 10px !important;
  line-height: 13px;
}

.remoteStatusIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}
.remoteStatusIcon.status-connecting {
  color: #3b82f6;
}
.remoteStatusIcon.status-running {
  color: #ef4444;
}
.remoteStatusIcon.status-idle {
  color: #22c55e;
}

.queueWrap {
  position: relative;
  flex: 0 0 auto;
  overflow: visible !important;
}

.queueButton {
  min-height: 16px;
  padding: 1px 6px;
  border-color: #7c3aed;
  background: rgba(49, 46, 129, 0.75);
  color: #f3f0e8;
  font-size: 10px;
  line-height: 1.2;
}

.queueButton[hidden] {
  display: none;
}

.queuePanel {
  position: absolute;
  top: 22px;
  left: 0;
  z-index: 15;
  width: min(420px, calc(100vw - 24px));
  max-height: min(320px, calc(100vh - 120px));
  overflow: auto;
  border: 1px solid #333;
  border-radius: 6px;
  background: #111;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  padding: 8px;
}

.queuePanel span {
  overflow: visible;
  text-overflow: clip;
  white-space: pre-wrap;
}

.queuePanel[hidden] {
  display: none;
}

.queueItem {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #2f2f2f;
  color: #f3f0e8;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.queueItem:last-child {
  border-bottom: 0;
}

.queueIndex {
  color: #b9b3a8;
}

.topActions {
  display: flex !important;
  flex-direction: row;
  gap: 4px;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.topActions button {
  white-space: nowrap;
}

.iconButton {
  width: 42px;
  min-width: 42px;
  height: 38px;
  min-height: 38px;
  padding-left: 0;
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.iconButton.active {
  border-color: #d8c36a;
  background: #3b3520;
  color: #fff2a8;
}

.topActions .iconButton svg {
  width: 16px;
  height: 16px;
}

.topActions .iconButton {
  width: 34px;
  min-width: 34px;
  height: 32px;
  min-height: 32px;
}

.threadPanel,
.filePanel {
  position: fixed;
  inset: 58px 12px auto auto;
  z-index: 10;
  width: min(520px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 84px));
  overflow: auto;
  border: 1px solid #333;
  border-radius: 6px;
  background: #111;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  padding: 10px;
}

.filePanel {
  width: min(760px, calc(100vw - 24px));
}

.modelSettingsPanel {
  width: min(620px, calc(100vw - 24px));
}

.usagePanel {
  width: min(500px, calc(100vw - 24px));
}

.usageContent {
  display: grid;
  gap: 14px;
}

.usageCard {
  overflow: hidden;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: #202020;
}

.usageQuota {
  display: grid;
  gap: 8px;
  padding: 14px 15px;
}

.usageQuota + .usageQuota {
  border-top: 1px solid #3a3a3a;
}

.usageQuota strong,
.usageResetHead strong,
.usageResetBody strong {
  color: #f3f0e8;
  font-size: 14px;
}

.usageQuotaRow {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) minmax(80px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
}

.usageQuotaRow span,
.usageResetBody small {
  color: #b9b3a8;
  font-size: 13px;
}

.usageProgress {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #444;
}

.usageProgress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f4f4f4;
}

.usageRemaining {
  white-space: nowrap;
}

.usageResetHead,
.usageResetBody,
.usageResetItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
}

.usageResetHead {
  cursor: pointer;
  list-style: none;
}

.usageResetHead::-webkit-details-marker {
  display: none;
}

.usageResetHead::after {
  content: "⌄";
  color: #b9b3a8;
  font-size: 18px;
  line-height: 1;
}

.usageResetCard[open] .usageResetHead::after {
  transform: rotate(180deg);
}

.usageResetCard[open] .usageResetHead {
  border-bottom: 1px solid #3a3a3a;
}

.usageResetBody {
  align-items: end;
}

.usageResetBody > div {
  display: grid;
  gap: 5px;
}

.usageResetList {
  display: grid;
  align-items: stretch;
  padding: 0;
}

.usageResetItem {
  align-items: end;
}

.usageResetItem + .usageResetItem {
  border-top: 1px solid #3a3a3a;
}

.usageBadge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #177a35;
  color: #ecfff0;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 700;
}

.usageResetButton {
  min-height: 30px;
  border-color: #f2f2f2;
  background: #f2f2f2;
  color: #202020;
  padding: 5px 11px;
  font-size: 13px;
}

.usageResetButton:hover {
  background: #fff;
}

.usageResetButton:disabled {
  cursor: default;
  opacity: .5;
}

.modelSettingsCurrent {
  border: 1px solid #3f3f46;
  border-radius: 6px;
  background: #171717;
  color: #f3f0e8;
  padding: 11px 13px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.modelSettingsSection {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.modelSettingsLabel {
  color: #b9b3a8;
  font-size: 12px;
  font-weight: 700;
}

.modelSettingsModels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.modelOption {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
  padding: 10px 12px;
  border-color: #3f3f46;
  background: #171717;
}

.modelOption:hover,
.effortOption:hover {
  background: #222;
}

.modelOption.active,
.effortOption.active {
  border-color: #f3f0e8;
  background: #292929;
  box-shadow: inset 3px 0 0 #f3f0e8;
}

.modelOption.active:disabled,
.effortOption.active:disabled {
  cursor: default;
  opacity: 1;
}

.modelOption strong,
.modelOption small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modelOption strong {
  white-space: nowrap;
}

.modelOption small {
  color: #b9b3a8;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.modelSettingsEfforts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.effortOption {
  min-height: 36px;
  padding: 7px 12px;
  border-color: #3f3f46;
  background: #171717;
}

.modelSettingsPanel > .remoteEvent:empty {
  display: none;
}

.modelSettingsPanel > .remoteEvent {
  margin-top: 10px;
}

.threadPanelTop,
.filePanelTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 4px 2px 10px;
}

.panelActions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filePanelTop .panelActions,
.threadPanelTop .panelActions {
  gap: 4px;
}

#filePanel > .filePanelTop > .panelActions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filePanelTop .panelActions button,
.threadPanelTop .panelActions button {
  min-height: 29px;
  padding: 4px 11px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
}

.projectUploadPicker {
  position: relative;
}

.projectUploadMenu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 12;
  display: grid;
  gap: 4px;
  width: max-content;
  min-width: 112px;
  padding: 5px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #111;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
}

.projectUploadMenu[hidden] {
  display: none;
}

.projectUploadMenu button {
  width: 100%;
  text-align: left;
}

.sshConnectForm .panelActions button,
#sshFilesView > .panelActions button {
  min-height: 29px;
  padding: 4px 11px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
}

.threadList,
.fileList {
  display: grid;
  gap: 8px;
}

.filePath {
  color: #b9b3a8;
  font-size: 12px;
  padding: 0 2px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projectUploadStatus {
  margin: 0 2px 9px;
  padding: 7px 9px;
  border: 1px solid #3f4650;
  border-radius: 6px;
  color: #c6cbd3;
  font-size: 12px;
  line-height: 1.4;
}

.projectUploadStatus[hidden] {
  display: none;
}

.projectUploadStatus.success {
  border-color: #3f6650;
  color: #a9d5b8;
}

.projectUploadStatus.error {
  border-color: #75453f;
  color: #ffbeb3;
}

.fileItem {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  width: 100%;
  align-items: center;
  text-align: left;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  background: #171717;
  color: #f3f0e8;
  padding: 10px 13px;
  cursor: pointer;
}

.fileItem.sshFileItem {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.fileActions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.fileActions button {
  min-height: 29px;
  padding: 4px 9px;
  font-size: 13px;
  line-height: 1;
}

.fileItem:hover {
  background: #222;
}

.fileItem strong,
.fileItem small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fileItem small {
  color: #b9b3a8;
  font-size: 9px;
  line-height: 1;
}

.connectorList,
.connectorJobs {
  display: grid;
  gap: 8px;
}

.connectorItem {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-color: #3f3f46;
  background: #171717;
}

.connectorItem.active {
  border-color: #f3f0e8;
  background: #222;
}

.connectorDot {
  grid-row: span 3;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #737373;
}

.connectorItem.online .connectorDot {
  background: #22c55e;
}

.connectorItem strong,
.connectorItem small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connectorItem small {
  color: #b9b3a8;
  font-size: 10px;
}

.connectorRow {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.connectorRow .connectorItem {
  flex: 1 1 auto;
  min-width: 0;
}
.connectorRemarkBtn {
  flex: 0 0 auto;
  align-self: center;
  padding: 0 12px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #3f3f46;
  background: #171717;
  color: #d4d4d8;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.connectorRemarkBtn:hover {
  border-color: #f3f0e8;
  background: #222;
  color: #f3f0e8;
}

.connectorJobForm {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding-top: 10px;
  border-top: 1px solid #2f2f2f;
}

.connectorJobForm label {
  display: grid;
  gap: 5px;
  color: #b9b3a8;
  font-size: 11px;
}

.connectorJobForm textarea {
  min-height: 88px;
  resize: vertical;
}

.connectorJobForm button {
  min-height: 32px;
}

.connectorJob {
  display: grid;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #141414;
}

.connectorJob.completed {
  border-color: rgba(34, 197, 94, 0.55);
}

.connectorJob.failed {
  border-color: rgba(239, 68, 68, 0.7);
}

.connectorJob strong,
.connectorJob small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connectorJob small {
  color: #b9b3a8;
  font-size: 10px;
}

.connectorJob pre {
  max-height: 160px;
  overflow: auto;
  margin: 0;
  padding: 8px;
  border-radius: 4px;
  background: #050505;
  color: #e7e5e4;
  white-space: pre-wrap;
  word-break: break-word;
}

.folderDeleteButton {
  min-height: 26px;
  padding: 3px 8px;
  border-color: #7f1d1d;
  background: rgba(127, 29, 29, 0.42);
  color: #fecaca;
}

.filePreview {
  margin-top: 10px;
  border-top: 1px solid #2f2f2f;
  padding-top: 10px;
}

.filePreview[hidden] {
  display: none;
}

.filePreviewTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.filePreviewTop strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.filePreview pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid #2f2f2f;
  border-radius: 6px;
  background: #050505;
  white-space: pre-wrap;
}

.filePreview img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid #2f2f2f;
  border-radius: 6px;
  background: #050505;
}

.newSessionActions {
  position: sticky;
  bottom: -10px;
  display: grid;
  gap: 8px;
  margin: 10px -10px -10px;
  padding: 10px;
  border-top: 1px solid #2f2f2f;
  background: #111;
}

.newSessionActions button {
  width: 100%;
  min-height: 29px;
  padding: 4px 11px;
  font-size: 13px;
  line-height: 1;
}

.threadRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
}

.threadItem {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  font-size: 10px;
}

.threadItem strong {
  font-size: 12px;
}

.threadItem.active {
  border-color: #60a5fa;
  background: #111827;
  box-shadow: inset 3px 0 0 #60a5fa, 0 0 0 1px rgba(96, 165, 250, 0.28);
}

.threadItem.running {
  border-color: #ef4444;
  background: rgba(127, 29, 29, 0.78);
  box-shadow: inset 3px 0 0 #ef4444;
}

.threadItem.running.active {
  border-color: #60a5fa;
  background: rgba(153, 27, 27, 0.86);
  box-shadow: inset 3px 0 0 #60a5fa, 0 0 0 1px rgba(96, 165, 250, 0.38);
}

.threadItem.completedUnread {
  border-color: #22c55e;
  background: rgba(20, 83, 45, 0.82);
}

.threadItem.completedUnread.active {
  border-color: #60a5fa;
  background: rgba(22, 101, 52, 0.88);
  box-shadow: inset 3px 0 0 #60a5fa, 0 0 0 1px rgba(96, 165, 250, 0.38);
}

.threadItem strong,
.threadItem small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.threadItem small {
  color: #b9b3a8;
  font-size: 9px;
}

.threadPath {
  color: #9a9a9a !important;
}

.threadActions {
  display: flex;
  gap: 5px;
  align-items: stretch;
}

.threadAction {
  min-width: 39px;
  padding: 6px 7px;
  font-size: 9px;
  white-space: nowrap;
}

.remoteLogWrap {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: none;
  position: relative;
  background: #0b0b0b;
}

.remoteLog {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px;
}

.loadMoreMessages {
  display: block;
  margin: 10px auto 0;
  min-height: 32px;
  padding: 6px 12px;
  color: #f3f0e8;
  background: #111;
  border-color: #4a4a4a;
}

.loadMoreMessages[hidden] {
  display: none;
}

.scrollJumpLayer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  pointer-events: none;
}

.scrollJump {
  position: absolute;
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  transform: translate3d(-50%, 0, 0);
  opacity: 0.5;
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(49, 46, 129, 0.5);
  color: #f3f0e8;
  font-size: 0;
  line-height: 0;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.scrollJumpIcon {
  display: block;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.scrollJump:hover {
  opacity: 0.7;
}

.scrollJumpTop {
  top: 76px;
}

.scrollJumpBottom {
  bottom: 76px;
}

.scrollJump[hidden] {
  display: none;
}

.remoteEvent {
  align-self: center;
  max-width: 92%;
  color: #b9b3a8;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.speechFeedback {
  position: fixed;
  left: 50%;
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 68px));
  z-index: 30;
  max-width: min(88vw, 520px);
  padding: 8px 12px;
  border: 1px solid rgba(139, 131, 202, 0.8);
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.94);
  color: #eeeaff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
  animation: speechFeedbackIn 140ms ease-out;
}

@keyframes speechFeedbackIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .message.user { transition: none; }
  .speechFeedback { animation: none; }
}

.remoteComposer {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: end;
  gap: 8px;
  padding: 4px 10px;
  border-top: 1px solid #2f2f2f;
  background: #111;
  position: sticky;
  bottom: 0;
  z-index: 8;
}

.remoteComposer textarea {
  height: 38px;
  min-height: 38px;
  max-height: 180px;
  padding-top: 8px;
  padding-bottom: 8px;
  caret-color: #f3f0e8;
}

.remoteComposer textarea::-webkit-scrollbar {
  display: none;
}
.remoteComposer textarea {
  scrollbar-width: none;
}

.remoteComposer button {
  height: 38px;
  min-height: 38px;
}

.remoteComposer > .primary {
  min-width: 42px;
}

.fileButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.uploadList {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.uploadList[hidden] {
  display: none;
}

.uploadChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 3px 4px 3px 7px;
  color: #f3f0e8;
  background: #111;
  font-size: 12px;
}

.uploadChipText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploadRemove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border-color: #4a4a4a;
  color: #ffbeb3;
  background: transparent;
  line-height: 1;
}

.uploadRemove:hover {
  background: #4a2f2a;
}

.commandPicker {
  position: relative;
  align-self: end;
  width: 38px;
}

.commandQuickList {
  display: block;
  width: 38px;
}

.commandQuickList button {
  min-width: 38px;
  white-space: nowrap;
  min-height: 38px;
}

.slashButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding-left: 0 !important;
  padding-right: 0 !important;
  font-weight: 800;
  font-size: 16px;
  background: #111;
  border-color: #4a4a4a;
}

.commandQuick {
  color: #f3f0e8;
}

.commandMenu {
  position: absolute;
  left: 0;
  bottom: 44px;
  z-index: 14;
  width: min(520px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 120px));
  overflow: auto;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  padding: 10px;
}

.commandMenuTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 4px 2px 10px;
}

.commandMenuTop span {
  color: #b9b3a8;
  font-size: 12px;
}

.commandList {
  display: grid;
  gap: 8px;
}

.commandItem {
  display: grid;
  grid-template-columns: 96px 68px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  align-items: center;
  text-align: left;
  min-width: 0;
  overflow: hidden;
}

.commandItem > * {
  min-width: 0;
}

.commandItem strong {
  color: #f3f0e8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commandItem span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commandItem small {
  color: #b9b3a8;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.loginBody {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background: radial-gradient(circle at top, #171717, #0b0b0b 58%);
}

.loginShell {
  width: min(420px, 100%);
}

.loginCard {
  display: grid;
  gap: 14px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #111;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  padding: 26px;
}

.loginIcon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #4a4a4a;
  border-radius: 10px;
  background: #171717;
  font-size: 24px;
}

.loginCard h1 {
  font-size: 24px;
}

.loginCard p {
  margin: 0;
  color: #b9b3a8;
  line-height: 1.5;
}

.loginInput {
  width: 100%;
  min-height: 44px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #050505;
  color: #f3f0e8;
  outline: none;
  padding: 0 12px;
  font: inherit;
}

.loginInput:focus {
  border-color: #f3f0e8;
}

.sshConnectForm {
  display: grid;
  gap: 12px;
}

.sshConnectForm[hidden],
#sshFilesView[hidden] {
  display: none !important;
}

.sshConnectForm label {
  display: grid;
  gap: 6px;
  color: #b9b3a8;
  font-size: 12px;
}

.sshEditor {
  display: grid;
  gap: 8px;
}

.sshEditor textarea {
  min-height: 240px;
}

.loginSubmit {
  min-height: 44px;
}

.loginError {
  border: 1px solid rgba(255, 190, 179, 0.45);
  border-radius: 6px;
  background: rgba(120, 40, 32, 0.22);
  color: #ffbeb3;
  padding: 10px 12px;
}

.loginError[hidden] {
  display: none;
}

@media (max-width: 700px) {
  :root {
    --mobile-top-height: 47px;
    --mobile-composer-min-height: 47px;
    --mobile-composer-height: 47px;
    --keyboard-offset: 0px;
    --visual-viewport-top: 0px;
    --visual-viewport-height: 100dvh;
  }

  html.remotePageRoot {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body.remotePage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .message {
    max-width: 100%;
  }

  .remoteApp {
    position: fixed;
    top: var(--visual-viewport-top);
    right: 0;
    left: 0;
    display: grid;
    grid-template-rows: var(--mobile-top-height) minmax(0, 1fr) auto;
    width: 100%;
    height: var(--visual-viewport-height);
    padding: 0;
  }

  .remoteTop {
    position: relative;
    inset: auto;
    grid-row: 1;
    min-height: var(--mobile-top-height);
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topActions {
    gap: 3px;
  }

  .iconButton {
    width: 38px;
    min-width: 38px;
  }

  .topActions .iconButton {
    width: 32px;
    min-width: 32px;
    height: 30px;
    min-height: 30px;
  }

  .threadPanel,
  .filePanel {
    inset: calc(var(--visual-viewport-top) + var(--mobile-top-height) + 8px) 8px auto 8px;
    width: auto;
    max-height: calc(var(--visual-viewport-height) - var(--mobile-top-height) - 18px);
  }

  .remoteLogWrap {
    grid-row: 2;
    height: auto;
    min-height: 0;
    overflow: auto;
  }

  .remoteComposer {
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    position: relative;
    inset: auto;
    grid-row: 3;
    min-height: var(--mobile-composer-min-height);
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }

  .scrollJumpLayer {
    position: absolute;
    inset: 0;
  }

  .scrollJumpTop {
    top: calc(var(--mobile-top-height) + 14px);
  }

  .scrollJumpBottom {
    bottom: calc(var(--mobile-composer-height) + 14px);
  }

  .speechFeedback {
    bottom: calc(var(--mobile-composer-height) + var(--keyboard-offset) + env(safe-area-inset-bottom) + 12px);
  }

  .commandMenu {
    width: calc(100vw - 24px);
    max-height: calc(var(--visual-viewport-height) - var(--mobile-top-height) - var(--mobile-composer-height) - 28px);
  }

  .commandItem {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .commandItem small {
    grid-column: 1 / -1;
  }

  .modelSettingsModels {
    grid-template-columns: 1fr;
  }

  #filePanel > .filePanelTop {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  #filePanel > .filePanelTop > .panelActions {
    justify-content: flex-start;
  }

  .fileItem.sshFileItem {
    align-items: start;
    gap: 6px;
    padding: 9px 10px;
  }

  .fileActions {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 4px;
  }

  .fileActions button {
    min-height: 27px;
    padding: 3px 7px;
    font-size: 12px;
  }
}
