.panel-rail {
  display: none;
  grid-template-columns: 0.95fr 1.35fr 0.95fr;
  gap: 8px;
  padding: 0 14px 10px;
  align-items: start;
  min-height: 0;
}

.advanced-only {
  display: none !important;
}

.top-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
  min-width: 0;
}

.top-panel[open] {
  grid-column: 1 / -1;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  max-height: min(42vh, 420px);
}

.top-panel > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.top-panel > summary::-webkit-details-marker {
  display: none;
}

.panel-summary-label {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-summary-value {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-panel-body {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.top-panel[open] .top-panel-body {
  overflow-y: auto;
}

.workspace-switcher {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
}

.top-panel > summary .workspace-switcher {
  width: 100%;
  margin-bottom: 2px;
  padding: 3px;
}

.top-panel > summary .workspace-switcher-btn {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.workspace-switcher[hidden] {
  display: none !important;
}

.workspace-switcher-btn {
  flex: 1 1 120px;
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-switcher-menu {
  display: none;
}

.workspace-switcher.open .workspace-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  width: max(100%, 180px);
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: 0 14px 34px rgba(23, 23, 20, 0.12);
}

.thread-search-field input {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.workspace-switcher-btn.active {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(23, 23, 20, 0.08);
}

.workspace-switcher-btn:focus-visible {
  outline: 3px solid rgba(23, 23, 20, 0.12);
  outline-offset: 2px;
}

.mobile-screen-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 251, 0.94);
}

.mobile-threads-view .mobile-screen-bar > .workspace-switcher {
  grid-column: 1 / -1;
  grid-row: 2;
}

.mobile-screen-back,
.mobile-screen-action {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-screen-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-screen-label {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mobile-screen-title {
  margin-top: 4px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-screen-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.quick-field,
.toggle-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.settings-rename-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.settings-thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-thread-actions button {
  min-height: 48px;
}

.history-turns-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.history-turns-field > label {
  margin: 0;
}

.history-turns-field.quick-field {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-save-btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 12px;
}

.compact-save-status {
  grid-column: 1 / -1;
  min-height: 26px;
  justify-self: start;
  padding: 0 8px;
  letter-spacing: normal;
  text-transform: none;
}

.settings-hidden {
  display: none !important;
}

.quick-field span {
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.quick-field select {
  min-height: 48px;
}

.thread-project-field {
  padding: 8px 10px;
}

.thread-project-field select {
  min-height: 40px;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
}

.toggle-card {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toggle-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle-copy strong {
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
}

.toggle-copy small {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.toggle-switch {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 32px;
}

.toggle-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-muted-strong);
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(23, 23, 20, 0.14);
  transition: transform 0.18s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px rgba(23, 23, 20, 0.08);
}

.section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.project-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-panel-refresh {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}

.developer-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.developer-core-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

.developer-core-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.developer-core-toggle input {
  width: auto;
  min-height: auto;
}

.developer-core-toggle a {
  color: #0f766e;
  font-weight: 650;
  text-decoration: none;
}

.developer-core-toggle a:hover {
  text-decoration: underline;
}

.developer-instructions-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.developer-instructions-actions > button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.settings-save-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(17, 128, 95, 0.22);
  border-radius: 999px;
  background: rgba(225, 248, 237, 0.9);
  color: #0f6f51;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.settings-save-status[data-status="saving"] {
  border-color: var(--line);
  background: rgba(244, 241, 235, 0.92);
  color: var(--muted);
}

.settings-save-status[data-status="error"] {
  border-color: rgba(161, 61, 61, 0.24);
  background: rgba(252, 234, 231, 0.92);
  color: var(--warn);
}

.settings-save-status[hidden] {
  display: none;
}

.doc-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.doc-link-button:hover {
  background: rgba(255, 255, 255, 0.92);
}

.doc-link-button:focus-visible {
  outline: 2px solid rgba(23, 23, 20, 0.18);
  outline-offset: 2px;
}

.sheet-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.account-usage-panel {
  gap: 12px;
}

.account-usage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-usage-refresh {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.account-usage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-usage-bucket {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  overflow: hidden;
}

.account-usage-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.account-usage-summary::-webkit-details-marker {
  display: none;
}

.account-usage-summary::after {
  content: "Details";
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
}

.account-usage-bucket[open] .account-usage-summary::after {
  content: "Hide";
}

.account-usage-bucket-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-usage-bucket-copy strong,
.account-usage-window strong {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}

.account-usage-meta {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-word;
}

.account-usage-summary-windows {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.account-usage-summary-window {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  color: var(--text);
  white-space: nowrap;
}

.account-usage-summary-window-warn {
  border-color: rgba(174, 124, 35, 0.32);
}

.account-usage-summary-window-danger {
  border-color: rgba(178, 57, 49, 0.34);
  background: rgba(252, 234, 231, 0.6);
}

.account-usage-reached {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(252, 234, 231, 0.92);
  color: var(--warn);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.account-usage-bucket-detail {
  padding: 0 10px 10px;
}

.account-usage-window-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.account-usage-window {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-muted);
}

.account-usage-window-warn {
  border-color: rgba(174, 124, 35, 0.32);
}

.account-usage-window-danger {
  border-color: rgba(178, 57, 49, 0.34);
  background: rgba(252, 234, 231, 0.6);
}

.account-usage-window-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.account-usage-remaining {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  white-space: nowrap;
}

details.sheet-section {
  padding: 0;
  overflow: hidden;
}

details.sheet-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}

details.sheet-section > summary::-webkit-details-marker {
  display: none;
}

details.sheet-section > summary::after {
  content: "Expand";
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  flex: 0 0 auto;
}

details.sheet-section[open] > summary::after {
  content: "Collapse";
}

.details-content {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-summary-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-summary-meta {
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.experiment-log-preview {
  max-height: 140px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row,
.button-row,
.session-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.session-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface-muted);
}

.session-item strong {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.session-item span {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}

.working-artifact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.working-artifact-actions .secondary,
.working-artifact-download {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.1;
}

.working-artifact-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.working-artifact-download:hover {
  background: rgba(255, 255, 255, 0.92);
}

.working-artifact-download:focus-visible {
  outline: 2px solid rgba(23, 23, 20, 0.18);
  outline-offset: 2px;
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  min-width: 0;
}

.thread-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  padding: 12px 14px;
  text-align: left;
}

.thread-card.active {
  border-color: rgba(17, 128, 95, 0.24);
  background: rgba(244, 250, 247, 0.96);
  box-shadow: inset 0 0 0 1px rgba(17, 128, 95, 0.05);
}

.thread-card.unchecked-completion {
  position: relative;
  border-color: rgba(17, 128, 95, 0.18);
  background: rgba(250, 253, 251, 0.96);
}

.thread-card.unchecked-completion::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #11805f;
}

.thread-card.thread-alert-check {
  border-color: rgba(180, 108, 20, 0.24);
  background: rgba(255, 251, 245, 0.96);
}

.thread-card.thread-alert-check::before {
  background: #b46c14;
}

.thread-card:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.thread-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.thread-card.unchecked-completion .thread-title {
  font-weight: 760;
}

.thread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.thread-badge-done {
  color: #0f6f52;
  border-color: rgba(17, 128, 95, 0.22);
  background: rgba(17, 128, 95, 0.08);
}

.thread-badge-check {
  color: #8a500f;
  border-color: rgba(180, 108, 20, 0.28);
  background: rgba(180, 108, 20, 0.1);
}

.thread-meta,
.thread-preview,
.tiny {
  font-size: 12px;
  line-height: 1.5;
}

.thread-meta {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
}

.thread-preview {
  margin-top: 8px;
  color: var(--text);
}

@media (min-width: 900px) {
  .app-shell {
    width: 100%;
    max-width: none;
    height: 100vh;
    padding: 0;
  }

  .chat-frame {
    height: 100vh;
    grid-template-columns: clamp(340px, 26vw, 430px) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    border: 0;
    border-radius: 0;
    background: var(--surface-strong);
    box-shadow: none;
  }

  .chat-frame[data-mobile-view] .mobile-threads-view {
    display: flex;
    grid-column: 1;
    grid-row: 1 / -1;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: var(--surface-muted);
  }

  .chat-frame[data-mobile-view] .mobile-threads-view .mobile-screen-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    position: relative;
    flex: 0 0 auto;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-muted);
  }

  .chat-frame[data-mobile-view] .mobile-threads-view .mobile-screen-back {
    display: none;
  }

  .chat-frame[data-mobile-view] .mobile-threads-view .mobile-screen-copy {
    grid-column: 2;
    grid-row: 1;
  }

  .chat-frame[data-mobile-view] .mobile-threads-view .mobile-screen-action {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  .chat-frame[data-mobile-view] .mobile-threads-view .mobile-screen-bar > .workspace-switcher {
    z-index: 8;
    width: 126px;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .chat-frame[data-mobile-view] .mobile-threads-view .mobile-screen-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px;
    overflow: hidden;
  }

  #mobileWorkspaceSwitcher {
    display: block;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    border: 0;
    overflow: visible;
  }

  #mobileWorkspaceSwitcher .workspace-switcher-trigger {
    display: flex;
    flex: 0 0 auto;
    flex-basis: auto;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    text-align: left;
  }

  #mobileWorkspaceSwitcher .workspace-switcher-trigger::after {
    content: "v";
    margin-left: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  #mobileWorkspaceSwitcher.open .workspace-switcher-trigger::after {
    content: "^";
  }

  #mobileWorkspaceSwitcher .workspace-switcher-menu .workspace-switcher-btn {
    flex: 0 0 auto;
    width: 100%;
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    text-align: left;
  }

  #mobileThreadProjectFilter {
    min-height: 40px;
  }

  #mobileThreadList {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 -12px -12px;
    padding-bottom: 12px;
    gap: 0;
    overflow-y: auto;
  }

  #mobileThreadList .thread-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 112px;
    align-content: center;
    row-gap: 7px;
    padding: 16px 20px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  #mobileThreadList .thread-card:hover:not(:disabled) {
    background: var(--surface);
    transform: none;
  }

  #mobileThreadList .thread-card.active {
    border-color: var(--line);
    background: var(--surface-strong);
    box-shadow: inset 3px 0 0 var(--success);
  }

  #mobileThreadList .thread-title-row,
  #mobileThreadList .thread-meta,
  #mobileThreadList .thread-preview {
    grid-column: 1;
    min-width: 0;
  }

  #mobileThreadList .thread-title,
  #mobileThreadList .thread-meta,
  #mobileThreadList .thread-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #mobileThreadList .thread-title {
    font-size: 16px;
    line-height: 1.25;
  }

  #mobileThreadList .thread-badge {
    min-width: 0;
    max-width: 82px;
    padding: 3px 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #mobileThreadList .thread-meta,
  #mobileThreadList .thread-preview {
    margin-top: 0;
  }

  #mobileThreadList .thread-meta {
    line-height: 1.35;
  }

  #mobileThreadList .thread-preview {
    line-height: 1.4;
  }

  #mobileStorageHint {
    display: none;
  }

  .app-header {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 72px;
    padding: 16px 24px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-strong);
  }

  .header-strip {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    padding: 0 24px;
    background: var(--surface-strong);
  }

  .header-strip .status-pill {
    display: none;
  }

  .header-strip .banner:not(.hidden) {
    margin: 10px 0 0;
  }

  .mobile-nav {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 24px 8px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-strong);
  }

  .mobile-nav-btn,
  .mobile-nav-link {
    flex: 0 0 auto;
    min-width: 112px;
    min-height: 36px;
    padding: 8px 14px;
    font-size: 12px;
  }

  #newThreadBtn,
  #openThreadsViewBtn {
    display: none;
  }

  .chat-frame .messages {
    grid-column: 2;
    grid-row: 4;
    min-width: 0;
    padding: 18px 24px;
    background: var(--surface);
  }

  .chat-frame .composer-wrap {
    grid-column: 2;
    grid-row: 5;
    min-width: 0;
    padding: 0 24px 18px;
    background: var(--surface);
  }

  .chat-frame[data-mobile-view="threads"],
  .chat-frame[data-mobile-view="experiments"],
  .chat-frame[data-mobile-view="settings"] {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }

  .chat-frame[data-mobile-view="threads"] .mobile-threads-view,
  .chat-frame[data-mobile-view="experiments"] .mobile-threads-view,
  .chat-frame[data-mobile-view="settings"] .mobile-threads-view {
    display: flex;
  }

  .chat-frame[data-mobile-view="threads"] .mobile-nav,
  .chat-frame[data-mobile-view="experiments"] .mobile-nav,
  .chat-frame[data-mobile-view="settings"] .mobile-nav {
    display: flex;
  }

  .chat-frame[data-mobile-view="threads"] .panel-rail,
  .chat-frame[data-mobile-view="experiments"] .panel-rail,
  .chat-frame[data-mobile-view="settings"] .panel-rail {
    display: none;
  }

  .chat-frame[data-mobile-view="threads"] .mobile-threads-view {
    grid-column: 1;
    grid-row: 1 / -1;
  }

  .chat-frame[data-mobile-view="threads"] .messages {
    display: flex;
    grid-row: 4;
  }

  .chat-frame[data-mobile-view="threads"] .composer-wrap {
    display: block;
    grid-row: 5;
  }

  .chat-frame[data-mobile-view="experiments"] .messages,
  .chat-frame[data-mobile-view="experiments"] .composer-wrap,
  .chat-frame[data-mobile-view="settings"] .messages,
  .chat-frame[data-mobile-view="settings"] .composer-wrap {
    display: none;
  }

  .chat-frame[data-mobile-view="experiments"] .mobile-experiments-view,
  .chat-frame[data-mobile-view="settings"] .mobile-settings-view {
    display: flex;
    grid-column: 2;
    grid-row: 4 / -1;
    min-width: 0;
    min-height: 0;
  }
}

.logs {
  min-height: 180px;
  max-height: 280px;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
}
