.mobile-shell {
  --mobile-bg: #101110;
  --mobile-panel: #171915;
  --mobile-rail: #20231d;
  --mobile-border: rgba(215, 208, 197, 0.18);
  --mobile-soft: #cfc8ba;
  --mobile-muted: #9c9488;
  --mobile-accent: #d7ff63;
  --mobile-blue: #7db7ff;
  --mobile-red: #ff6b5f;
  --mobile-green: #78dc91;
  --chat-font-size: 13px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  height: 100dvh;
  min-width: 0;
  background: var(--mobile-bg);
  color: var(--ink);
  overflow: hidden;
}

.mobile-auth-shell {
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 18px;
}

.mobile-auth-card {
  display: grid;
  gap: 18px;
  width: min(100%, 430px);
  border: 1px solid var(--mobile-border);
  background: var(--mobile-panel);
  padding: 20px;
}

.mobile-brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(215, 255, 99, 0.42);
  background: rgba(215, 255, 99, 0.1);
  color: var(--mobile-accent);
}

.mobile-auth-card h1,
.mobile-section-title h2,
.mobile-sheet h2,
.mobile-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.mobile-auth-card p,
.mobile-card h3,
.mobile-row span,
.mobile-task-row span,
.mobile-topbar span,
.mobile-message-role,
.mobile-info-line span,
.mobile-empty-row,
.mobile-upload-error {
  color: var(--mobile-muted);
  font-size: 12px;
}

.mobile-topbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  border-bottom: 1px solid var(--mobile-border);
  background: rgba(23, 25, 21, 0.98);
}

.mobile-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mobile-session-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mobile-session-title-button {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--mobile-blue);
  padding: 0;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mobile-session-title-button svg {
  flex: 0 0 auto;
  margin-right: 5px;
}

.mobile-session-title-button span {
  color: var(--mobile-blue);
  font-size: 12px;
}

.mobile-session-title-button:disabled {
  color: var(--mobile-muted);
  text-decoration: none;
}

.mobile-session-title-button:disabled span {
  color: var(--mobile-muted);
}

.mobile-session-title-row > .mobile-state-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.mobile-title strong,
.mobile-title span,
.mobile-row-main strong,
.mobile-row-main span,
.mobile-attachment-tile span,
.mobile-info-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-state-dot span {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--mobile-muted);
  box-shadow: 0 0 0 3px rgba(156, 148, 136, 0.13);
}

.mobile-state-dot.active span,
.mobile-state-dot.busy span,
.mobile-state-dot.pending span,
.mobile-state-dot.queued span,
.mobile-state-dot.running span,
.mobile-state-dot.sending span,
.mobile-state-dot.waiting span {
  background: var(--mobile-blue);
  box-shadow: 0 0 0 3px rgba(125, 183, 255, 0.15);
}

.mobile-state-dot.completed span,
.mobile-state-dot.done span {
  background: var(--mobile-green);
  box-shadow: 0 0 0 3px rgba(120, 220, 145, 0.15);
}

.mobile-state-dot.canceled span,
.mobile-state-dot.cancelling span,
.mobile-state-dot.error span,
.mobile-state-dot.failed span {
  background: var(--mobile-red);
  box-shadow: 0 0 0 3px rgba(255, 107, 95, 0.15);
}

.mobile-font-size-wrap {
  position: relative;
}

.mobile-font-size-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 32px 130px 32px auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(215, 208, 197, 0.2);
  background: #171915;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  padding: 8px;
}

.mobile-font-size-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--mobile-border);
  background: #111312;
  color: var(--ink);
}

.mobile-font-size-menu input {
  width: 130px;
}

.mobile-font-size-menu strong {
  color: var(--mobile-soft);
  font-size: 11px;
  white-space: nowrap;
}

.mobile-banner,
.mobile-warning {
  margin: 8px 10px 0;
}

.mobile-error,
.mobile-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 107, 95, 0.45);
  background: rgba(255, 107, 95, 0.1);
  color: #ffd7d2;
  padding: 10px 12px;
  font-size: 12px;
}

.mobile-warning {
  border-color: rgba(255, 200, 87, 0.45);
  background: rgba(255, 200, 87, 0.1);
  color: #f4dfaa;
  width: calc(100% - 20px);
}

.mobile-error span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-error button,
.mobile-warning {
  appearance: none;
}

.mobile-content {
  grid-row: 4;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.mobile-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.mobile-chat-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: relative;
}

.mobile-chat-panel.messages-maximized {
  grid-template-rows: auto minmax(0, 1fr);
}

.mobile-list-panel {
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav {
  align-self: end;
  display: grid;
  grid-row: 5;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  position: sticky;
  bottom: 0;
  z-index: 24;
  border-top: 1px solid var(--mobile-border);
  background: rgba(23, 25, 21, 0.98);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav button,
.mobile-icon-button,
.mobile-primary,
.mobile-secondary,
.mobile-danger,
.mobile-save-draft,
.mobile-send,
.mobile-command-row button,
.mobile-segmented button,
.mobile-action-grid button,
.mobile-inline-action,
.mobile-command-item,
.mobile-row-main,
.mobile-attachment-tile > button,
.mobile-error button {
  border: 1px solid var(--mobile-border);
  background: #111312;
  color: var(--ink);
}

.mobile-bottom-nav button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 46px;
  padding: 5px 2px;
  color: var(--mobile-muted);
  font-size: 10px;
}

.mobile-bottom-nav button.active {
  border-color: rgba(215, 255, 99, 0.58);
  color: var(--mobile-accent);
}

.mobile-bottom-nav button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
}

.mobile-primary,
.mobile-secondary,
.mobile-danger,
.mobile-send,
.mobile-save-draft,
.mobile-action-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  font-weight: 900;
}

.mobile-primary,
.mobile-send {
  border-color: rgba(215, 255, 99, 0.54);
  background: var(--mobile-accent);
  color: #111312;
}

.mobile-send.cancel,
.mobile-danger {
  border-color: rgba(255, 107, 95, 0.55);
  background: rgba(255, 107, 95, 0.12);
  color: #ffd7d2;
}

button:disabled {
  opacity: 0.45;
}

.mobile-stack {
  display: grid;
  gap: 12px;
}

.mobile-stack label {
  display: grid;
  gap: 6px;
}

.mobile-stack input,
.mobile-stack textarea,
.mobile-search,
.mobile-composer textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--mobile-border);
  background: #0c0d0d;
  color: var(--ink);
  padding: 10px 11px;
}

.mobile-checkbox {
  display: flex !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.mobile-checkbox input {
  width: auto;
}

.mobile-card {
  border: 1px solid var(--mobile-border);
  background: rgba(23, 25, 21, 0.96);
  padding: 12px;
}

.mobile-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-section-title > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mobile-section-title h2 {
  font-size: 17px;
}

.mobile-section-title button {
  min-height: 32px;
  border: 1px solid var(--mobile-border);
  background: #111312;
  color: var(--ink);
}

.mobile-top-command-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: start;
  gap: 7px;
  min-width: 0;
  padding: 10px 12px 8px;
}

.mobile-command-row {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 12px 8px;
}

.mobile-top-command-bar .mobile-command-row {
  padding: 0;
}

.mobile-command-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 32px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 10px;
  font-size: 12px;
}

.mobile-command-row button.selected {
  border-color: rgba(215, 255, 99, 0.58);
  color: var(--mobile-accent);
}

.mobile-message-list-max-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  max-width: none;
  height: 32px;
  padding: 0;
  border: 1px solid var(--mobile-border);
  background: rgba(17, 19, 18, 0.92);
  color: var(--mobile-soft);
}

.mobile-message-list-max-toggle:hover,
.mobile-message-list-max-toggle:focus-visible {
  border-color: rgba(215, 255, 99, 0.5);
  color: var(--mobile-accent);
}

.mobile-draft-icon {
  flex: 0 0 auto;
}

.mobile-draft-icon.pending,
.mobile-draft-icon.saving {
  color: var(--mobile-blue);
}

.mobile-draft-icon.conflict,
.mobile-draft-icon.error {
  color: #ffc857;
}

.mobile-next-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.mobile-next-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 24;
  display: grid;
  gap: 6px;
  width: max-content;
  min-width: 190px;
  max-width: calc(100vw - 24px);
  border: 1px solid rgba(125, 183, 255, 0.28);
  background: #171915;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  padding: 8px;
}

.mobile-next-menu-portal {
  position: fixed;
  z-index: 80;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-next-menu button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--mobile-border);
  background: #111312;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
}

.mobile-command-row .mobile-next-menu button,
.mobile-next-menu button {
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  text-align: left;
}

.mobile-message-list-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.mobile-message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 12px;
}

.mobile-chat-status-tip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  flex: 0 0 20px;
  height: 20px;
  border-top: 1px solid rgba(215, 208, 197, 0.12);
  color: var(--mobile-muted);
  background: rgba(23, 25, 21, 0.99);
  padding: 0 11px;
  font-size: 10px;
}

.mobile-chat-status-plan,
.mobile-chat-status-context,
.mobile-plan-active-text {
  min-width: 0;
}

.mobile-chat-status-plan {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.mobile-chat-status-plan > span:first-child {
  flex: 0 0 auto;
}

.mobile-plan-active-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-chat-status-context {
  justify-self: end;
  white-space: nowrap;
}

.mobile-history-status {
  position: sticky;
  top: 0;
  z-index: 2;
  align-self: stretch;
  border: 1px solid rgba(125, 183, 255, 0.22);
  background: rgba(17, 19, 18, 0.94);
  color: var(--mobile-muted);
  padding: 7px 9px;
  font-size: 12px;
  text-align: center;
}

.mobile-history-status.error {
  border-color: rgba(255, 112, 112, 0.32);
  color: #ffb6b6;
}

.mobile-empty-chat {
  align-items: center;
  justify-content: center;
  color: var(--mobile-muted);
  text-align: center;
}

.mobile-message {
  display: grid;
  gap: 8px;
  align-self: stretch;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  border: 1px solid var(--mobile-border);
  background: var(--mobile-panel);
  padding: 11px;
  font-size: var(--chat-font-size);
  overflow-wrap: anywhere;
}

.mobile-message.user {
  border-color: rgba(215, 255, 99, 0.34);
  background: rgba(215, 255, 99, 0.08);
}

.mobile-message.assistant {
  align-self: stretch;
}

.mobile-message.pending {
  border-color: rgba(255, 200, 87, 0.38);
}

.mobile-message-role {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-message-role time {
  margin-left: auto;
  color: var(--mobile-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  white-space: nowrap;
}

.mobile-message-action-toggle {
  border: 0;
  background: transparent;
  color: var(--mobile-blue);
  padding: 0 0 0 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: none;
}

.mobile-message-action-toggle:hover,
.mobile-message-action-toggle:focus-visible {
  color: var(--mobile-accent);
}

.mobile-mentioned-file-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--mobile-blue);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mobile-mentioned-file-code-link {
  font-family: inherit;
  font-size: inherit;
}

.mobile-message > p {
  margin: 0;
}

.mobile-markdown-message {
  color: var(--mobile-ink);
  font-size: var(--chat-font-size);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.mobile-markdown-message > * + * {
  margin-top: 8px;
}

.mobile-markdown-message h1,
.mobile-markdown-message h2,
.mobile-markdown-message h3 {
  color: var(--mobile-ink);
  font-size: calc(var(--chat-font-size) + 2px);
  line-height: 1.25;
}

.mobile-markdown-message p,
.mobile-markdown-message ul,
.mobile-markdown-message ol,
.mobile-markdown-message blockquote,
.mobile-markdown-message table,
.mobile-markdown-message pre {
  margin: 0;
}

.mobile-markdown-message ul,
.mobile-markdown-message ol {
  padding-left: 20px;
}

.mobile-markdown-message code {
  border: 1.5px solid var(--mobile-border);
  border-radius: 5px;
  background: #0d0f0e;
  color: var(--mobile-accent);
  padding: 1px 5px;
  font-family: "SFMono-Regular", "Cascadia Code", monospace;
  font-size: calc(var(--chat-font-size) - 1px);
}

.mobile-markdown-message pre {
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--mobile-border);
  border-radius: 5px;
  background: #0d0f0e;
  padding: 2px 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mobile-markdown-message pre code {
  display: block;
  border: 0;
  background: transparent;
  color: var(--mobile-soft);
  padding: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  tab-size: 4;
}

.mobile-markdown-message table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.mobile-markdown-message th,
.mobile-markdown-message td {
  border: 1px solid var(--mobile-border);
  padding: 6px 8px;
  text-align: left;
}

.mobile-markdown-message a {
  color: var(--mobile-blue);
}

.mobile-agent-output {
  border: 1px solid rgba(125, 183, 255, 0.26);
  background: rgba(125, 183, 255, 0.07);
  padding: 9px;
}

.mobile-agent-output > :last-child {
  margin-bottom: 0;
}

.mobile-assistant-actions {
  display: grid;
  gap: 3px;
}

.mobile-thought-action,
.mobile-tool-action,
.mobile-plan-action,
.mobile-context-action {
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--mobile-muted);
  font-size: var(--chat-font-size);
}

.mobile-thought-action,
.mobile-context-action {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 4px 9px;
}

.mobile-thought-action svg,
.mobile-context-action svg {
  color: var(--amber);
  margin-top: 2px;
}

.mobile-thought-action span,
.mobile-context-action span {
  color: #aaa49a;
  display: block;
  font-size: var(--chat-font-size);
  white-space: pre-wrap;
}

.mobile-tool-action summary,
.mobile-plan-action summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  color: #aaa49a;
  cursor: pointer;
  font-size: calc(var(--chat-font-size) - 2px);
  font-weight: 900;
}

.mobile-tool-action > div,
.mobile-plan-action > div {
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(215, 208, 197, 0.12);
  padding: 7px 9px 9px;
}

.mobile-tool-event,
.mobile-plan-status-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  color: #9d978e;
  font-size: calc(var(--chat-font-size) - 1px);
  line-height: 1.4;
}

