:root {
  color-scheme: light dark;
  --bg: #f3f1eb;
  --surface: #fbfaf6;
  --surface-strong: #ffffff;
  --sidebar: #17201d;
  --sidebar-soft: #22302b;
  --sidebar-text: #eef4f0;
  --sidebar-muted: #9eaca5;
  --text: #1c2421;
  --muted: #68736e;
  --line: #d9d8d0;
  --line-soft: #e8e6df;
  --accent: #e26b3d;
  --accent-strong: #c85127;
  --accent-soft: #f8e5db;
  --green: #2d8a63;
  --green-soft: #dff2e8;
  --red: #b9433e;
  --red-soft: #f8e2df;
  --amber: #9b6818;
  --amber-soft: #f5ead0;
  --blue: #376f9b;
  --blue-soft: #e1ecf5;
  --shadow: 0 18px 50px rgb(25 35 31 / 12%);
  --radius: 8px;
  --sidebar-width: 296px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101613;
    --surface: #151d19;
    --surface-strong: #1a241f;
    --text: #edf2ef;
    --muted: #9aa69f;
    --line: #2d3933;
    --line-soft: #25302b;
    --accent: #f18154;
    --accent-strong: #ff9a72;
    --accent-soft: #3b261e;
    --green: #68c99c;
    --green-soft: #1f3a2e;
    --red: #f28a84;
    --red-soft: #3c2423;
    --amber: #e7b85c;
    --amber-soft: #3b311b;
    --blue: #86bce6;
    --blue-soft: #203441;
    --shadow: 0 18px 50px rgb(0 0 0 / 35%);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

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

button,
select {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding-top: calc(14px + var(--safe-top));
  color: var(--sidebar-text);
  background: var(--sidebar);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 18px 16px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 8px;
  color: #fff4ed;
  background: #283a33;
  font-size: 15px;
  font-weight: 750;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  overflow: hidden;
  color: var(--sidebar-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #7c8882;
}

.connection-dot.ready {
  background: #64c994;
}

.connection-dot.connecting,
.connection-dot.restarting {
  background: #e4b04f;
  animation: pulse 1.2s ease-in-out infinite;
}

.connection-dot.error {
  background: #e36a61;
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  color: inherit;
  background: transparent;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--line);
  background: rgb(127 127 127 / 9%);
  outline: none;
}

.icon-button.small {
  width: 28px;
  height: 28px;
}

.icon-button.small svg {
  width: 16px;
  height: 16px;
}

.sidebar .icon-button:hover,
.sidebar .icon-button:focus-visible {
  border-color: rgb(255 255 255 / 14%);
  background: rgb(255 255 255 / 7%);
}

.new-thread-button {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 14px 16px;
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: var(--radius);
  color: var(--sidebar-text);
  background: rgb(255 255 255 / 7%);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.new-thread-button:hover,
.new-thread-button:focus-visible {
  border-color: rgb(241 129 84 / 65%);
  background: rgb(255 255 255 / 10%);
  outline: none;
}

.new-thread-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.new-thread-button svg {
  width: 17px;
  height: 17px;
}

.project-panel,
.model-panel {
  margin: 0 14px 18px;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 4%);
}

.project-panel {
  margin-bottom: 10px;
}

.section-heading,
.thread-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-panel select,
.model-panel select {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding: 7px 28px 7px 8px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 6px;
  color: var(--sidebar-text);
  background-color: var(--sidebar-soft);
  font-size: 13px;
}

.project-roots {
  display: grid;
  max-height: 52px;
  gap: 2px;
  margin-top: 7px;
  overflow-y: auto;
  color: var(--sidebar-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 9px;
  scrollbar-width: thin;
}

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

.project-root.empty {
  font-family: inherit;
  font-size: 10px;
}

.thread-section-heading {
  padding: 0 16px 8px 20px;
}

.thread-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 14px;
  scrollbar-width: thin;
}

.thread-item {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 0;
  border-radius: 7px;
  color: var(--sidebar-text);
  background: transparent;
  text-align: left;
}

.thread-item:hover,
.thread-item:focus-visible {
  background: rgb(255 255 255 / 6%);
  outline: none;
}

.thread-item.active {
  background: #2b3c35;
}

.thread-item.readonly .thread-item-icon {
  color: #e7b85c;
}

.thread-item-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  border-radius: 6px;
  color: var(--sidebar-muted);
  background: rgb(255 255 255 / 7%);
}

.thread-item-icon svg {
  width: 14px;
  height: 14px;
}

.thread-item-copy {
  min-width: 0;
  flex: 1;
}

.thread-item-title,
.thread-item-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-item-title {
  font-size: 13px;
  font-weight: 560;
}