.mobile-tool-event span,
.mobile-plan-status-row span {
  color: #9d978e;
  display: block;
}

.mobile-tool-event svg,
.mobile-plan-status-row svg {
  color: var(--amber);
  margin-top: 2px;
}

.mobile-tool-event.tool_result svg {
  color: var(--green);
}

.mobile-plan-status-rows {
  display: grid;
  gap: 6px;
}

.mobile-plan-status-row.completed svg {
  color: var(--green);
}

.mobile-plan-status-row.pending svg {
  color: var(--mobile-muted);
}

.mobile-message-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.mobile-message-duration,
.mobile-message-token-usage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid var(--mobile-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--mobile-muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.mobile-message-duration svg {
  color: var(--amber);
}

.mobile-message-token-usage svg {
  color: var(--accent);
}

.mobile-activity-line {
  border-top: 1px solid rgba(255, 200, 87, 0.22);
  color: var(--mobile-muted);
  font-size: 12px;
  line-height: 1.4;
  padding-top: 7px;
}

.mobile-inline-action {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 8px;
  color: var(--mobile-muted);
}

.mobile-next-actions {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(125, 183, 255, 0.26);
  background: rgba(125, 183, 255, 0.08);
  padding: 10px;
}

.mobile-next-actions button {
  min-height: 34px;
  border: 1px solid rgba(125, 183, 255, 0.35);
  background: #111312;
  color: var(--ink);
  text-align: left;
}

.mobile-composer {
  display: grid;
  gap: 8px;
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--mobile-border);
  background: rgba(23, 25, 21, 0.99);
}

.mobile-composer.maximized {
  position: absolute;
  inset: 0;
  z-index: 36;
  display: flex;
  flex-direction: column;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  border-top: 0;
}

.mobile-composer-mode-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: start;
  gap: 7px;
  min-width: 0;
}

.mobile-composer-modes {
  min-width: 0;
  padding: 0;
}

.mobile-composer-input-wrap {
  position: relative;
  display: grid;
  min-width: 0;
}

.mobile-composer textarea {
  min-height: 78px;
  max-height: 28dvh;
  tab-size: 4;
  font-family: "SFMono-Regular", "Cascadia Code", "Menlo", monospace;
  font-size: var(--chat-font-size);
  line-height: 1.42;
  resize: vertical;
}

.mobile-composer.maximized .mobile-composer-input-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.mobile-composer.maximized textarea {
  height: 100%;
  min-height: 0;
  max-height: none;
  resize: none;
}

.mobile-composer-max-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
  margin-left: 0;
  width: 32px;
  max-width: none;
  height: 32px;
  padding: 0;
  border: 1px solid var(--mobile-border);
  background: rgba(17, 19, 18, 0.92);
  color: var(--mobile-soft);
}

.mobile-composer-max-toggle:hover,
.mobile-composer-max-toggle:focus-visible {
  border-color: rgba(215, 255, 99, 0.5);
  color: var(--mobile-accent);
}

.mobile-composer textarea[readonly] {
  border-color: rgba(255, 200, 87, 0.42);
  background: rgba(255, 200, 87, 0.06);
  color: #f7e8c7;
  cursor: text;
}

.mobile-composer-actions {
  display: grid;
  grid-template-columns: 36px minmax(0, auto) minmax(0, auto) minmax(92px, 1fr);
  gap: 8px;
  align-items: center;
}

.mobile-save-draft,
.mobile-send {
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
}

.mobile-save-draft {
  color: var(--mobile-muted);
}

.mobile-hidden-file {
  display: none;
}

.mobile-edit-note {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(125, 183, 255, 0.28);
  background: rgba(125, 183, 255, 0.08);
  padding: 7px 9px;
  color: var(--mobile-soft);
  font-size: 12px;
}

.mobile-edit-note span {
  flex: 1;
}

.mobile-edit-note button {
  border: 0;
  background: transparent;
  color: var(--mobile-blue);
}

.mobile-upload-error {
  color: #fecaca;
}

.mobile-list {
  display: grid;
  gap: 8px;
}

.mobile-row,
.mobile-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  border: 1px solid var(--mobile-border);
  background: var(--mobile-panel);
  padding: 8px;
}

.mobile-row.selected {
  border-color: rgba(215, 255, 99, 0.46);
}

.mobile-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  text-align: left;
}

.mobile-row-main.static {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.mobile-row-main p {
  margin: 0;
  overflow-wrap: anywhere;
}

.mobile-row-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 92px;
}

.mobile-empty-row,
.mobile-running-row {
  border: 1px dashed var(--mobile-border);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.mobile-running-row {
  border-color: rgba(255, 200, 87, 0.38);
  color: #f4dfaa;
  overflow-wrap: anywhere;
}

.mobile-search {
  min-height: 38px;
}

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

.mobile-segmented button {
  min-width: 0;
  min-height: 36px;
}

.mobile-segmented button.selected,
.mobile-segmented button.active {
  border-color: rgba(215, 255, 99, 0.58);
  color: var(--mobile-accent);
}

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

.mobile-facts {
  display: grid;
  gap: 8px;
}

.mobile-info-line {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mobile-info-line strong {
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.mobile-command-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  text-align: left;
}

.mobile-command-item span {
  color: var(--mobile-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mobile-attachment-strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.mobile-attachment-tile {
  position: relative;
  display: grid;
  gap: 5px;
  flex: 0 0 86px;
  min-width: 0;
}

.mobile-attachment-tile > button {
  width: 86px;
  height: 70px;
  padding: 0;
  overflow: hidden;
}

.mobile-attachment-tile span {
  font-size: 10px;
  color: var(--mobile-muted);
}

.mobile-attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 107, 95, 0.42);
  background: rgba(53, 22, 22, 0.92);
  color: #fecaca;
  padding: 0;
}

.mobile-image-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mobile-image-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--mobile-muted);
  font-size: 10px;
  text-align: center;
}

.mobile-preview-dialog,
.mobile-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  background: rgba(0, 0, 0, 0.68);
}

.mobile-preview-dialog {
  place-items: center;
  padding: 16px;
}

.mobile-preview-dialog > div {
  position: relative;
  display: grid;
  gap: 8px;
  max-width: 96vw;
  max-height: 92dvh;
  border: 1px solid var(--mobile-border);
  background: #111312;
  padding: 10px;
}

.mobile-preview-dialog .mobile-icon-button {
  justify-self: end;
}

.mobile-mentioned-file-dialog {
  z-index: 110;
}

.mobile-mentioned-file-dialog > div {
  width: min(96vw, 900px);
  height: min(88dvh, 820px);
  grid-template-rows: auto auto minmax(0, 1fr);
}

.mobile-mentioned-file-head,
.mobile-mentioned-file-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-mentioned-file-head {
  justify-content: space-between;
}

.mobile-mentioned-file-head span {
  display: block;
  color: var(--mobile-muted);
  font-size: 11px;
}

.mobile-mentioned-file-tools {
  justify-content: space-between;
  flex-wrap: wrap;
}

.mobile-mentioned-file-tools .mobile-segmented {
  min-width: 160px;
}

.mobile-mentioned-file-preview {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--mobile-border);
  background: #0d0f0e;
}

.mobile-mentioned-file-diff-button {
  min-height: 28px;
  border: 1px solid rgba(125, 183, 255, 0.42);
  background: transparent;
  color: var(--accent);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.mobile-mentioned-file-diff-button.active {
  background: rgba(125, 183, 255, 0.14);
}

.mobile-mentioned-file-diff-button.new {
  border-color: rgba(88, 214, 141, 0.58);
  color: var(--green);
}

.mobile-mentioned-file-diff-button.clean {
  border-color: rgba(215, 208, 197, 0.22);
  color: var(--mobile-muted);
}

.mobile-mentioned-file-diff-button:disabled {
  cursor: default;
  opacity: 1;
}

.mobile-mentioned-file-text,
.mobile-mentioned-file-frame,
.mobile-mentioned-file-media,
.mobile-mentioned-file-markdown,
.mobile-mentioned-file-diff {
  width: 100%;
  height: 100%;
}

.mobile-mentioned-file-text {
  resize: none;
  border: 0;
  background: #0d0f0e;
  color: var(--ink);
  padding: 12px;
  font: 12px/1.55 "SFMono-Regular", "Cascadia Code", monospace;
  outline: none;
}

.mobile-mentioned-file-markdown {
  overflow: auto;
  padding: 12px;
}

.mobile-mentioned-file-diff {
  overflow: auto;
  background: #0d1117;
  color: #e6edf3;
  font-size: 12px;
}

.mobile-mentioned-file-diff .d2h-file-header {
  display: none;
}

.mobile-mentioned-file-diff .d2h-code-wrapper {
  min-width: 100%;
  overflow-x: auto;
}

.mobile-mentioned-file-diff .d2h-diff-table {
  min-width: 100%;
}

.mobile-mentioned-file-diff .d2h-code-linenumber {
  display: table-cell;
  min-width: 7.5em;
  position: static;
  vertical-align: top;
  width: 7.5em;
}

.mobile-mentioned-file-diff .d2h-code-line {
  padding-left: 1em;
  padding-right: 1em;
  width: auto;
}

.mobile-mentioned-file-frame {
  border: 0;
  background: #fff;
}

.mobile-mentioned-file-media {
  display: block;
  object-fit: contain;
  background: #000;
}

.mobile-mentioned-file-audio {
  width: calc(100% - 24px);
  margin: 20px 12px;
}

.mobile-preview-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--mobile-muted);
  font-size: 12px;
}

.mobile-image-full {
  max-width: calc(96vw - 32px);
  max-height: calc(92dvh - 82px);
  object-fit: contain;
  display: block;
}

.mobile-sheet-backdrop {
  align-items: end;
  padding-top: calc(20px + env(safe-area-inset-top));
}

.mobile-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: 90dvh;
  min-height: 48dvh;
  border-top: 1px solid var(--mobile-border);
  background: var(--mobile-bg);
}

.mobile-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--mobile-border);
}

.mobile-sheet h2 {
  font-size: 18px;
}

.mobile-sheet-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
}

.mobile-remote-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-secondary.compact {
  min-height: 32px;
  padding: 5px 8px;
}

.mobile-warning-text {
  margin: 0;
  color: #facc15;
  font-size: 12px;
  line-height: 1.4;
}

.mobile-wrap-code {
  display: block;
  border: 1px solid var(--mobile-border);
  background: #101211;
  padding: 8px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.mobile-log-tail {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--mobile-border);
  padding: 8px;
  font-size: 11px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--mobile-border);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.state-pill.running {
  border-color: rgba(74, 222, 128, 0.55);
  color: #86efac;
}

.state-pill.error {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fca5a5;
}

.spin {
  animation: mobile-spin 0.9s linear infinite;
}

@keyframes mobile-spin {
  to {
    transform: rotate(360deg);
  }
}
:host,:root{--d2h-bg-color:#fff;--d2h-border-color:#ddd;--d2h-dim-color:rgba(0,0,0,.3);--d2h-line-border-color:#eee;--d2h-file-header-bg-color:#f7f7f7;--d2h-file-header-border-color:#d8d8d8;--d2h-empty-placeholder-bg-color:#f1f1f1;--d2h-empty-placeholder-border-color:#e1e1e1;--d2h-selected-color:#c8e1ff;--d2h-ins-bg-color:#dfd;--d2h-ins-border-color:#b4e2b4;--d2h-ins-highlight-bg-color:#97f295;--d2h-ins-label-color:#399839;--d2h-del-bg-color:#fee8e9;--d2h-del-border-color:#e9aeae;--d2h-del-highlight-bg-color:#ffb6ba;--d2h-del-label-color:#c33;--d2h-change-del-color:#fdf2d0;--d2h-change-ins-color:#ded;--d2h-info-bg-color:#f8fafd;--d2h-info-border-color:#d5e4f2;--d2h-change-label-color:#d0b44c;--d2h-moved-label-color:#3572b0;--d2h-dark-color:#e6edf3;--d2h-dark-bg-color:#0d1117;--d2h-dark-border-color:#30363d;--d2h-dark-dim-color:#6e7681;--d2h-dark-line-border-color:#21262d;--d2h-dark-file-header-bg-color:#161b22;--d2h-dark-file-header-border-color:#30363d;--d2h-dark-empty-placeholder-bg-color:hsla(215,8%,47%,.1);--d2h-dark-empty-placeholder-border-color:#30363d;--d2h-dark-selected-color:rgba(56,139,253,.1);--d2h-dark-ins-bg-color:rgba(46,160,67,.15);--d2h-dark-ins-border-color:rgba(46,160,67,.4);--d2h-dark-ins-highlight-bg-color:rgba(46,160,67,.4);--d2h-dark-ins-label-color:#3fb950;--d2h-dark-del-bg-color:rgba(248,81,73,.1);--d2h-dark-del-border-color:rgba(248,81,73,.4);--d2h-dark-del-highlight-bg-color:rgba(248,81,73,.4);--d2h-dark-del-label-color:#f85149;--d2h-dark-change-del-color:rgba(210,153,34,.2);--d2h-dark-change-ins-color:rgba(46,160,67,.25);--d2h-dark-info-bg-color:rgba(56,139,253,.1);--d2h-dark-info-border-color:rgba(56,139,253,.4);--d2h-dark-change-label-color:#d29922;--d2h-dark-moved-label-color:#3572b0}.d2h-wrapper{text-align:left}.d2h-file-header{background-color:#f7f7f7;background-color:var(--d2h-file-header-bg-color);border-bottom:1px solid #d8d8d8;border-bottom:1px solid var(--d2h-file-header-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;height:35px;padding:5px 10px}.d2h-file-header.d2h-sticky-header{position:sticky;top:0;z-index:1}.d2h-file-stats{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;margin-left:auto}.d2h-lines-added{border:1px solid #b4e2b4;border:1px solid var(--d2h-ins-border-color);border-radius:5px 0 0 5px;color:#399839;color:var(--d2h-ins-label-color);padding:2px;text-align:right;vertical-align:middle}.d2h-lines-deleted{border:1px solid #e9aeae;border:1px solid var(--d2h-del-border-color);border-radius:0 5px 5px 0;color:#c33;color:var(--d2h-del-label-color);margin-left:1px;padding:2px;text-align:left;vertical-align:middle}.d2h-file-name-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:15px;width:100%}.d2h-file-name{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.d2h-file-wrapper{border:1px solid #ddd;border:1px solid var(--d2h-border-color);border-radius:3px;margin-bottom:1em}.d2h-file-collapse{-webkit-box-pack:end;-ms-flex-pack:end;cursor:pointer;display:none;font-size:12px;justify-content:flex-end;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid #ddd;border:1px solid var(--d2h-border-color);border-radius:3px;padding:4px 8px}.d2h-file-collapse.d2h-selected{background-color:#c8e1ff;background-color:var(--d2h-selected-color)}.d2h-file-collapse-input{margin:0 4px 0 0}.d2h-diff-table{border-collapse:collapse;font-family:Menlo,Consolas,monospace;font-size:13px;width:100%}.d2h-files-diff{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.d2h-file-diff{overflow-y:hidden}.d2h-file-diff.d2h-d-none,.d2h-files-diff.d2h-d-none{display:none}.d2h-file-side-diff{display:inline-block;overflow-x:scroll;overflow-y:hidden;width:50%}.d2h-code-line{padding:0 8em;width:calc(100% - 16em)}.d2h-code-line,.d2h-code-side-line{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.d2h-code-side-line{padding:0 4.5em;width:calc(100% - 9em)}.d2h-code-line-ctn{background:none;display:inline-block;padding:0;word-wrap:normal;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;vertical-align:middle;white-space:pre;width:100%}.d2h-code-line del,.d2h-code-side-line del{background-color:#ffb6ba;background-color:var(--d2h-del-highlight-bg-color)}.d2h-code-line del,.d2h-code-line ins,.d2h-code-side-line del,.d2h-code-side-line ins{border-radius:.2em;display:inline-block;margin-top:-1px;-webkit-text-decoration:none;text-decoration:none}.d2h-code-line ins,.d2h-code-side-line ins{background-color:#97f295;background-color:var(--d2h-ins-highlight-bg-color);text-align:left}.d2h-code-line-prefix{background:none;display:inline;padding:0;word-wrap:normal;white-space:pre}.line-num1{float:left}.line-num1,.line-num2{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;padding:0 .5em;text-overflow:ellipsis;width:3.5em}.line-num2{float:right}.d2h-code-linenumber{background-color:#fff;background-color:var(--d2h-bg-color);border:solid #eee;border:solid var(--d2h-line-border-color);border-width:0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.3);color:var(--d2h-dim-color);cursor:pointer;display:inline-block;position:absolute;text-align:right;width:7.5em}.d2h-code-linenumber:after{content:"\200b"}.d2h-code-side-linenumber{background-color:#fff;background-color:var(--d2h-bg-color);border:solid #eee;border:solid var(--d2h-line-border-color);border-width:0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.3);color:var(--d2h-dim-color);cursor:pointer;display:inline-block;overflow:hidden;padding:0 .5em;position:absolute;text-align:right;text-overflow:ellipsis;width:4em}.d2h-code-side-linenumber:after{content:"\200b"}.d2h-code-side-emptyplaceholder,.d2h-emptyplaceholder{background-color:#f1f1f1;background-color:var(--d2h-empty-placeholder-bg-color);border-color:#e1e1e1;border-color:var(--d2h-empty-placeholder-border-color)}.d2h-code-line-prefix,.d2h-code-linenumber,.d2h-code-side-linenumber,.d2h-emptyplaceholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.d2h-code-linenumber,.d2h-code-side-linenumber{direction:rtl}.d2h-del{background-color:#fee8e9;background-color:var(--d2h-del-bg-color);border-color:#e9aeae;border-color:var(--d2h-del-border-color)}.d2h-ins{background-color:#dfd;background-color:var(--d2h-ins-bg-color);border-color:#b4e2b4;border-color:var(--d2h-ins-border-color)}.d2h-info{background-color:#f8fafd;background-color:var(--d2h-info-bg-color);border-color:#d5e4f2;border-color:var(--d2h-info-border-color);color:rgba(0,0,0,.3);color:var(--d2h-dim-color)}.d2h-file-diff .d2h-del.d2h-change{background-color:#fdf2d0;background-color:var(--d2h-change-del-color)}.d2h-file-diff .d2h-ins.d2h-change{background-color:#ded;background-color:var(--d2h-change-ins-color)}.d2h-file-list-wrapper{margin-bottom:10px}.d2h-file-list-wrapper a{-webkit-text-decoration:none;text-decoration:none}.d2h-file-list-wrapper a,.d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-moved-label-color)}.d2h-file-list-header{text-align:left}.d2h-file-list-title{font-weight:700}.d2h-file-list-line{display:-webkit-box;display:-ms-flexbox;display:flex;text-align:left}.d2h-file-list{display:block;list-style:none;margin:0;padding:0}.d2h-file-list>li{border-bottom:1px solid #ddd;border-bottom:1px solid var(--d2h-border-color);margin:0;padding:5px 10px}.d2h-file-list>li:last-child{border-bottom:none}.d2h-file-switch{cursor:pointer;display:none;font-size:10px}.d2h-icon{fill:currentColor;margin-right:10px;vertical-align:middle}.d2h-deleted{color:#c33;color:var(--d2h-del-label-color)}.d2h-added{color:#399839;color:var(--d2h-ins-label-color)}.d2h-changed{color:#d0b44c;color:var(--d2h-change-label-color)}.d2h-moved{color:#3572b0;color:var(--d2h-moved-label-color)}.d2h-tag{background-color:#fff;background-color:var(--d2h-bg-color);display:-webkit-box;display:-ms-flexbox;display:flex;font-size:10px;margin-left:5px;padding:0 2px}.d2h-deleted-tag{border:1px solid #c33;border:1px solid var(--d2h-del-label-color)}.d2h-added-tag{border:1px solid #399839;border:1px solid var(--d2h-ins-label-color)}.d2h-changed-tag{border:1px solid #d0b44c;border:1px solid var(--d2h-change-label-color)}.d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-moved-label-color)}.d2h-dark-color-scheme{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);color:#e6edf3;color:var(--d2h-dark-color)}.d2h-dark-color-scheme .d2h-file-header{background-color:#161b22;background-color:var(--d2h-dark-file-header-bg-color);border-bottom:#30363d;border-bottom:var(--d2h-dark-file-header-border-color)}.d2h-dark-color-scheme .d2h-lines-added{border:1px solid rgba(46,160,67,.4);border:1px solid var(--d2h-dark-ins-border-color);color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-lines-deleted{border:1px solid rgba(248,81,73,.4);border:1px solid var(--d2h-dark-del-border-color);color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-code-line del,.d2h-dark-color-scheme .d2h-code-side-line del{background-color:rgba(248,81,73,.4);background-color:var(--d2h-dark-del-highlight-bg-color)}.d2h-dark-color-scheme .d2h-code-line ins,.d2h-dark-color-scheme .d2h-code-side-line ins{background-color:rgba(46,160,67,.4);background-color:var(--d2h-dark-ins-highlight-bg-color)}.d2h-dark-color-scheme .d2h-diff-tbody{border-color:#30363d;border-color:var(--d2h-dark-border-color)}.d2h-dark-color-scheme .d2h-code-side-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-files-diff .d2h-code-side-emptyplaceholder,.d2h-dark-color-scheme .d2h-files-diff .d2h-emptyplaceholder{background-color:hsla(215,8%,47%,.1);background-color:var(--d2h-dark-empty-placeholder-bg-color);border-color:#30363d;border-color:var(--d2h-dark-empty-placeholder-border-color)}.d2h-dark-color-scheme .d2h-code-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-del{background-color:rgba(248,81,73,.1);background-color:var(--d2h-dark-del-bg-color);border-color:rgba(248,81,73,.4);border-color:var(--d2h-dark-del-border-color)}.d2h-dark-color-scheme .d2h-ins{background-color:rgba(46,160,67,.15);background-color:var(--d2h-dark-ins-bg-color);border-color:rgba(46,160,67,.4);border-color:var(--d2h-dark-ins-border-color)}.d2h-dark-color-scheme .d2h-info{background-color:rgba(56,139,253,.1);background-color:var(--d2h-dark-info-bg-color);border-color:rgba(56,139,253,.4);border-color:var(--d2h-dark-info-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-file-diff .d2h-del.d2h-change{background-color:rgba(210,153,34,.2);background-color:var(--d2h-dark-change-del-color)}.d2h-dark-color-scheme .d2h-file-diff .d2h-ins.d2h-change{background-color:rgba(46,160,67,.25);background-color:var(--d2h-dark-change-ins-color)}.d2h-dark-color-scheme .d2h-file-wrapper{border:1px solid #30363d;border:1px solid var(--d2h-dark-border-color)}.d2h-dark-color-scheme .d2h-file-collapse{border:1px solid #0d1117;border:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-file-collapse.d2h-selected{background-color:rgba(56,139,253,.1);background-color:var(--d2h-dark-selected-color)}.d2h-dark-color-scheme .d2h-file-list-wrapper a,.d2h-dark-color-scheme .d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-dark-color-scheme .d2h-file-list>li{border-bottom:1px solid #0d1117;border-bottom:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted{color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-added{color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-changed{color:#d29922;color:var(--d2h-dark-change-label-color)}.d2h-dark-color-scheme .d2h-moved{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-dark-color-scheme .d2h-tag{background-color:#0d1117;background-color:var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted-tag{border:1px solid #f85149;border:1px solid var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-added-tag{border:1px solid #3fb950;border:1px solid var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-changed-tag{border:1px solid #d29922;border:1px solid var(--d2h-dark-change-label-color)}.d2h-dark-color-scheme .d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-dark-moved-label-color)}@media (prefers-color-scheme:dark){.d2h-auto-color-scheme{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);color:#e6edf3;color:var(--d2h-dark-color)}.d2h-auto-color-scheme .d2h-file-header{background-color:#161b22;background-color:var(--d2h-dark-file-header-bg-color);border-bottom:#30363d;border-bottom:var(--d2h-dark-file-header-border-color)}.d2h-auto-color-scheme .d2h-lines-added{border:1px solid rgba(46,160,67,.4);border:1px solid var(--d2h-dark-ins-border-color);color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-lines-deleted{border:1px solid rgba(248,81,73,.4);border:1px solid var(--d2h-dark-del-border-color);color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-code-line del,.d2h-auto-color-scheme .d2h-code-side-line del{background-color:rgba(248,81,73,.4);background-color:var(--d2h-dark-del-highlight-bg-color)}.d2h-auto-color-scheme .d2h-code-line ins,.d2h-auto-color-scheme .d2h-code-side-line ins{background-color:rgba(46,160,67,.4);background-color:var(--d2h-dark-ins-highlight-bg-color)}.d2h-auto-color-scheme .d2h-diff-tbody{border-color:#30363d;border-color:var(--d2h-dark-border-color)}.d2h-auto-color-scheme .d2h-code-side-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-files-diff .d2h-code-side-emptyplaceholder,.d2h-auto-color-scheme .d2h-files-diff .d2h-emptyplaceholder{background-color:hsla(215,8%,47%,.1);background-color:var(--d2h-dark-empty-placeholder-bg-color);border-color:#30363d;border-color:var(--d2h-dark-empty-placeholder-border-color)}.d2h-auto-color-scheme .d2h-code-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-del{background-color:rgba(248,81,73,.1);background-color:var(--d2h-dark-del-bg-color);border-color:rgba(248,81,73,.4);border-color:var(--d2h-dark-del-border-color)}.d2h-auto-color-scheme .d2h-ins{background-color:rgba(46,160,67,.15);background-color:var(--d2h-dark-ins-bg-color);border-color:rgba(46,160,67,.4);border-color:var(--d2h-dark-ins-border-color)}.d2h-auto-color-scheme .d2h-info{background-color:rgba(56,139,253,.1);background-color:var(--d2h-dark-info-bg-color);border-color:rgba(56,139,253,.4);border-color:var(--d2h-dark-info-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-file-diff .d2h-del.d2h-change{background-color:rgba(210,153,34,.2);background-color:var(--d2h-dark-change-del-color)}.d2h-auto-color-scheme .d2h-file-diff .d2h-ins.d2h-change{background-color:rgba(46,160,67,.25);background-color:var(--d2h-dark-change-ins-color)}.d2h-auto-color-scheme .d2h-file-wrapper{border:1px solid #30363d;border:1px solid var(--d2h-dark-border-color)}.d2h-auto-color-scheme .d2h-file-collapse{border:1px solid #0d1117;border:1px solid var(--d2h-dark-bg-color)}.d2h-auto-color-scheme .d2h-file-collapse.d2h-selected{background-color:rgba(56,139,253,.1);background-color:var(--d2h-dark-selected-color)}.d2h-auto-color-scheme .d2h-file-list-wrapper a,.d2h-auto-color-scheme .d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-auto-color-scheme .d2h-file-list>li{border-bottom:1px solid #0d1117;border-bottom:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted{color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-added{color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-changed{color:#d29922;color:var(--d2h-dark-change-label-color)}.d2h-auto-color-scheme .d2h-moved{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-auto-color-scheme .d2h-tag{background-color:#0d1117;background-color:var(--d2h-dark-bg-color)}.d2h-auto-color-scheme .d2h-deleted-tag{border:1px solid #f85149;border:1px solid var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-added-tag{border:1px solid #3fb950;border:1px solid var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-changed-tag{border:1px solid #d29922;border:1px solid var(--d2h-dark-change-label-color)}.d2h-auto-color-scheme .d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-dark-moved-label-color)}}:root {
  color-scheme: dark;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  --bg: #111211;
  --panel: #181917;
  --panel-2: #20211d;
  --field: #0c0d0d;
  --line: #34332f;
  --ink: #f2eee5;
  --muted: #a8a096;
  --soft: #d7d0c5;
  --accent: #d7ff63;
  --blue: #7db7ff;
  --green: #78dc91;
  --amber: #ffc857;
  --red: #ff6b5f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 52px 52px;
  color: var(--ink);
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  height: 100vh;
  padding: 16px 16px 0 16px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(24, 25, 23, 0.96);
  box-shadow: var(--shadow);
  padding: 8px 18px;
  margin: -16px -16px 0 -16px;
}