.thread-item-preview {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.thread-empty {
  padding: 20px 12px;
  color: var(--sidebar-muted);
  font-size: 12px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 12px 18px calc(14px + var(--safe-bottom));
  border-top: 1px solid rgb(255 255 255 / 9%);
  color: var(--sidebar-muted);
  font-size: 10px;
}

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

.workspace {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  background: var(--bg);
}

.workspace-header {
  grid-row: 1;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: calc(62px + var(--safe-top));
  padding: var(--safe-top) clamp(14px, 3vw, 28px) 8px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
}

.thread-heading {
  min-width: 0;
  flex: 1;
}

.thread-heading h1 {
  overflow: hidden;
  margin: 0;
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.thread-meta > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-path {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-divider {
  width: 3px;
  height: 3px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.run-state {
  color: var(--green);
}

.run-state.running {
  color: var(--accent);
}

.run-state.error {
  color: var(--red);
}

.usage-chip {
  max-width: 170px;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-warning {
  grid-row: 2;
  margin: 12px clamp(14px, 3vw, 28px) 0;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--line));
  border-radius: var(--radius);
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 12px;
}

.transcript {
  grid-row: 3;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px clamp(14px, 4vw, 46px) 24px;
  scroll-behavior: smooth;
}

.transcript.dragging {
  scroll-behavior: auto;
}

.timeline {
  width: min(100%, 880px);
  min-width: 0;
  margin: 0 auto;
}

.empty-state {
  display: flex;
  width: min(100%, 520px);
  min-height: 100%;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  background: var(--surface);
}

.empty-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state h2 {
  margin: 16px 0 5px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
}

.message {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
}

.message-avatar svg {
  width: 15px;
  height: 15px;
}

.message.user .message-avatar {
  color: var(--accent);
  background: var(--accent-soft);
}

.message-body {
  min-width: 0;
  max-width: min(82%, 720px);
}

.message.user .message-body {
  display: flex;
  justify-content: flex-end;
}

.message-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .message-text {
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 10px 10px 3px 10px;
  background: var(--accent-soft);
}

.message.agent .message-text {
  font-size: 14px;
}

.message-text a {
  color: var(--accent-strong);
  text-underline-offset: 2px;
}

.stream-cursor::after {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  translate: 0 2px;
  background: var(--accent);
  content: "";
  animation: pulse 0.9s ease-in-out infinite;
}

.progress-item {
  min-width: 0;
  margin: 0 0 12px 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.progress-item summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.progress-item summary::-webkit-details-marker {
  display: none;
}

.progress-item summary:focus-visible {
  border-radius: var(--radius);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.progress-item summary .summary-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  border-radius: 5px;
  color: var(--blue);
  background: var(--blue-soft);
}

.progress-item.command summary .summary-icon {
  color: var(--green);
  background: var(--green-soft);
}

.progress-item.file summary .summary-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.progress-item.error summary .summary-icon {
  color: var(--red);
  background: var(--red-soft);
}

.summary-icon svg {
  width: 13px;
  height: 13px;
}

.summary-label {
  flex: none;
  color: var(--text);
  font-weight: 600;
}

.summary-detail {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-state {
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--line-soft);
  font-size: 10px;
}

.progress-state.running {
  color: var(--accent);
  background: var(--accent-soft);
}

.progress-content {
  min-width: 0;
  padding: 0 10px 10px;
}

.code-block {
  max-width: 100%;
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 78%, var(--surface));
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: normal;
  tab-size: 2;
  white-space: pre;
}

.reasoning-grid {
  display: grid;
  gap: 10px;
}

.reasoning-block h4 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reasoning-block .code-block {
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  white-space: pre-wrap;
}

.command-line {
  overflow-wrap: anywhere;
  margin: 0 0 8px;
  padding: 0;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  white-space: pre-wrap;
}

.subtle-meta {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}

.approval-dock {
  grid-row: 4;
  width: min(calc(100% - clamp(28px, 8vw, 92px)), 880px);
  max-height: min(42dvh, 420px);
  overflow-y: auto;
  margin: 0 auto 8px;
}

.approval-card {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.approval-card + .approval-card {
  margin-top: 8px;
}

.approval-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.approval-heading svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--accent);
}

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

.approval-kicker {
  flex: none;
  color: var(--muted);
  font-size: 10px;
}

.approval-detail {
  max-height: 120px;
  overflow: auto;
  margin: 7px 0 10px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--text);
  background: var(--bg);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.approval-actions button,
.question-submit {
  min-height: 34px;
  flex: 1 1 120px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
}

.approval-actions button:hover,
.approval-actions button:focus-visible,
.question-submit:hover,
.question-submit:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.approval-actions .allow,
.question-submit {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent-strong);
}

.approval-actions .danger {
  color: var(--red);
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-block {
  min-width: 0;
}

.question-header {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.question-text {
  margin: 2px 0 7px;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 600;
}

.question-options {
  display: grid;
  gap: 5px;
}

.question-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
}

.question-option input {
  width: 15px;
  height: 15px;
  flex: none;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.question-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.question-option small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.question-input {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
}

.question-submit {
  width: 100%;
  margin-top: 9px;
}

.composer {
  grid-row: 5;
  position: relative;
  padding: 8px clamp(14px, 4vw, 46px) calc(10px + var(--safe-bottom));
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}

.composer-box {
  display: flex;
  width: min(100%, 880px);
  min-width: 0;
  align-items: flex-end;
  gap: 8px;
  margin: 0 auto;
  padding: 7px 7px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: 0 7px 25px rgb(25 35 31 / 7%);
}

.composer-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
}

.composer textarea {
  width: 100%;
  min-width: 0;
  max-height: 132px;
  overflow-y: auto;
  padding: 6px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.45;
}

.composer textarea::placeholder {
  color: var(--muted);
}

.send-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent-strong);
}