.app-header h1 {
  font-size: 24px;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.font-size-control {
  position: relative;
}

.notification-control {
  position: relative;
}

.notification-control .icon-button.selected {
  border-color: rgba(215, 255, 99, 0.48);
  background: rgba(215, 255, 99, 0.12);
  color: var(--accent);
}

.notification-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 65;
  display: grid;
  gap: 8px;
  width: 210px;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #181916;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  padding: 10px;
}

.notification-switch {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.notification-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.notification-switch-track {
  position: relative;
  width: 38px;
  height: 20px;
  border: 1px solid rgba(215, 208, 197, 0.24);
  background: rgba(255, 255, 255, 0.06);
}

.notification-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: var(--muted);
  transition: left 0.14s ease, background 0.14s ease;
}

.notification-switch input:checked + .notification-switch-track {
  border-color: rgba(215, 255, 99, 0.5);
  background: rgba(215, 255, 99, 0.14);
}

.notification-switch input:checked + .notification-switch-track::after {
  left: 21px;
  background: var(--accent);
}

.experimental-api-panel {
  gap: 10px;
}

.experimental-api-switch {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(215, 208, 197, 0.12);
  background: rgba(255, 255, 255, 0.025);
  padding: 9px;
}

.experimental-api-switch > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.experimental-api-switch strong {
  color: var(--soft);
  font-size: 12px;
}

.experimental-api-switch small {
  color: var(--muted);
  font-size: 11px;
}

.experimental-api-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.experimental-api-switch input:checked + .notification-switch-track {
  border-color: rgba(215, 255, 99, 0.5);
  background: rgba(215, 255, 99, 0.14);
}

.experimental-api-switch input:checked + .notification-switch-track::after {
  left: 21px;
  background: var(--accent);
}

.font-size-control .icon-button.selected {
  border-color: rgba(215, 255, 99, 0.48);
  background: rgba(215, 255, 99, 0.12);
  color: var(--accent);
}

.font-size-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: 220px;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #181916;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  padding: 10px;
}

.font-size-popover label {
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.font-size-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
}

.font-size-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(215, 208, 197, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  width: 30px;
  height: 30px;
  padding: 0;
}

.font-size-row input {
  width: 100%;
}

.font-size-popover strong {
  justify-self: end;
  color: var(--ink);
  font-size: 12px;
}

.app-header p,
label,
small,
.section-title,
.info span,
.event-row time,
.event-row p,
.mode-row span,
.project-select-button span,
.project-select-button small,
.diagnostics summary,
.cap-line {
  color: var(--muted);
  font-size: 12px;
}

.status-badge,
.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #111312;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-badge.ok,
.state-chip.completed,
.state-chip.ok {
  border-color: rgba(120, 220, 145, 0.6);
  color: var(--green);
}

.status-badge.bad,
.state-chip.failed {
  border-color: rgba(255, 107, 95, 0.65);
  color: var(--red);
}

.state-chip.running,
.state-chip.submitting,
.state-chip.sending,
.state-chip.warn {
  border-color: rgba(255, 200, 87, 0.7);
  color: var(--amber);
}

.error-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 107, 95, 0.7);
  background: rgba(255, 107, 95, 0.1);
  color: #ffd7d2;
  padding: 12px 14px;
}

.setup-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 200, 87, 0.62);
  background: rgba(255, 200, 87, 0.1);
  color: #f4dfaa;
  padding: 12px 14px;
}

.setup-strip span {
  flex: 1;
}

.setup-strip .secondary {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(760px, 1fr);
  gap: 14px;
  min-height: 0;
}

.workbench-shell {
  display: grid;
  grid-template-columns: 260px minmax(680px, 1fr) 320px;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.project-rail,
.chat-workspace-main,
.aux-rail {
  min-height: 0;
  overflow: hidden;
}

.project-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
}

.chat-workspace-main {
  display: grid;
  min-width: 0;
}

.chat-workspace-main .chat-panel {
  height: 100%;
}

.aux-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.token-gate {
  display: grid;
  gap: 18px;
  justify-self: center;
  width: min(520px, 100%);
  margin-top: 9vh;
}

.token-gate h2 {
  font-size: 26px;
  letter-spacing: 0;
}

.token-gate p {
  color: var(--muted);
  margin-top: 6px;
}

.setup-pane,
.task-pane,
.chat-pane {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow: auto;
}

.chat-pane {
  grid-template-columns: minmax(640px, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.block {
  border: 1px solid var(--line);
  background: rgba(24, 25, 23, 0.96);
  box-shadow: var(--shadow);
  padding: 16px;
}

.muted-block {
  background: rgba(18, 19, 18, 0.92);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  margin-top: -2px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.project-rail .section-title,
.project-rail .cap-line {
  justify-content: space-between;
}

.project-rail .section-title > span,
.project-rail .cap-line span {
  order: 1;
}

.project-rail .section-title .section-title-actions {
  order: 2;
}

.project-rail .section-title > svg,
.project-rail .cap-line svg {
  order: 3;
  opacity: 0.74;
}

.stack {
  display: grid;
  gap: 10px;
}

.compact-stack {
  margin-top: 12px;
}

label {
  font-weight: 900;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #3d3b36;
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
}

textarea {
  min-height: 164px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(215, 255, 99, 0.2);
}

.primary,
.secondary,
.danger,
.run-button,
.icon-button,
.quick-row button,
.mode-row button,
.mini-list button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #111312;
  color: var(--ink);
  min-height: 40px;
}

.primary,
.run-button {
  width: 100%;
  border-color: #c8ed5d;
  background: var(--accent);
  color: #11120f;
  font-weight: 900;
}

.run-button {
  min-height: 54px;
  font-size: 18px;
}

.secondary {
  border-color: #486a92;
  background: #18263a;
}

.danger {
  border-color: rgba(255, 107, 95, 0.6);
  background: rgba(255, 107, 95, 0.12);
}

.icon-button {
  width: 42px;
}

.inline-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.project-list {
  display: grid;
  gap: 7px;
}

.empty-project-action {
  width: 100%;
}

.project-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 7px;
}

.project-select-button {
  display: grid;
  justify-content: stretch;
  gap: 4px;
  border: 1px solid var(--line);
  background: #111312;
  color: var(--ink);
  min-height: 56px;
  padding: 9px 10px;
  text-align: left;
}

.project-list-row.selected .project-select-button {
  border-color: var(--accent);
  background: #222719;
}

.project-select-button span,
.project-select-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-icon {
  width: 32px;
  min-height: 32px;
  border-color: rgba(215, 208, 197, 0.16);
  background: #111312;
}

.section-title-action {
  width: 30px;
  min-height: 30px;
}

.skill-issue-list {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 107, 95, 0.48);
  background: rgba(255, 107, 95, 0.08);
  color: #ffcece;
  margin-top: 4px;
  padding: 10px;
}

.path-line {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 4px 0 7px;
  border-bottom: 1px solid rgba(215, 208, 197, 0.1);
}

.path-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.path-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.path-line code {
  color: var(--soft);
  font-family: "SFMono-Regular", "Cascadia Code", monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  user-select: text;
  white-space: normal;
}

.path-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(215, 208, 197, 0.2);
  background: rgba(17, 19, 18, 0.72);
  color: var(--soft);
  min-height: 24px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 900;
}

.path-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.path-copy.copied,
.path-copy.selected {
  border-color: rgba(120, 220, 145, 0.6);
  color: var(--green);
}

.mini-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mini-list button {
  display: grid;
  justify-content: stretch;
  gap: 4px;
  padding: 10px;
  text-align: left;
}

.mini-list button.selected {
  border-color: var(--accent);
  background: #222719;
}

.project-switcher {
  margin-top: 0;
}

.mini-list span,
.mini-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cap-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.fold {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-row button {
  padding: 7px 10px;
  color: var(--soft);
  font-size: 12px;
}

.quick-row button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mode-row button {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 10px;
  text-align: left;
}

.mode-row button.selected {
  border-color: var(--accent);
  background: #222719;
}

.session-mode-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.session-mode-picker button {
  display: grid;
  gap: 5px;
  align-content: start;
  border: 1px solid var(--line);
  background: #111312;
  color: var(--ink);
  min-height: 92px;
  padding: 10px;
  text-align: left;
}

.session-mode-picker button.selected {
  border-color: var(--accent);
  background: #222719;
}

.session-mode-picker strong {
  font-size: 12px;
  text-transform: uppercase;
}

.session-mode-picker span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.run-panel {
  border-color: #4c5636;
}

.run-panel.running,
.run-panel.submitting {
  border-color: rgba(255, 200, 87, 0.7);
}

.run-panel.completed {
  border-color: rgba(120, 220, 145, 0.62);
}

.run-panel.failed {
  border-color: rgba(255, 107, 95, 0.72);
}

.chat-panel {
  border-color: #4c5636;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

.chat-panel.running,
.chat-panel.sending {
  border-color: rgba(255, 200, 87, 0.7);
}

.chat-panel.completed {
  border-color: rgba(120, 220, 145, 0.62);
}

.chat-panel.failed {
  border-color: rgba(255, 107, 95, 0.72);
}

.chat-panel {
  --chat-font-size: 13px;
}

.run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.run-head h2 {
  margin-bottom: 6px;
  font-size: 28px;
  letter-spacing: 0;
}

.run-head p {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.chat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 18px;
  row-gap: 8px;
}

.chat-session-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.chat-session-meta {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin-top: -8px;
}

.session-display-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.session-display-row .mode-badge {
  min-height: 30px;
}

.session-display-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(560px, -200px + 100%);
  min-width: 100px;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #111312;
  color: var(--ink);
  min-height: 30px;
  padding: 0 11px;
  text-align: left;
}

.session-display-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-display-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.session-state-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: #111312;
  color: var(--muted);
  min-height: 30px;
  width: 30px;
  padding: 0;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.session-state-dot > span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
}

.session-state-dot.completed > span {
  background: var(--green);
}

.session-state-dot.running > span,
.session-state-dot.sending > span {
  background: var(--amber);
}

.session-state-dot.failed > span {
  background: var(--red);
}

.session-usage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid rgba(125, 183, 255, 0.28);
  background: rgba(125, 183, 255, 0.08);
  color: var(--blue);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
}

.status-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-inline-actions button {
  width: auto;
  min-width: 156px;
  padding: 0 12px;
}

.session-name-form {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 42px 42px;
  gap: 8px;
}

.session-name-form input {
  min-height: 40px;
}

.session-path-panel {
  display: grid;
  gap: 8px;
  max-width: min(760px, 100%);
  margin-top: 12px;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(17, 19, 18, 0.72);
  padding: 10px;
}

.token-usage-panel {
  display: grid;
  gap: 8px;
  max-width: min(760px, 100%);
  margin-top: 12px;
  border: 1px solid rgba(125, 183, 255, 0.24);
  background: rgba(24, 38, 58, 0.26);
  padding: 10px;
}

.token-usage-panel.compact {
  max-width: none;
  margin-top: 0;
}

.token-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.token-usage-head > div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.token-usage-head strong {
  font-size: 12px;
  text-transform: uppercase;
}

.token-usage-head span {
  border: 1px solid rgba(215, 255, 99, 0.42);
  background: rgba(215, 255, 99, 0.08);
  color: var(--accent);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
}

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

.token-usage-grid .info {
  min-height: 52px;
  padding: 9px;
}

.token-model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.token-model-list span {
  border: 1px solid rgba(215, 208, 197, 0.16);
  background: #111312;
  color: var(--soft);
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 900;
}

.session-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mode-badge {
  border: 1px solid rgba(125, 183, 255, 0.24);
  background: rgba(125, 183, 255, 0.1);
  color: #cfe2ff;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.session-badges span,
.git-actions-panel .candidate-head span {
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #111312;
  color: var(--soft);
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-head-actions {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-composer {
  --composer-input-height: 128px;
  display: grid;
  gap: 10px;
  position: static;
  z-index: 20;
  background: linear-gradient(180deg, rgba(24, 25, 23, 0.88), rgba(24, 25, 23, 0.98) 28%);
  box-shadow: 0 -18px 34px rgba(0, 0, 0, 0.28);
  padding-top: 10px;
}

.composer-resize-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 12px;
  width: 100%;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: rgba(215, 208, 197, 0.08);
  color: var(--muted);
  cursor: ns-resize;
  touch-action: none;
}

.composer-resize-handle:hover,
.composer-resize-handle:focus-visible {
  border-color: rgba(215, 255, 99, 0.45);
  color: var(--accent);
}

.chat-composer textarea {
  height: var(--composer-input-height);
  min-height: 96px;
  max-height: min(52vh, 420px);
  padding: 10px 11px;
  tab-size: 4;
  font-family: "SFMono-Regular", "Cascadia Code", "Menlo", monospace;
  font-size: var(--chat-font-size);
  line-height: 1.42;
  resize: none;
}

.chat-composer textarea[readonly] {
  border-color: rgba(255, 200, 87, 0.42);
  background: rgba(255, 200, 87, 0.06);
  color: #f7e8c7;
  cursor: text;
}

.attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.attachment-tile {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: min(100%, 230px);
  border: 1px solid rgba(125, 183, 255, 0.28);
  background: rgba(125, 183, 255, 0.08);
  padding: 6px 28px 6px 6px;
}

.attachment-thumb {
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #111312;
  padding: 0;
}

.attachment-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.attachment-meta strong,
.attachment-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

.attachment-meta strong {
  color: #e2ddd2;
  font-size: 12px;
}

.attachment-meta span {
  color: var(--muted);
  font-size: 11px;
}

.attachment-remove,
.attachment-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(53, 22, 22, 0.92);
  color: #fecaca;
}

.attachment-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
}

.attachment-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.attachment-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 22px;
}

.attachment-dialog-body {
  position: relative;
  display: grid;
  gap: 10px;
  max-width: min(920px, 96vw);
  max-height: 92vh;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #111312;
  padding: 12px;
}

.attachment-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
}

.attachment-image-full {
  max-width: calc(96vw - 48px);
  max-height: calc(92vh - 74px);
  object-fit: contain;
  display: block;
}

.attachment-dialog-caption,
.composer-upload-error {
  color: var(--muted);
  font-size: 12px;
}

.composer-upload-error {
  color: #fecaca;
}

.head-icon {
  border-color: rgba(215, 208, 197, 0.2);
  background: #111312;
}

.head-action {
  width: auto;
  min-height: 38px;
  padding: 0 11px;
}

.new-chat-menu {
  position: relative;
}

.new-chat-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  display: grid;
  gap: 6px;
  width: 260px;
  border: 1px solid rgba(215, 255, 99, 0.28);
  background: #111312;
  box-shadow: var(--shadow);
  padding: 8px;
}

.new-chat-popover button {
  justify-content: flex-start;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  min-height: 36px;
  padding: 8px 10px;
  text-align: left;
}

.experience-command-bar {
  grid-column: 1 / -1;
  grid-row: 3;
  min-width: 0;
}

.command-pins {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
}

.command-pins button {
  border: 1px solid rgba(215, 255, 99, 0.24);
  background: rgba(215, 255, 99, 0.06);
  color: var(--ink);
  min-height: 30px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
}

.command-pins button:hover,
.new-chat-popover button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.command-pins span {
  color: var(--muted);
  font-size: 11px;
  padding: 7px 4px;
}

.command-draft-box {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(125, 183, 255, 0.24);
  background: rgba(125, 183, 255, 0.08);
  padding: 10px;
}

.command-draft-box textarea {
  min-height: 88px;
  font-size: 12px;
}

.command-draft-box button {
  justify-self: flex-start;
  width: auto;
  min-height: 34px;
  padding: 0 11px;
}

.command-surface-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.command-manager-dialog {
  width: min(1120px, 100%);
}

.command-manager-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  min-height: min(660px, 76vh);
}

.command-manager-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid rgba(215, 208, 197, 0.12);
  padding-right: 12px;
}

.command-manager-tabs button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  min-height: 52px;
  padding: 10px;
  text-align: left;
}

.command-manager-tabs button.selected {
  border-color: rgba(215, 255, 99, 0.46);
  background: rgba(215, 255, 99, 0.09);
  color: var(--accent);
}

.command-manager-tabs strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-manager-tabs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(215, 208, 197, 0.14);
  color: var(--muted);
  min-width: 26px;
  height: 24px;
  font-size: 11px;
  font-weight: 900;
}

.command-manager-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.command-manager-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(125, 183, 255, 0.18);
  background: rgba(125, 183, 255, 0.07);
  padding: 12px;
}

.command-manager-toolbar > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.command-manager-toolbar strong {
  font-size: 13px;
}

.command-manager-toolbar span,
.command-manager-card span,
.command-manager-card p {
  color: var(--muted);
  font-size: 12px;
}

.compact-primary {
  width: auto;
  min-width: 130px;
  min-height: 38px;
  padding: 0 13px;
}

.command-manager-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.command-manager-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: stretch;
}

.command-manager-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(215, 208, 197, 0.13);
  background: rgba(12, 13, 13, 0.74);
  color: var(--ink);
  min-width: 0;
  padding: 11px;
  text-align: left;
}

.command-manager-card:hover {
  border-color: rgba(215, 255, 99, 0.36);
  background: rgba(215, 255, 99, 0.055);
}

.command-manager-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.command-manager-card strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-manager-card p {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.command-manager-tools {
  display: inline-flex;
  align-items: stretch;
  gap: 5px;
}

.command-manager-tools .icon-button {
  width: 34px;
  min-height: 100%;
}

.danger-icon {
  border-color: rgba(255, 107, 95, 0.35);
  color: #ffb4ad;
}

.command-manager-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  border: 1px dashed rgba(215, 208, 197, 0.22);
  color: var(--muted);
  min-height: 220px;
  padding: 24px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  padding: 24px;
  pointer-events: auto;
  user-select: none;
  overscroll-behavior: contain;
}

.modal-backdrop > * {
  user-select: auto;
}

.command-dialog-backdrop {
  z-index: 140;
}

.command-dialog {
  width: min(760px, 100%);
  max-height: min(840px, 92vh);
  overflow: auto;
  border: 1px solid rgba(215, 255, 99, 0.24);
  background: #151613;
  box-shadow: var(--shadow);
  padding: 16px;
}

.info-dialog {
  width: min(980px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  border: 1px solid rgba(125, 183, 255, 0.26);
  background: #151613;
  box-shadow: var(--shadow);
  padding: 16px;
}

.info-dialog-body {
  display: grid;
  gap: 12px;
}

.info-section {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(17, 19, 18, 0.72);
  padding: 12px;
}

.muted-copy {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.project-info-dialog {
  width: min(940px, 100%);
}

.session-backup-dialog {
  width: min(620px, 100%);
}

.assistant-message-fullscreen-backdrop {
  z-index: 150;
  place-items: start center;
  padding: 16px;
}

.assistant-message-fullscreen-dialog {
  --assistant-message-preview-width: 950px;
  --assistant-message-editor-width: 550px;
  --assistant-message-split-gap: 12px;
  width: min(calc(var(--assistant-message-preview-width) + 34px), 100%);
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.assistant-message-fullscreen-dialog.compare-edit {
  width: min(calc(var(--assistant-message-preview-width) + var(--assistant-message-editor-width) + var(--assistant-message-split-gap) + 34px), 100%);
}

.assistant-message-fullscreen-title {
  min-width: 0;
}

.assistant-message-fullscreen-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-message-fullscreen-navigation {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.assistant-message-fullscreen-nav-button {
  width: 28px;
  min-height: 26px;
}

.assistant-message-fullscreen-return-button {
  min-height: 26px;
}

.assistant-message-fullscreen-edit-button {
  margin-left: 4px;
  width: 28px;
  min-height: 26px;
}

.assistant-message-fullscreen-edit-button.selected {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 44%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.assistant-message-fullscreen-tip {
  color: var(--amber);
  font-size: 12px;
}

.assistant-message-fullscreen-body {
  min-height: 0;
  overflow: auto;
  padding-top: 12px;
}

.assistant-message-fullscreen-body.compare-edit {
  display: grid;
  grid-template-columns: minmax(0, 95fr) minmax(0, 55fr);
  align-items: stretch;
  gap: var(--assistant-message-split-gap);
  overflow: hidden;
}

.assistant-message-fullscreen-preview {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.assistant-message-fullscreen-editor {
  min-height: 240px;
  display: flex;
}

.assistant-message-fullscreen-editor textarea {
  width: 100%;
  min-height: 100%;
  max-height: calc(100vh - 132px);
  resize: none;
  background: var(--panel);
  color: var(--ink);
  padding: 12px;
  font-family: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  font-size: var(--chat-font-size);
  line-height: 1.55;
  tab-size: 4;
  outline: none;
}

.assistant-message-fullscreen-editor textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.assistant-message-fullscreen-body .chat-message {
  min-height: 100%;
}

.assistant-message-fullscreen-body.compare-edit .chat-message {
  min-height: 0;
}

.assistant-message-fullscreen-body .chat-message > p {
  max-height: none;
  overflow: visible;
}

.backup-warning-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.backup-download-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-create-dialog {
  width: min(720px, 100%);
}

.project-create-source-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
}

.project-directory-browser {
  display: grid;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 7px;
  height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(12, 13, 13, 0.58);
  padding: 8px;
}

.project-directory-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: #111312;
  color: var(--ink);
  padding: 0 10px;
  text-align: left;
}

.project-directory-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-directory-row time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-directory-row.file,
.project-directory-row:disabled {
  cursor: default;
  opacity: 0.48;
}

.project-create-submit {
  width: 100%;
}

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

.project-git-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-git-actions button {
  min-width: 112px;
}

.project-git-result {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(120, 220, 145, 0.28);
  background: rgba(22, 39, 30, 0.35);
  padding: 10px;
}

.project-git-result pre {
  max-height: 140px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--soft);
  font-size: 12px;
}

.sdk-manager-dialog {
  width: min(860px, 100%);
}

.sdk-section {
  gap: 12px;
}

.sdk-config-list {
  display: grid;
  gap: 8px;
}

.sdk-config-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(220px, 1fr) minmax(96px, auto);
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.sdk-config-row.add-sdk-row .sdk-version-select {
  grid-column: 2 / 4;
}

.sdk-type-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  border: 1px solid #3d3b36;
  background: var(--field);
  padding: 0 12px;
}

.sdk-type-cell img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.sdk-type-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.sdk-type-cell select,
.sdk-version-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 32px 0 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 11px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

.sdk-type-cell select {
  min-height: 38px;
  border: 0;
  background-color: transparent;
  padding-left: 0;
}

.sdk-type-cell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(215, 255, 99, 0.2);
}

.sdk-type-cell select:focus {
  box-shadow: none;
}

.sdk-version-cell {
  display: block;
  min-width: 0;
  min-height: 40px;
  border: 1px solid #3d3b36;
  background: var(--field);
  padding: 0 12px;
  line-height: 38px;
  overflow: hidden;
  color: var(--soft);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.dialog-actions.sdk-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.dialog-actions.sdk-actions button {
  width: 100%;
}

.external-context-section {
  gap: 12px;
}

.external-context-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) minmax(280px, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.external-context-form .secondary {
  min-width: 86px;
}

.external-context-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 3px;
}

.external-context-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.32fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(12, 13, 13, 0.72);
  padding: 10px;
}