.send-button:hover,
.send-button:focus-visible {
  background: var(--accent);
  outline: 2px solid var(--accent-soft);
}

.send-button:disabled {
  color: var(--muted);
  background: var(--line);
  cursor: not-allowed;
}

.send-button .stop-icon {
  display: none;
}

.send-button.is-running {
  background: var(--red);
}

.send-button.is-running .send-icon {
  display: none;
}

.send-button.is-running .stop-icon {
  display: block;
}

.composer-hint {
  display: flex;
  width: min(100%, 880px);
  justify-content: space-between;
  gap: 10px;
  margin: 4px auto 0;
  color: var(--muted);
  font-size: 9px;
}

.readonly-banner {
  width: min(100%, 880px);
  margin: 0 auto 7px;
  color: var(--amber);
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: calc(12px + var(--safe-top));
  left: 50%;
  display: grid;
  width: min(calc(100vw - 28px), 420px);
  gap: 7px;
  translate: -50% 0;
  pointer-events: none;
}

.toast {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  font-size: 12px;
  text-align: center;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  color: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

.auth-gate {
  display: grid;
  height: 100dvh;
  place-items: center;
  padding: 24px;
  background: var(--sidebar);
}

.auth-panel {
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 10px;
  color: var(--sidebar-text);
  background: var(--sidebar-soft);
  box-shadow: var(--shadow);
}

.auth-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 8px;
  color: #ffad8c;
  background: #2e4039;
}

.auth-panel h1 {
  margin: 15px 0 3px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0;
}

.auth-panel p {
  margin: 0 0 18px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--sidebar-muted);
  font-size: 10px;
}

.auth-panel input {
  width: 100%;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 7px;
  outline: 0;
  color: var(--sidebar-text);
  background: #17201d;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
}

.auth-panel input:focus {
  border-color: var(--accent);
}

.primary-button {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}

.primary-button:disabled {
  opacity: 0.6;
}

.mobile-only {
  display: none;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    translate: -102% 0;
    transition: translate 180ms ease;
    box-shadow: var(--shadow);
  }

  .app-shell.sidebar-open .sidebar {
    translate: 0 0;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 19;
    inset: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgb(10 16 13 / 52%);
    transition: opacity 180ms ease, visibility 180ms;
  }

  .app-shell.sidebar-open .sidebar-scrim {
    visibility: visible;
    opacity: 1;
  }

  .mobile-only {
    display: inline-grid;
  }

  .workspace {
    height: 100dvh;
  }

  .workspace-header {
    min-height: calc(56px + var(--safe-top));
    padding-right: 12px;
    padding-left: 8px;
  }

  .thread-heading h1 {
    font-size: 16px;
  }

  .usage-chip {
    display: none;
  }

  .transcript {
    padding: 14px 12px 18px;
  }

  .message {
    gap: 8px;
    margin-bottom: 17px;
  }

  .message-avatar {
    width: 25px;
    height: 25px;
  }

  .message-body {
    max-width: calc(100% - 33px);
  }

  .progress-item {
    margin-left: 33px;
  }

  .approval-dock {
    width: calc(100% - 24px);
    max-height: 38dvh;
  }

  .composer {
    padding-right: 10px;
    padding-left: 10px;
  }

  .composer-hint {
    font-size: 9px;
  }
}

@media (max-width: 380px) {
  .thread-meta {
    font-size: 10px;
  }

  .approval-actions button {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