.external-context-row > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.external-context-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-context-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.external-context-row .path-line {
  padding: 0;
  border-bottom: 0;
}

.external-context-row .icon-button {
  width: 34px;
  min-height: 34px;
}

.danger-section {
  border-color: rgba(255, 107, 95, 0.42);
  background: rgba(255, 107, 95, 0.08);
}

.project-delete-section,
.session-delete-section {
  margin-top: 2px;
}

.subtle-danger {
  justify-self: start;
  width: auto;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border-color: rgba(255, 107, 95, 0.32);
  background: rgba(255, 107, 95, 0.08);
  color: #ffb4ad;
}

.delete-confirm {
  display: grid;
  gap: 9px;
}

.delete-confirm p {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.delete-confirm small {
  color: #ffb4ad;
  font-weight: 800;
}

.delete-confirm input {
  max-width: 420px;
  border-color: rgba(255, 107, 95, 0.34);
}

.info-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.info-section-head strong {
  font-size: 12px;
  text-transform: uppercase;
}

.info-section-head span {
  border: 1px solid rgba(120, 220, 145, 0.34);
  background: rgba(22, 39, 30, 0.46);
  color: var(--green);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dialog-head > div {
  display: grid;
  gap: 4px;
}

.dialog-head span {
  color: var(--muted);
  font-size: 12px;
}

.dialog-head > .dialog-head-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-actions button {
  width: auto;
  min-width: 108px;
  padding: 0 14px;
}

.agent-settings-dialog {
  max-width: 760px;
}

.agent-config-section {
  gap: 10px;
}

.agent-config-section label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.model-settings-dialog {
  width: min(860px, 100%);
}

.credential-dialog {
  width: min(820px, 100%);
}

.credential-backdrop {
  z-index: 170;
}

.credential-add-dialog,
.credential-certificate-dialog {
  width: min(620px, 100%);
}

.credential-certificate-view-dialog {
  width: min(760px, 100%);
}

.provider-edit-dialog {
  width: min(560px, 100%);
}

.modal-backdrop.nested {
  z-index: 180;
}

.credential-unlock-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.68);
}

.credential-unlock-dialog {
  width: min(460px, 100%);
  border: 1px solid rgba(125, 183, 255, 0.3);
  background: #151613;
  box-shadow: var(--shadow);
  padding: 16px;
}

.credential-unlock-header h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.credential-unlock-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.credential-unlock-meta {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.credential-unlock-input,
.credential-unlock-retention select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #0e100f;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.credential-unlock-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.credential-unlock-retention {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.credential-unlock-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.credential-unlock-buttons button {
  min-height: 38px;
}

.credential-unlock-toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 270;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}

.credential-unlock-toast {
  border: 1px solid rgba(125, 183, 255, 0.26);
  background: #151613;
  box-shadow: var(--shadow);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .credential-unlock-backdrop {
    padding: 14px;
  }

  .credential-unlock-dialog {
    width: min(420px, 100%);
  }

  .credential-unlock-actions {
    grid-template-columns: 1fr;
  }

  .credential-unlock-buttons {
    justify-content: end;
  }

  .credential-unlock-toasts {
    top: auto;
    right: 12px;
    bottom: 74px;
    left: 12px;
    width: auto;
  }
}

.provider-config-section,
.model-setting-section {
  gap: 12px;
}

.model-provider-list {
  display: grid;
  gap: 8px;
}

.model-provider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: #111312;
  padding: 10px;
}

.model-provider-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.model-provider-name,
.model-provider-actions,
.model-provider-meta,
.model-setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.model-provider-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-provider-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.model-provider-meta .state-chip {
  padding: 3px 6px;
  font-size: 10px;
}

.model-provider-actions button {
  min-width: 58px;
  min-height: 32px;
  padding: 0 10px;
}

.credential-dialog-body,
.credential-git-section,
.credential-list-section,
.credential-form {
  gap: 12px;
}

.credential-section-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.credential-section-head-actions .secondary {
  min-width: 86px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.info-section-head .credential-section-head-actions span {
  flex: 0 0 auto;
}

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

.credential-setting-list,
.credential-certificate-list {
  display: grid;
  gap: 8px;
}

.credential-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: #111312;
  padding: 10px;
}

.credential-row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.credential-row-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-row-main small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-row > button,
.credential-row-actions button {
  min-width: 58px;
  min-height: 32px;
  padding: 0 10px;
}

.credential-row-actions,
.credential-title-line,
.credential-actions,
.credential-view-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.credential-title-line .state-chip {
  padding: 3px 6px;
  font-size: 10px;
}

.credential-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.credential-actions button {
  width: 100%;
}

.credential-form label:not(.credential-switch) {
  display: grid;
  gap: 6px;
}

.credential-form input,
.credential-form select,
.credential-form textarea {
  font-size: 16px;
  font-weight: normal;
}

.credential-form small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.credential-form select {
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
}

.credential-form textarea {
  min-height: 132px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  line-height: 1.45;
  resize: vertical;
}

.credential-switch {
  margin-top: 2px;
}

.credential-certificate-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.credential-certificate-add button {
  min-width: 116px;
}

.credential-view-head {
  justify-content: space-between;
}

.credential-view-head .secondary {
  width: auto;
  min-width: 78px;
  min-height: 32px;
  padding: 0 10px;
}

.credential-certificate-view-dialog textarea {
  min-height: 320px;
  font-family: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.credential-view-nested {
  z-index: 220;
}

.danger-lite {
  border-color: rgba(255, 107, 95, 0.32);
  color: var(--red);
}

.full-width {
  width: 100%;
  justify-content: center;
}

.provider-form {
  gap: 12px;
}

.provider-form label,
.model-setting-section {
  min-width: 0;
}

.provider-form label:not(.checkbox-line):not(.experimental-api-switch) {
  display: grid;
  gap: 6px;
}

.provider-form input,
.provider-form select {
  font-size: 16px;
  font-weight: normal;
}

.model-provider-switch {
  margin-top: 2px;
}

.model-setting-section > select {
  width: 100%;
}

.provider-form select,
.model-setting-section select {
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
}

.model-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 170px) 42px;
}

.model-setting-row input,
.model-setting-row select {
  min-width: 0;
  height: 40px;
  border-radius: 4px;
}

.model-choice-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}

.model-choice-wrap .icon-only-ish {
  width: 42px;
  min-width: 42px;
  padding: 0;
  justify-content: center;
  border-radius: 4px;
}

.model-choice-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  width: min(360px, 82vw);
  max-height: min(360px, 58vh);
  overflow: auto;
  border: 1px solid rgba(215, 208, 197, 0.2);
  background: #151613;
  box-shadow: var(--shadow);
  padding: 6px;
}

.model-choice-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 6px;
}

.model-choice-menu button:not(.icon-button) {
  width: 100%;
  min-height: 28px;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  text-align: left;
}

.model-choice-menu button:not(.icon-button):hover {
  background: rgba(215, 255, 99, 0.1);
}

.model-choice-empty {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 8px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 720px) {
  .model-provider-row,
  .model-setting-row {
    grid-template-columns: 1fr;
  }

  .model-provider-actions {
    justify-content: stretch;
  }

  .model-provider-actions button {
    flex: 1;
  }
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.checkbox-line input {
  width: auto;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  padding: 4px;
  background: #101211;
}

.segmented-control button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 900;
}

.segmented-control button.selected {
  background: var(--panel);
  color: var(--text);
}

.compact-segmented {
  width: 240px;
  max-width: 100%;
}

.aux-panel {
  display: grid;
  gap: 9px;
  min-height: 0;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: rgba(17, 19, 18, 0.74);
  padding: 10px;
}

.aux-tabs-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: rgba(17, 19, 18, 0.74);
  padding: 10px;
}

.aux-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 9px;
}

.aux-tabs button,
.candidate-filter button {
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: #111312;
  color: var(--muted);
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.aux-tabs button.selected,
.candidate-filter button.selected {
  border-color: rgba(215, 255, 99, 0.42);
  background: rgba(215, 255, 99, 0.12);
  color: var(--ink);
}

.aux-tab-body {
  min-height: 0;
  overflow: hidden;
}

.aux-empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(215, 208, 197, 0.18);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.aux-tabs-panel .aux-panel {
  border: 0;
  background: transparent;
  padding: 0;
}

.aux-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.aux-panel-head > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.aux-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.candidate-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  max-height: none;
  overflow: hidden;
  border-color: rgba(125, 183, 255, 0.22);
  background: rgba(18, 24, 30, 0.62);
}

.candidate-panel:has(.candidate-running-strip) {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.ideas-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 200, 87, 0.28);
  background: rgba(48, 39, 24, 0.34);
}

.ideas-panel:has(.idea-run-note) {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.candidate-filter,
.idea-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.idea-filter button {
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: #111312;
  color: var(--muted);
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.idea-filter button.selected {
  border-color: rgba(255, 200, 87, 0.42);
  background: rgba(255, 200, 87, 0.16);
  color: var(--ink);
}

.idea-run-note {
  border: 1px solid rgba(255, 200, 87, 0.22);
  background: rgba(255, 200, 87, 0.08);
  color: #f4dfaa;
  padding: 8px 10px;
  font-size: 12px;
}

.side-search {
  position: relative;
  display: block;
}

.side-search span {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0 0 0 0);
}

.side-search input {
  min-height: 34px;
  padding: 8px 10px;
  border-color: rgba(215, 208, 197, 0.16);
  background: rgba(12, 13, 13, 0.78);
  font-size: 12px;
}

.idea-form,
.candidate-form {
  display: grid;
  gap: 8px;
}

.candidate-form {
  border-bottom: 1px solid rgba(125, 183, 255, 0.18);
  padding-bottom: 9px;
}

.idea-form textarea,
.candidate-form textarea {
  min-height: 132px;
  max-height: 280px;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.42;
}

.candidate-form textarea {
  min-height: 124px;
  max-height: 260px;
}

.idea-form-actions,
.candidate-form-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.idea-form-actions button,
.candidate-form-actions button {
  flex: 1;
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

.idea-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.idea-item {
  display: grid;
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(255, 200, 87, 0.18);
  background: rgba(17, 19, 18, 0.7);
  color: var(--soft);
  padding: 9px;
}

.idea-item:hover {
  border-color: rgba(255, 200, 87, 0.5);
}

.idea-item.archived {
  border-color: rgba(215, 208, 197, 0.13);
  background: rgba(15, 16, 15, 0.68);
}

.idea-main {
  display: grid;
  min-width: 0;
}

.idea-main p {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.idea-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.idea-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(215, 208, 197, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  min-height: 30px;
  min-width: 30px;
  padding: 0 8px;
}

.idea-tools button.secondary:not(.idea-queue-button) {
  border-color: #486a92;
  background: #18263a;
  flex: 1 1 100%;
  min-width: 0;
}

.idea-tools .idea-queue-button {
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  padding: 0;
  border-color: #486a92;
  background: #18263a;
}

.idea-tools button:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--ink);
}

.idea-tools.archived-tools button.secondary {
  min-width: 96px;
}

.idea-queue-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(120, 220, 145, 0.42);
  background: rgba(22, 39, 30, 0.5);
  color: var(--green);
  min-height: 30px;
  min-width: 86px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.session-warning {
  border: 1px solid rgba(255, 200, 87, 0.48);
  background: rgba(255, 200, 87, 0.09);
  color: #f4dfaa;
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 12px;
}

.session-warning.danger-tone {
  border-color: rgba(255, 117, 117, 0.46);
  background: rgba(255, 117, 117, 0.08);
  color: #ffcece;
}

.git-actions-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(125, 183, 255, 0.34);
  background: rgba(24, 38, 58, 0.42);
  padding: 12px;
}

.session-result-panel {
  border: 1px solid rgba(120, 220, 145, 0.28);
  background: rgba(22, 39, 30, 0.35);
}

.result-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}

.suggested-actions,
.git-action-buttons,
.worktree-state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggested-actions button,
.git-action-buttons button {
  min-width: 128px;
  padding: 0 12px;
}

.worktree-state span {
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #111312;
  color: var(--soft);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.command-list {
  display: grid;
  gap: 8px;
}

.command-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: #101211;
  padding: 10px;
}

.command-line div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.command-line strong {
  font-size: 11px;
  text-transform: uppercase;
}

.command-line code {
  color: var(--soft);
  font-family: "SFMono-Regular", "Cascadia Code", monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.candidate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.candidate-head > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.candidate-head strong {
  font-size: 12px;
  text-transform: uppercase;
}

.candidate-head button {
  min-width: 116px;
  padding: 0 12px;
}

.candidate-actions-head button {
  min-width: 116px;
  padding: 0 12px;
}

.candidate-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.starred-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}

.starred-scope {
  display: grid;
  gap: 5px;
}

.starred-scope span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.starred-scope select {
  min-height: 34px;
}

.starred-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.starred-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border: 1px solid #37352f;
  background: #151613;
  min-height: 112px;
  overflow: hidden;
  padding: 8px;
}

.starred-item:hover {
  border-color: var(--accent);
}

.starred-main {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.starred-main p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.32;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.starred-tools {
  grid-template-columns: repeat(1, 26px);
}

.candidate-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 8px;
  gap: 5px;
  border: 1px solid #37352f;
  background: #151613;
  color: var(--soft);
  height: 112px;
  min-height: 112px;
  overflow: hidden;
  padding: 8px;
}

.candidate-item:hover {
  border-color: var(--accent);
}

.candidate-item.sent {
  border-color: rgba(120, 220, 145, 0.42);
  background: rgba(22, 39, 30, 0.5);
}

.candidate-item.running {
  border-color: rgba(99, 179, 237, 0.5);
  background: rgba(18, 32, 48, 0.5);
}

.candidate-running-strip {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(125, 183, 255, 0.34);
  background: rgba(18, 32, 48, 0.58);
  color: var(--soft);
  max-height: 128px;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.candidate-running-strip span,
.candidate-running-strip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.candidate-running-strip p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.candidate-main {
  display: grid;
  gap: 5px;
  align-content: start;
  border: 0;
  background: transparent;
  color: inherit;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  text-align: left;
}

.candidate-main:disabled {
  cursor: default;
  opacity: 0.74;
}

.candidate-tools {
  display: grid;
  grid-template-columns: repeat(2, 26px);
  align-self: start;
  gap: 4px;
  margin-top: 0;
}

.candidate-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(215, 208, 197, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  height: 26px;
  min-width: 0;
  padding: 0;
}

.candidate-tools button:disabled {
  color: rgba(215, 208, 197, 0.28);
  cursor: not-allowed;
}

.candidate-tools button:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--ink);
}

.candidate-main p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.32;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.candidate-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 32px;
  overflow: hidden;
}

.candidate-meta span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.candidate-meta .source-chip {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 200, 87, 0.32);
  background: rgba(255, 200, 87, 0.1);
  color: #f4dfaa;
  padding: 2px 5px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  -webkit-line-clamp: unset;
}

.composer-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.composer-command-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.composer-command-strip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
}

.composer-command-strip button.selected {
  border-color: rgba(215, 255, 99, 0.62);
  background: rgba(215, 255, 99, 0.12);
  color: var(--accent);
}

.composer-draft-icon {
  flex: 0 0 auto;
}

.composer-draft-icon.pending,
.composer-draft-icon.saving {
  color: var(--blue);
}

.composer-draft-icon.conflict,
.composer-draft-icon.error {
  color: #ffc857;
}

.composer-next-menu-wrap {
  position: relative;
  display: inline-flex;
}

.composer-command-strip .composer-next-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(125, 183, 255, 0.28);
  background: rgba(125, 183, 255, 0.08);
  color: #d7e8ff;
}

.composer-command-strip .composer-next-toggle:hover,
.composer-command-strip .composer-next-toggle.selected {
  border-color: rgba(125, 183, 255, 0.58);
  background: rgba(125, 183, 255, 0.15);
  color: #eef6ff;
}

.composer-next-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 24;
  display: grid;
  gap: 7px;
  width: max-content;
  min-width: 238px;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(125, 183, 255, 0.22);
  background: #171a1d;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  padding: 8px;
}

.composer-next-actions {
  display: grid;
  gap: 6px;
}

.composer-command-strip .composer-next-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--soft);
  overflow: hidden;
  padding: 0 9px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-command-strip .composer-next-menu button:hover:not(:disabled) {
  border-color: rgba(125, 183, 255, 0.3);
  background: rgba(125, 183, 255, 0.1);
  color: #d7e8ff;
}

.composer-next-menu button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-command-strip .composer-next-extract {
  border-top-color: rgba(215, 255, 99, 0.16);
}

.composer-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #c8ed5d;
  background: var(--accent);
  color: #11120f;
  min-width: 118px;
  min-height: 44px;
  padding: 0 15px;
  font-weight: 950;
}

.composer-submit.cancel {
  border-color: rgba(248, 113, 113, 0.55);
  background: #351616;
  color: #fecaca;
}

.composer-submit.queue {
  border-color: rgba(255, 200, 87, 0.55);
  background: #342712;
  color: #ffe0a3;
}

.composer-submit.save {
  border-color: rgba(120, 220, 145, 0.56);
  background: #193a25;
  color: #ccffd8;
}

.composer-action-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  position: relative;
}

.composer-file-input {
  display: none;
}

.composer-attach-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(125, 183, 255, 0.32);
  background: rgba(125, 183, 255, 0.09);
  color: var(--blue);
  width: 44px;
  height: 44px;
  font-weight: 900;
}

.composer-attach-toggle:hover:not(:disabled) {
  border-color: rgba(125, 183, 255, 0.62);
  background: rgba(125, 183, 255, 0.16);
}

.composer-save-menu-wrap {
  position: relative;
}

.composer-save-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  width: 44px;
  height: 44px;
  font-weight: 900;
}

.composer-save-toggle:hover,
.composer-save-toggle.selected {
  border-color: rgba(255, 200, 87, 0.55);
  background: rgba(255, 200, 87, 0.12);
  color: #f4dfaa;
}

.composer-save-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 198px;
  border: 1px solid rgba(215, 208, 197, 0.16);
  background: #181916;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  padding: 8px;
}

.composer-save-menu button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--soft);
  min-height: 36px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.composer-save-menu button:hover:not(:disabled) {
  border-color: rgba(215, 255, 99, 0.28);
  background: rgba(215, 255, 99, 0.09);
  color: var(--accent);
}

.composer-edit-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(120, 220, 145, 0.28);
  background: rgba(120, 220, 145, 0.08);
  color: #c9ffd5;
  min-height: 34px;
  padding: 6px 8px;
}

.composer-edit-state span,
.composer-edit-state button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 900;
}

.composer-edit-state button {
  border: 1px solid rgba(255, 107, 95, 0.24);
  background: rgba(255, 107, 95, 0.08);
  color: #ffb4ad;
  min-height: 26px;
  padding: 0 8px;
}

.event-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.run-head.slim {
  align-items: center;
  padding-bottom: 10px;
}

.run-head.slim .section-title {
  margin-bottom: 0;
}

.phase-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.phase-row div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #111312;
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.phase-row div.done {
  border-color: rgba(120, 220, 145, 0.45);
  color: var(--green);
}

.phase-row div.active {
  border-color: var(--amber);
  color: var(--amber);
}

.run-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.info {
  display: grid;
  gap: 6px;
  min-height: 66px;
  border: 1px solid var(--line);
  background: #111312;
  padding: 11px;
}

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

.event-list {
  display: grid;
  gap: 8px;
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow: auto;
  margin-top: 14px;
  padding-right: 4px;
}

.event-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: start;
  gap: 8px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #555;
  background: #101211;
  padding: 10px;
}

.event-row.plan {
  border-left-color: var(--blue);
}

.event-row.review-1,
.event-row.review-2 {
  border-left-color: var(--amber);
}

.event-row.execute {
  border-left-color: var(--accent);
}

.event-row.commit {
  border-left-color: var(--green);
}

.event-row.reasoning_summary {
  border-left-color: var(--amber);
  background: #17150f;
}

.event-row.codex_progress {
  border-left-color: var(--blue);
}

.event-row.assistant_response,
.event-row.assistant_response_started {
  border-left-color: var(--accent);
}

.event-row strong {
  font-size: 12px;
  text-transform: uppercase;
}

.event-row p {
  color: #e2ddd2;
  line-height: 1.4;
  word-break: break-word;
}

.event-row time {
  grid-column: 2;
}

.run-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.run-actions button {
  padding: 0 14px;
}

.files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  background: #111312;
  padding: 11px;
}

.files span {
  color: var(--soft);
  font-size: 12px;
}

.chat-log-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #111312;
}

.chat-log {
  display: block;
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow: auto;
  margin-top: 0;
  border: 0;
  background: #111312;
  padding: 12px;
}

.chat-status-tip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  flex: 0 0 20px;
  height: 20px;
  border-top: 1px solid rgba(215, 208, 197, 0.12);
  color: #9d978e;
  padding: 0 8px;
  font-size: 11px;
}

.chat-status-plan,
.chat-status-context,
.chat-status-context-wrap,
.plan-status-summary,
.plan-status-active-text {
  min-width: 0;
}

.chat-status-context-wrap {
  position: relative;
  justify-self: end;
  outline: none;
}

.chat-status-context {
  white-space: nowrap;
}

.chat-status-context-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 5px);
  z-index: 12;
  display: none;
  min-width: 200px;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #171915;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  padding: 8px;
}

.chat-status-context-wrap:hover .chat-status-context-popover,
.chat-status-context-wrap:focus-within .chat-status-context-popover {
  display: grid;
  gap: 4px;
}

.chat-status-context-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  font-family: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.45;
  color: #c7c1b8;
}

.chat-status-context-row span {
  text-align: left;
}

.chat-status-context-row strong {
  font-weight: 700;
  text-align: right;
  color: #f0ece3;
}

.plan-status-summary {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

.plan-status-summary > span:first-child {
  flex: 0 0 auto;
}

.plan-status-active-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-status-wrap {
  position: relative;
  max-width: 100%;
}

.plan-status-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 5px);
  z-index: 12;
  display: none;
  width: min(460px, 72vw);
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: #171915;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  padding: 8px;
}

.plan-status-wrap:hover .plan-status-popover,
.plan-status-wrap:focus-within .plan-status-popover {
  display: block;
}

.chat-history-status {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 8px;
  border: 1px solid rgba(125, 183, 255, 0.22);
  background: rgba(17, 19, 18, 0.94);
  color: var(--muted);
  padding: 6px 8px;
  font-size: 12px;
  text-align: center;
}

.chat-history-status.error {
  border-color: rgba(255, 112, 112, 0.32);
  color: #ffb6b6;
}

.chat-log > strong {
  font-size: 12px;
  text-transform: uppercase;
}

.empty-chat {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.chat-message {
  display: grid;
  gap: 6px;
  border: 1px solid #302f2b;
  background: #151613;
  padding: 10px;
}

.message-group {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-log > .message-group:last-child,
.chat-log > .chat-message:last-child {
  margin-bottom: 0;
}

.chat-message.user {
  border-color: rgba(125, 183, 255, 0.45);
}

.chat-message.assistant {
  border-color: rgba(215, 255, 99, 0.38);
}

.chat-message.pending {
  border-color: rgba(255, 200, 87, 0.48);
  background: #17150f;
}

.chat-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-message-header > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.message-action-toggle {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0 0 0 8px;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: none;
}

.message-action-toggle:hover,
.message-action-toggle:focus-visible {
  color: #d7ff63;
}

.chat-message-header time {
  color: #8d877c;
  font-size: 12px;
  white-space: nowrap;
}

.chat-message-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.message-star-button {
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #777268;
  width: 18px;
  padding: 0;
}

.message-group:hover .message-star-button,
.chat-message:hover .message-star-button,
.message-star-button:focus-visible,
.message-star-button.starred {
  display: inline-flex;
}

.message-star-button.starred {
  color: var(--amber);
}

.message-star-button:hover {
  color: var(--accent);
}

.message-group-focused .chat-message {
  outline: 2px solid rgba(215, 255, 99, 0.55);
  outline-offset: 2px;
}

.chat-message .attachment-meta span {
  display: block;
  text-transform: none;
}

.chat-message > p {
  color: #e2ddd2;
  font-size: var(--chat-font-size);
  line-height: 1.45;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
}

.message-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.message-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  padding: 0;
}

.message-icon-action:hover,
.message-icon-action:focus-visible {
  border-color: rgba(125, 183, 255, 0.42);
  color: var(--blue);
}

.message-usage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid rgba(125, 183, 255, 0.26);
  background: rgba(125, 183, 255, 0.08);
  color: var(--blue);
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1;
}

.message-duration {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(215, 208, 197, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #aaa49a;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: none;
}

.message-duration svg {
  color: var(--amber);
}

.message-usage strong {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.message-usage small {
  color: var(--soft);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.message-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(215, 208, 197, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
}

.message-copy:hover {
  border-color: rgba(215, 255, 99, 0.38);
  color: var(--accent);
}

.markdown-message {
  color: #e2ddd2;
  font-size: var(--chat-font-size);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.markdown-message > * + * {
  margin-top: 8px;
}

.markdown-message h1,
.markdown-message h2,
.markdown-message h3 {
  color: var(--ink);
  font-size: calc(var(--chat-font-size) + 2px);
  line-height: 1.25;
}

.markdown-message p,
.markdown-message li {
}

.markdown-message p,
.markdown-message ul,
.markdown-message ol,
.markdown-message blockquote,
.markdown-message table,
.markdown-message pre {
  margin: 0;
}

.markdown-message ul,
.markdown-message ol {
  padding-left: 20px;
}

.markdown-message li + li {
}

.markdown-message code {
  border: 1.5px solid rgba(215, 208, 197, 0.16);
  background: #0d0f0e;
  color: var(--accent);
  padding: 1px 5px;
  font-family: "SFMono-Regular", "Cascadia Code", monospace;
  font-size: calc(var(--chat-font-size) - 1px);
  border-radius: 5px;
}

.markdown-message pre {
  max-width: 100%;
  overflow: auto;
  border: 1px solid rgba(215, 208, 197, 0.16);
  background: #0d0f0e;
  padding: 2px 5px;
  border-radius: 5px;
  text-wrap: pretty;
}

.markdown-message pre code {
  border: 0;
  background: transparent;
  color: var(--soft);
  padding: 0;
}

.markdown-message table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.markdown-message th,
.markdown-message td {
  border: 1px solid rgba(215, 208, 197, 0.16);
  padding: 6px 8px;
  text-align: left;
}

.markdown-message a {
  color: var(--blue);
}

.mentioned-file-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.mentioned-file-link:hover,
.mentioned-file-link:focus-visible {
  color: var(--accent);
}

.mentioned-file-code-link {
  font-family: inherit;
  font-size: inherit;
}

.mentioned-file-backdrop {
  z-index: 120;
}

.mentioned-file-dialog {
  width: min(1180px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 32px));
}

.mentioned-file-panel {
  display: grid;
  grid-template-rows: auto auto minmax(360px, min(70vh, 720px));
  min-height: 0;
}

.mentioned-file-panel.no-head {
  grid-template-rows: auto minmax(360px, min(70vh, 720px));
}

.mentioned-file-dialog .mentioned-file-panel,
.assistant-message-fullscreen-preview .mentioned-file-panel {
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.mentioned-file-dialog .mentioned-file-panel.no-head,
.assistant-message-fullscreen-preview .mentioned-file-panel.no-head {
  grid-template-rows: auto minmax(0, 1fr);
}

.assistant-message-fullscreen-body > .mentioned-file-panel {
  min-height: min(720px, calc(100vh - 132px));
}

.assistant-message-fullscreen-body.compare-edit .mentioned-file-panel {
  min-height: 0;
}

.mentioned-file-head,
.mentioned-file-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.mentioned-file-head {
  justify-content: space-between;
}

.mentioned-file-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mentioned-file-tools-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  border: 1px solid rgba(215, 208, 197, 0.12);
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.025);
  padding: 6px 8px;
}

.mentioned-file-tool-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mentioned-file-tools-tip .segmented.compact,
.mentioned-file-tools-tip .message-copy,
.mentioned-file-diff-button {
  min-height: 28px;
}

.mentioned-file-tools-tip .segmented.compact button {
  min-height: 26px;
}

.mentioned-file-preview {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: #0d0f0e;
}

.mentioned-file-diff-button {
  border: 1px solid rgba(125, 183, 255, 0.42);
  background: transparent;
  color: var(--accent);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mentioned-file-diff-button.active {
  background: rgba(125, 183, 255, 0.14);
}

.mentioned-file-diff-button.new {
  border-color: rgba(88, 214, 141, 0.58);
  color: var(--green);
}

.mentioned-file-diff-button.clean {
  border-color: rgba(215, 208, 197, 0.22);
  color: var(--muted);
}

.mentioned-file-diff-button:disabled {
  cursor: default;
  opacity: 1;
}

.mentioned-file-text,
.mentioned-file-frame,
.mentioned-file-media,
.mentioned-file-markdown,
.mentioned-file-diff,
.mentioned-file-codemirror {
  width: 100%;
  height: 100%;
}

.mentioned-file-text {
  resize: none;
  border: 0;
  background: #0d0f0e;
  color: var(--ink);
  padding: 14px;
  font: 12px/1.55 "SFMono-Regular", "Cascadia Code", monospace;
  outline: none;
}

.mentioned-file-markdown {
  overflow: auto;
  padding: 16px;
}

.mentioned-file-diff {
  overflow: auto;
  background: #0d1117;
  color: #e6edf3;
  font-size: 12px;
}

.mentioned-file-diff .d2h-file-header {
  display: none;
}

.mentioned-file-diff .d2h-code-wrapper {
  min-width: 100%;
  overflow-x: auto;
}

.mentioned-file-diff .d2h-diff-table {
  min-width: 100%;
}

.mentioned-file-diff .d2h-code-linenumber {
  display: table-cell;
  min-width: 7.5em;
  position: static;
  vertical-align: top;
  width: 7.5em;
}

.mentioned-file-diff .d2h-code-line {
  padding-left: 1em;
  padding-right: 1em;
  width: auto;
}

.mentioned-file-frame {
  border: 0;
  background: #fff;
}

.mentioned-file-media {
  display: block;
  object-fit: contain;
  background: #000;
}

.mentioned-file-audio {
  width: calc(100% - 32px);
  margin: 24px 16px;
}

.source-chip.command {
  border-color: rgba(125, 183, 255, 0.38);
  background: rgba(125, 183, 255, 0.1);
  color: var(--blue);
}

.thinking-block {
  border: 1px solid rgba(255, 200, 87, 0.38);
  background: rgba(255, 200, 87, 0.07);
  padding: 10px;
}

.thinking-block summary {
  color: var(--amber);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.thinking-block div {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.thinking-block p {
  color: #e8ddc1;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.pending-agent-output {
  border: 1px solid rgba(125, 183, 255, 0.22);
  background: rgba(125, 183, 255, 0.06);
  padding: 10px;
}

.pending-agent-output .markdown-message {
  font-size: var(--chat-font-size);
}

.pending-agent-output .markdown-message > :last-child {
  margin-bottom: 0;
}

.assistant-actions {
  display: grid;
  gap: 3px;
}

.assistant-thought-action,
.assistant-tool-action,
.assistant-plan-action,
.assistant-context-action {
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: var(--chat-font-size);
  border-radius: 6px;
}

.assistant-thought-action,
.assistant-context-action {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  padding: 4px 9px;
}

.assistant-thought-action svg,
.assistant-context-action svg {
  color: var(--amber);
  margin-top: 2px;
}

.assistant-thought-action span {
  display: block;
  color: #aaa49a;
  font-size: var(--chat-font-size);
  text-transform: none;
  white-space: pre-wrap;
}

.assistant-context-action span {
  display: block;
  color: #aaa49a;
  font-size: calc(var(--chat-font-size) - 1px);
  text-transform: none;
  white-space: pre-wrap;
}

.assistant-action-duration {
  display: inline-block;
  margin-right: 6px;
  color: #8d877c;
  font-size: calc(var(--chat-font-size) - 1px);
  font-weight: 500;
}

.assistant-tool-action,
.assistant-plan-action {
  padding: 0;
}

.assistant-tool-action summary,
.assistant-tool-action-summary,
.assistant-plan-action summary,
.assistant-plan-action-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 5px 9px;
  color: #aaa49a;
  cursor: pointer;
  font-size: calc(var(--chat-font-size) - 2px);
  text-align: left;
}

.assistant-tool-action summary span,
.assistant-tool-action-summary span,
.assistant-plan-action summary span,
.assistant-plan-action-summary span {
  color: #aaa49a;
  font-size: calc(var(--chat-font-size) - 2px);
  text-transform: none;
}

.assistant-tool-action summary svg,
.assistant-tool-action-summary svg,
.assistant-plan-action summary svg,
.assistant-plan-action-summary svg {
  color: var(--amber);
}

.assistant-tool-events,
.assistant-plan-steps {
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(215, 208, 197, 0.12);
  padding: 7px 9px 9px;
}

.plan-status-rows {
  display: grid;
  gap: 6px;
}

.plan-status-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  color: #9d978e;
  font-size: calc(var(--chat-font-size) - 1px);
  line-height: 1.35;
}

.plan-status-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-status-row.completed svg {
  color: var(--green);
}

.plan-status-row.inProgress svg,
.plan-status-summary svg {
  color: var(--amber);
}

.plan-status-row.pending svg {
  color: #8d877c;
}

.assistant-tool-action.preview .assistant-tool-events {
  max-height: 150px;
  overflow-y: auto;
}

.assistant-tool-action.expanded .assistant-tool-events {
  max-height: none;
  overflow: visible;
}

.assistant-tool-event {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  color: #9d978e;
  font-size: calc(var(--chat-font-size) - 1px);
  line-height: 1.4;
}

.assistant-tool-event span {
  display: block;
  color: #9d978e;
  font-size: calc(var(--chat-font-size) - 1px);
  line-height: 1.4;
  text-transform: none;
}

.assistant-tool-event svg {
  margin-top: 2px;
  color: var(--amber);
}

.assistant-tool-event.tool_result svg {
  color: var(--green);
}

.activity-timeline {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(255, 200, 87, 0.22);
  padding-top: 8px;
}

.activity-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  color: #d8d0c2;
  font-size: 12px;
  line-height: 1.4;
}

.activity-item svg {
  margin-top: 2px;
  color: var(--amber);
}

.activity-item.tool_result svg,
.activity-item.assistant_response_started svg {
  color: var(--green);
}

.activity-item span {
  display: block;
  color: inherit;
  font-size: 12px;
  text-transform: none;
  overflow-wrap: anywhere;
}

.spin {
  animation: spin 0.95s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.continue-box {
  margin-top: 14px;
}

.empty-state {
  border: 1px dashed #3b3934;
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.empty-state.tall {
  flex: 1;
  margin-top: 14px;
  min-height: 118px;
  display: grid;
  place-items: center;
}

.diagnostics {
  border: 1px solid var(--line);
  background: rgba(18, 19, 18, 0.92);
  padding: 10px 12px;
}

.diagnostics summary {
  font-weight: 900;
  text-transform: uppercase;
}

.diagnostics pre {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--soft);
  font-size: 12px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 145;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.66);
}

.remote-access-dialog {
  width: min(1080px, 100%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.info-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.remote-dialog-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.remote-dialog-title > svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.remote-dialog-title > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.remote-dialog-title strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.remote-dialog-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.remote-access-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 14px;
  min-height: 0;
}

.remote-status-panel,
.remote-config-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.remote-state-row,
.remote-actions,
.remote-footer,
.copy-row,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remote-footer {
  grid-column: 1 / -1;
  justify-content: end;
  position: sticky;
  bottom: -16px;
  padding-top: 12px;
  background: #151613;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.state-pill.running {
  border-color: rgba(102, 187, 106, 0.55);
  color: var(--green);
}

.state-pill.error {
  border-color: rgba(239, 83, 80, 0.6);
  color: #ff8b82;
}

.copy-row code,
.mobile-wrap-code {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.remote-guidance,
.remote-warning,
.remote-error {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.remote-warning,
.remote-error {
  color: #f4c67a;
}

.remote-config-panel label,
.remote-tool-panel {
  display: grid;
  gap: 6px;
}

.remote-config-panel textarea {
  resize: vertical;
}

.remote-option-group {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(215, 208, 197, 0.14);
  background: rgba(17, 19, 18, 0.58);
  padding: 10px;
}

.remote-option-head {
  display: grid;
  gap: 3px;
  padding-bottom: 2px;
}

.remote-option-head span,
.remote-option-copy strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.remote-option-head small,
.remote-option-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.remote-config-panel .remote-option-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 1px solid rgba(215, 208, 197, 0.1);
  background: rgba(255, 255, 255, 0.025);
  padding: 9px;
  cursor: pointer;
}

.remote-config-panel .remote-option-row:hover {
  border-color: rgba(215, 255, 99, 0.22);
  background: rgba(215, 255, 99, 0.045);
}

.remote-option-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
}

.remote-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.segmented button {
  min-width: 0;
}

.segmented button.selected {
  border-color: rgba(215, 255, 99, 0.42);
  color: var(--text);
}

.remote-checklist {
  margin: 0;
  padding-left: 20px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.remote-log pre {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .workbench-shell {
    grid-template-columns: 250px minmax(560px, 1fr) 310px;
  }

  .run-grid,
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .remote-access-body {
    grid-template-columns: 1fr;
  }

  .remote-footer {
    grid-column: auto;
  }

  .command-manager-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .command-manager-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid rgba(215, 208, 197, 0.12);
    padding-right: 0;
    padding-bottom: 12px;
  }

  .command-manager-tabs button {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .command-manager-toolbar,
  .command-manager-item,
  .command-manager-card > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .command-manager-tools {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .command-manager-tools .icon-button {
    width: 100%;
    min-height: 36px;
  }
}
