:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #17202a;
  --muted: #667085;
  --line: #d6deea;
  --line-strong: #aeb9ca;
  --accent: #2764d9;
  --accent-weak: #e7efff;
  --green: #16795b;
  --amber: #9a5b00;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (max-width: 700px) {
  tbody td[data-label="模型"],
  tbody td[data-label="最后活动"],
  tbody td[data-label="轮次"],
  tbody td[data-label="已使用 Token"] {
    display: flex !important;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.25;
  }

  tbody td[data-label="模型"]::before,
  tbody td[data-label="最后活动"]::before,
  tbody td[data-label="轮次"]::before,
  tbody td[data-label="已使用 Token"]::before {
    display: inline-block;
    flex: 0 0 48px;
    width: 48px;
    font-size: 10px;
    line-height: 1.2;
  }

  .modelText {
    min-height: 22px;
    padding: 0 7px;
    font-size: 11px;
  }

  .cellMain,
  .tokenTotal {
    display: inline;
    font-size: 13px;
    line-height: 1.2;
  }

  tbody td[data-label="轮次"] .lastText,
  tbody td[data-label="已使用 Token"] .lastText {
    display: inline;
    margin: 0 0 0 4px;
    font-size: 11px;
    line-height: 1.2;
  }
}

.jobsPanel,
.jobsPanel.collapsed {
  padding: 8px 10px;
}

.jobsHeader,
.jobsPanel.collapsed .jobsHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 8px;
}

.jobsPanel.collapsed .jobsHeader {
  margin-bottom: 0;
}

.jobsTitleLine,
.jobsPanel.collapsed .jobsTitleLine {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 30px;
}

.jobsTitleLine h2,
.jobsPanel.collapsed .jobsTitleLine h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.jobsTitleLine .agentStatus,
.jobsPanel.collapsed .agentStatus {
  width: auto;
  min-height: 22px;
  margin: 0;
  padding: 2px 7px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.jobsToggleButton {
  width: 44px;
  height: 24px;
  padding: 0 8px;
  line-height: 22px;
}

.jobsActions {
  align-items: start;
  justify-content: end;
  min-height: 30px;
}

.jobsActions .secondaryButton {
  height: 24px;
  min-height: 24px;
  padding: 0 8px;
  line-height: 22px;
}

.jobList {
  margin-top: 0;
}

@media (max-width: 700px) {
  .jobsPanel,
  .jobsPanel.collapsed {
    padding: 8px 10px;
  }

  .jobsHeader,
  .jobsPanel.collapsed .jobsHeader {
    grid-template-columns: minmax(0, 1fr);
    min-height: 30px;
    margin-bottom: 8px;
  }

  .jobsPanel.collapsed .jobsHeader {
    margin-bottom: 0;
  }

  .jobsTitleLine,
  .jobsPanel.collapsed .jobsTitleLine {
    grid-template-columns: auto auto auto;
    min-height: 30px;
    gap: 8px;
  }

  .jobsTitleLine h2,
  .jobsPanel.collapsed .jobsTitleLine h2 {
    font-size: 15px;
  }

  .jobsActions {
    justify-content: flex-end;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef2f7;
  color: var(--text);
}

.shell {
  width: min(1500px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  margin-bottom: 16px;
}

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

.machinePicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}

.machinePicker span {
  white-space: nowrap;
}

.machinePicker select {
  height: 30px;
  min-width: 86px;
  padding: 0 20px 0 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 720;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: 0;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.iconButton {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--accent);
  font-size: 19px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.iconButton:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.controls {
  display: grid;
  gap: 10px;
  padding: 10px;
  margin-bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.filterToggleButton {
  display: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.filterToggleButton:hover {
  border-color: var(--line);
  background: #fff;
}

.filterToggleTitle {
  font-size: 13px;
  font-weight: 760;
}

.filterSummary {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filterToggleIcon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: #fff;
  font-size: 15px;
  transition: transform 160ms ease;
}

.filterToggleButton.open .filterToggleIcon {
  transform: rotate(180deg);
}

.filterBody {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.4fr)
    minmax(170px, 260px)
    minmax(120px, 150px)
    minmax(130px, 160px)
    minmax(130px, 150px)
    minmax(130px, 150px)
    auto
    auto;
  gap: 12px;
  align-items: end;
  padding-top: 2px;
}

.filterBody[hidden] {
  display: none;
}

.customDateField[hidden] {
  display: none;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

input,
select {
  height: 38px;
  padding: 0 11px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

textarea {
  min-height: 128px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

.toggle {
  grid-template-columns: 18px auto;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  white-space: nowrap;
}

.toggle input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.secondaryButton {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.secondaryButton:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.secondaryButton:disabled {
  cursor: default;
  opacity: 0.58;
  background: #f6f8fc;
}

.guiCopyTopButton {
  padding: 0 9px;
  font-size: 12px;
}

.primaryButton,
.sendButton {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}

.primaryButton:hover,
.sendButton:hover {
  background: #1d54bd;
}

.primaryButton:disabled,
.sendButton:disabled {
  cursor: default;
  opacity: 0.62;
}

body:not(.remoteMode) .remoteOnly {
  display: none;
}

body.authLocked {
  min-height: 100vh;
  background: var(--bg);
}

.loginShell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.loginShell[hidden],
.shell[hidden] {
  display: none;
}

.loginCard.authPanel {
  display: grid;
  width: min(440px, 100%);
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  padding: 24px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.loginHeader h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.loginHeader p {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.loginCard label {
  display: grid;
  gap: 6px;
}

.loginCard input {
  width: 100%;
}

.legacyLogin {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.legacyLogin summary {
  min-height: 36px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  list-style-position: inside;
}

.legacyLogin label {
  padding: 0 10px 10px;
}

.loginButton {
  width: 100%;
  min-height: 40px;
}

.loginMessage {
  min-height: 18px;
  margin: 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

.authPanel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.authPanel[hidden] {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.statToken {
  grid-column: span 2;
}

.statInfo {
  grid-column: span 2;
}

.jobsPanel {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.jobsPanel.collapsed {
  padding: 12px 14px;
}

.jobsPanel.collapsed .jobsHeader {
  margin-bottom: 0;
}

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

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

.agentStatus {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid #efc0bc;
  border-radius: 8px;
  color: #b42318;
  background: #fff0ee;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.agentStatus.online {
  border-color: #b9dfd2;
  color: var(--green);
  background: #edf8f4;
}

.jobsToggleButton {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.jobsToggleButton:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.jobsActions,
.aiActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.jobsActions[hidden],
.jobList[hidden] {
  display: none;
}

h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0;
}

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

.emptyJob {
  color: var(--muted);
  font-size: 13px;
}

.jobItem {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  min-width: 0;
}

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

.jobTopline strong {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.jobStatus {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.jobStatus.completed {
  border-color: #b9dfd2;
  color: var(--green);
  background: #edf8f4;
}

.jobStatus.failed {
  border-color: #efc0bc;
  color: #b42318;
  background: #fff0ee;
}

.jobStatus.running,
.jobStatus.queued {
  border-color: #bdd0f4;
  color: var(--accent);
  background: var(--accent-weak);
}

.jobItem p {
  margin: 7px 0 0;
  color: #27364a;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.jobItem pre {
  max-height: 48px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #3f4a5f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.jobActionsRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.jobOpenButton {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.jobOpenButton:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.jobDeleteButton {
  min-width: 72px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #efc0bc;
  border-radius: 8px;
  background: #fff7f6;
  color: #b42318;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.jobDeleteButton:hover {
  border-color: #d92d20;
  background: #fff0ee;
}

.jobItem small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.aiPanel {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.aiPanel[hidden],
.aiOutput[hidden] {
  display: none;
}

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

.aiOutput {
  max-height: 320px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.aiOutput pre {
  margin: 0;
  color: #27364a;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tmuxPanel {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tmuxPanel.emptyState {
  padding: 12px 14px;
}

.tmuxPanel.emptyState .tmuxPanelHeader {
  align-items: center;
  margin-bottom: 0;
}

.tmuxPanel.emptyState .tmuxSessionList {
  display: none;
}

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

.tmuxPanelHeader p {
  margin-top: 5px;
}

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

.tmuxSessionList {
  display: block;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tmuxTable {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 1340px;
}

.tmuxTableHeader,
.tmuxRow {
  display: grid;
  grid-template-columns:
    minmax(178px, 1.15fr)
    minmax(116px, 0.72fr)
    minmax(270px, 1.7fr)
    minmax(150px, 0.95fr)
    minmax(104px, 0.54fr)
    minmax(72px, 0.42fr)
    minmax(104px, 0.56fr)
    minmax(96px, 0.55fr)
    minmax(260px, 0.9fr);
  align-items: center;
}

.tmuxTableHeader {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.tmuxRow {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.tmuxCell {
  min-width: 0;
  height: 100%;
  padding: 10px 12px;
  border-left: 1px solid rgba(211, 220, 233, 0.55);
}

.tmuxCell:first-child {
  border-left: 0;
}

.tmuxTerminalCell {
  display: grid;
  align-content: center;
  gap: 4px;
}

.tmuxTerminalCell strong {
  display: block;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmuxPath {
  display: block;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmuxStatus,
.tmuxClient {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.tmuxStatus.idle {
  border-color: #b9dfd2;
  color: var(--green);
  background: #edf8f4;
}

.tmuxStatus.running,
.tmuxStatus.waiting_confirm {
  border-color: #bdd0f4;
  color: var(--accent);
  background: var(--accent-weak);
}

.tmuxStatus.closed {
  border-color: #efc0bc;
  color: #b42318;
  background: #fff0ee;
}

.tmuxClient.connected {
  border-color: #d9c3f4;
  color: #6d3ab2;
  background: #f6efff;
}

.tmuxCreatorIp {
  border-color: #c9d7eb;
  color: #40516b;
  background: #f8fbff;
}

.tmuxStateCell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 5px;
}

.tmuxPreviewCell {
  min-height: 0;
  margin: 0;
  color: #27364a;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tmuxPathCell {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmuxModelCell,
.tmuxActivityCell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.tmuxMetricCell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.tmuxMetricMain {
  color: var(--text);
  font-weight: 780;
}

.tmuxMetricSub {
  color: var(--muted);
  font-size: 11px;
}

.tmuxMetricEmpty {
  color: var(--muted);
  font-weight: 720;
}

.tmuxAccessActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.tmuxAccessActions .tmuxOpenButton,
.tmuxAccessButton,
.tmuxAccessActions .copyButton {
  flex: 0 0 auto;
  min-width: 52px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 740;
  cursor: pointer;
  white-space: nowrap;
}

.tmuxAccessActions .copyButton {
  width: auto;
}

.tmuxOpenButton {
  min-width: 58px;
  background: var(--accent);
  color: #fff;
}

.tmuxOpenButton:hover,
.tmuxAccessButton:hover {
  background: #1d56c8;
  color: #fff;
}

.takeoverButton {
  border-color: #efc0bc;
  color: #b42318;
  background: #fff7f6;
}

.takeoverButton:hover {
  border-color: #d92d20;
  background: #d92d20;
  color: #fff;
}

.terminalPanel {
  width: min(1480px, calc(100vw - 24px));
  height: min(900px, calc(100vh - 24px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.terminalHeader {
  align-items: flex-start;
}

.terminalHeader > div {
  min-width: 0;
}

.terminalHeader .modalMeta {
  margin-top: 5px;
  white-space: normal;
}

.terminalTabs {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 38px;
}

.dangerIconButton {
  border-color: #efc0bc;
  color: #b42318;
  background: #fff7f6;
}

.dangerIconButton:hover {
  border-color: #d92d20;
  background: #fff0ee;
}

.terminalScreen {
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid #293142;
  border-radius: 8px;
  background: #111827;
  color: #d1d5db;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.42;
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 2;
  font-variant-ligatures: none;
}

.terminalComposer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 9px;
  align-items: end;
  padding-top: 2px;
}

.terminalComposer textarea {
  min-height: 64px;
  max-height: 150px;
  resize: vertical;
}

.terminalModal[data-mode="view"] .terminalComposer {
  display: none;
}

.terminalTabs .toolIconButton:disabled {
  cursor: default;
  opacity: 0.42;
  background: #f7f9fd;
}

.stats div {
  min-height: 70px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.stats .statToken {
  min-height: 78px;
  background: #fbfcff;
}

.stats span {
  display: block;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 780;
}

.stats small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.tableWrap {
  overflow: visible;
  max-height: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.listToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin: 0 0 8px;
  padding: 0 2px;
}

.pageSizeControl,
.paginationControls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.pageSizeControl {
  flex: 0 0 auto;
}

.pageSizeControl span {
  white-space: nowrap;
}

.paginationControls {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.pageSizeControl select {
  width: 92px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

.pageButton {
  min-width: 58px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.pageButton:disabled {
  cursor: default;
  color: #9aa6b7;
  background: #f5f7fb;
}

#pageIndicator {
  min-width: 52px;
  text-align: center;
  color: #344054;
}

table {
  width: 100%;
  min-width: 1200px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 10px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 190px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 132px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 126px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 108px;
}

th:nth-child(6),
td:nth-child(6) {
  width: 78px;
}

th:nth-child(7),
td:nth-child(7) {
  width: 98px;
}

th:nth-child(8),
td:nth-child(8) {
  width: 86px;
}

th:nth-child(9),
td:nth-child(9) {
  width: 92px;
}

th:nth-child(10),
td:nth-child(10) {
  width: 86px;
}

th:nth-child(11),
td:nth-child(11) {
  width: 78px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
}

th,
td {
  border-bottom: 0;
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  padding-top: 4px;
  padding-bottom: 4px;
  color: #526176;
  font-size: 12px;
  font-weight: 760;
}

th:nth-child(3),
td:nth-child(3),
th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8),
th:nth-child(9),
td:nth-child(9),
th:nth-child(10),
td:nth-child(10),
th:nth-child(11),
td:nth-child(11) {
  text-align: center;
}

td:nth-child(2) {
  vertical-align: top;
}

td.commandColumn,
td.remoteCommandColumn,
td.remoteOnly,
td[data-label="删除"] {
  vertical-align: middle;
}

tbody tr:hover {
  background: transparent;
}

tbody tr {
  cursor: pointer;
}

tbody td {
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

tbody td:first-child {
  padding-left: 16px;
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

tbody td:last-child {
  padding-right: 16px;
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

tbody tr:hover td {
  border-color: #b9c8dc;
  background: #fbfdff;
}

.sessionTitleButton {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.sessionTitleButton:disabled {
  cursor: default;
}

.sessionTitleLine {
  display: block;
}

.sessionTitleBlock {
  min-width: 0;
}

.sessionTaskName {
  display: block;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.28;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobileCardActions {
  display: none;
}

.sessionTitleButton:hover .sessionTitle {
  color: var(--accent);
}

.sessionTitleButton.autoTitle .sessionTitle {
  color: #344054;
}

.sessionConversationTitle {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.sessionTitle {
  display: block;
  color: var(--text);
  font-weight: 690;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sessionTitle.sessionConversationTitle {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

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

.sessionRenameInput {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  outline: none;
}

.sessionRenameInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.renameSaveButton,
.renameCancelButton {
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}

.renameSaveButton {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.renameCancelButton:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.lastText {
  display: block;
  max-width: 430px;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.sessionIdText {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
}

.recentText {
  display: block;
  color: #27364a;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cellMain {
  display: block;
  color: #27364a;
  font-weight: 720;
  line-height: 1.35;
}

.project {
  display: inline-block;
  max-width: 260px;
  color: var(--green);
  overflow-wrap: anywhere;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.modelText {
  display: inline-grid;
  place-items: center;
  align-items: center;
  min-width: 28px;
  min-height: 28px;
  max-width: 100%;
  padding: 0 9px;
  border: 1px solid #c7d7ef;
  border-radius: 8px;
  color: #24558f;
  background: #eef5ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mono {
  max-width: 230px;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.time {
  white-space: nowrap;
  color: #27364a;
}

.tokenTotal {
  display: block;
  color: #27364a;
  font-weight: 760;
  white-space: nowrap;
}

.commandCell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.copyUnavailable {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 32px;
  color: #93a2b5;
  font-size: 13px;
  font-weight: 700;
}

.copyButton {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.deleteSessionButton {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid #efc0bc;
  border-radius: 8px;
  background: #fff7f6;
  color: #b42318;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}

.deleteSessionButton:hover {
  border-color: #d92d20;
  background: #fff0ee;
}

.deleteSessionButton:disabled {
  cursor: default;
  opacity: 0.55;
  color: var(--muted);
  border-color: var(--line);
  background: #f6f8fc;
}

.sendButton {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  height: 32px;
  padding: 0 11px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.34);
}

.modal[hidden] {
  display: none;
}

.modalPanel {
  width: min(840px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.smallModalPanel {
  width: min(460px, 100%);
}

.terminalModal .terminalPanel {
  width: min(1480px, calc(100vw - 24px));
  height: min(900px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  background: #f8fafc;
}

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

.modalActionRow {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modalActionRow button {
  min-width: 82px;
}

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

.flatButton {
  width: 32px;
  height: 32px;
  box-shadow: none;
  font-size: 22px;
}

.modalMeta {
  margin: -6px 0 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messageList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4fb;
}

.messageItem {
  display: grid;
  gap: 5px;
  align-self: flex-start;
  width: fit-content;
  max-width: 82%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.messageItem.user {
  align-self: flex-end;
  border-color: #b6e1c8;
  background: #dcf7e7;
}

.messageItem.assistant {
  border-color: #d8e1ee;
  background: #fff;
}

.messageTopline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.messageStatus {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--accent);
  font-size: 10px;
  font-weight: 760;
}

.messageItem.pendingJob {
  border-color: #c8d7f0;
  background: #f8fbff;
}

.messageText {
  margin: 0;
  color: #27364a;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.messageItem.codeLike {
  max-width: 94%;
}

.messageItem.codeLike .messageText {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.messageItem.collapsibleMessage .messageText {
  cursor: pointer;
}

.messageItem.collapsibleMessage .messageText:focus-visible {
  outline: 2px solid rgba(39, 100, 217, 0.28);
  outline-offset: 2px;
}

.replyComposer {
  position: sticky;
  bottom: -16px;
  z-index: 2;
  display: grid;
  gap: 8px;
  margin: 0 -16px -16px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.composerToolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 34px;
}

.toolIconButton,
.sendIconButton {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 15px;
  font-weight: 780;
  cursor: pointer;
}

.toolIconButton:hover,
.sendIconButton:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.toolIconButton:disabled,
.sendIconButton:disabled {
  cursor: default;
  opacity: 0.56;
  background: #f6f8fc;
}

.sendIconButton {
  align-self: end;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 20px;
}

.sendIconButton:hover {
  background: #1d54bd;
}

.replyInputRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: end;
}

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

.modelSegmented {
  display: none;
}

.copyButton:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.copyButton:disabled {
  cursor: default;
  color: var(--green);
  background: #edf8f4;
}

.empty {
  height: 140px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1500px) {
  table {
    min-width: 1020px;
  }

  .commandColumn,
  .remoteCommandColumn {
    width: 82px;
  }
}

@media (max-width: 1180px) {
  .filterBody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jobList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tmuxTableHeader,
  .tmuxRow {
    grid-template-columns:
      minmax(160px, 1.1fr)
      minmax(112px, 0.72fr)
      minmax(230px, 1.6fr)
      minmax(98px, 0.5fr)
      minmax(70px, 0.4fr)
      minmax(94px, 0.52fr)
      minmax(96px, 0.55fr)
      minmax(244px, 0.86fr);
  }

  .tmuxTableHeader span:nth-child(4),
  .tmuxPathCell {
    display: none;
  }

  .searchBox {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 20px, 1500px);
    padding: 14px 0 18px;
  }

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

  .stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

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

  .tableWrap {
    max-height: none;
  }

  h1 {
    font-size: 24px;
  }
}

@media (max-width: 700px) {
  .stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
  }

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

  .stats div {
    min-height: 56px;
    padding: 9px 10px;
    border-color: #d9e2ef;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .stats .statToken {
    min-height: 60px;
  }

  .stats span {
    font-size: 20px;
  }

  .stats small {
    font-size: 11px;
    line-height: 1.25;
  }

  .filterToggleButton {
    display: grid;
    min-height: 36px;
    gap: 8px;
  }

  .filterSummary {
    display: -webkit-box;
    white-space: normal;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .tableWrap {
    overflow: visible;
  }

  table {
    min-width: 0;
    border-spacing: 0 10px;
  }

  thead {
    display: none;
  }

  tbody,
  tr {
    display: block;
    width: 100%;
  }

  tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    padding: 13px 13px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  }

  tbody td {
    display: none;
    width: auto !important;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  tbody td:first-child,
  tbody td:last-child {
    border: 0;
    border-radius: 0;
  }

  td::before {
    display: none;
  }

  td[data-label="对话名字"],
  td[data-label="最近内容"] {
    display: block;
    grid-column: 1 / -1;
    width: 100% !important;
  }

  td[data-label="对话名字"] {
    order: 1;
  }

  td[data-label="最近内容"] {
    order: 2;
  }

  td[data-label="模型"],
  td[data-label="最后活动"],
  td[data-label="轮次"],
  td[data-label="已使用 Token"] {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    order: 3;
  }

  td[data-label="模型"] {
    grid-column: 1;
  }

  td[data-label="最后活动"] {
    grid-column: 2;
    justify-self: end;
    color: var(--muted);
    font-size: 12px;
  }

  td[data-label="轮次"],
  td[data-label="已使用 Token"] {
    grid-column: auto;
  }

  td[data-label="创建时间"],
  td[data-label="恢复命令"],
  td[data-label="tmux命令"],
  td[data-label="复制"],
  td[data-label="远程复制"] {
    display: none;
  }

  body.remoteMode td[data-label="发指令"] {
    display: block;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    order: 4;
  }

  td[data-label="删除"] {
    display: block;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    order: 5;
  }

  .sessionTitle,
  .sessionIdText,
  .recentText,
  .cellMain,
  .lastText,
  .modelText,
  .mono,
  .commandText {
    max-width: none;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .sessionTitle {
    font-size: 15px;
    line-height: 1.28;
  }

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

  .mobileCardActions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  .mobileCardActions .sendButton {
    min-width: 56px;
    height: 30px;
    padding: 0 11px;
  }

  .mobileCardActions .deleteSessionButton {
    min-width: 46px;
    height: 30px;
    padding: 0 9px;
    border-color: transparent;
    background: transparent;
  }

  .mobileCardActions .deleteSessionButton:hover {
    border-color: #efc0bc;
    background: #fff7f6;
  }

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

  .sessionRenameInput {
    grid-column: 1 / -1;
    height: 34px;
    font-size: 14px;
  }

  .renameSaveButton,
  .renameCancelButton {
    width: 100%;
    height: 32px;
    padding: 0 9px;
  }

  .sessionIdText {
    display: inline-block;
    margin-top: 4px;
    white-space: nowrap;
  }

  td[data-label="发指令"] .sendButton {
    width: auto;
    min-width: 72px;
    height: 32px;
    margin-top: 2px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 740;
    cursor: pointer;
  }

  td[data-label="发指令"] .sendButton:disabled {
    cursor: default;
    opacity: 0.62;
  }

  td[data-label="删除"] .deleteSessionButton {
    width: auto;
    min-width: 64px;
    height: 32px;
    margin-top: 2px;
  }

  body.remoteMode td.desktopAction,
  td.desktopDanger {
    display: none !important;
  }

  td[data-label="模型"],
  td[data-label="最后活动"],
  td[data-label="轮次"],
  td[data-label="已使用 Token"] {
    display: grid;
    grid-column: auto;
    gap: 3px;
    align-items: start;
    justify-self: stretch;
    padding-top: 8px;
    border-top: 1px solid #edf1f7;
    color: #27364a;
    font-size: 12px;
  }

  td[data-label="模型"]::before,
  td[data-label="最后活动"]::before,
  td[data-label="轮次"]::before,
  td[data-label="已使用 Token"]::before {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 650;
  }

  td[data-label="轮次"]::before {
    content: "轮次";
  }

  td[data-label="已使用 Token"]::before {
    content: "Token";
  }

  td[data-label="轮次"] .cellMain::before,
  td[data-label="轮次"] .lastText::before {
    content: "";
  }

  .recentText {
    max-width: none;
    color: #344054;
    -webkit-line-clamp: 3;
  }

  td[data-label="模型"]::before,
  td[data-label="最后活动"]::before {
    display: inline;
    margin-right: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
  }

  td[data-label="模型"]::before {
    content: "模型";
  }

  td[data-label="最后活动"]::before {
    content: "最后活动";
  }

  td[data-label="轮次"] .cellMain::before {
    content: "轮次 ";
    color: var(--muted);
    font-weight: 650;
  }

  td[data-label="轮次"] .lastText::before {
    content: "大小 ";
  }

  .modelText {
    max-width: 150px;
  }

  .tokenTotal {
    white-space: normal;
  }

  .lastText {
    display: inline-block;
    margin-top: 0;
    margin-left: 6px;
    font-size: 12px;
  }

  .time {
    white-space: normal;
  }

  td[data-label="模型"],
  td[data-label="最后活动"],
  td[data-label="轮次"],
  td[data-label="已使用 Token"] {
    display: grid;
    grid-column: auto;
    justify-self: stretch;
  }

  td[data-label="模型"]::before,
  td[data-label="最后活动"]::before,
  td[data-label="轮次"]::before,
  td[data-label="已使用 Token"]::before {
    display: block;
    margin: 0;
    line-height: 1.2;
  }

  td[data-label="轮次"]::before {
    content: "轮次";
  }

  td[data-label="已使用 Token"]::before {
    content: "Token";
  }

  td[data-label="轮次"] .cellMain::before,
  td[data-label="轮次"] .lastText::before {
    content: "";
  }

  td[data-label="轮次"] .lastText,
  td[data-label="已使用 Token"] .lastText {
    display: block;
    margin: 0;
    font-size: 11px;
  }

  .jobsHeader,
  .jobTopline,
  .tmuxPanelHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .jobsActions,
  .aiActions,
  .tmuxPanelActions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
  }

  .topActions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
  }

  .jobsTitleLine {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .jobsPanel.collapsed {
    padding: 12px;
  }

  .jobsPanel.collapsed .jobsHeader {
    margin-bottom: 0;
  }

  .jobsPanel.collapsed .jobsTitleLine {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .jobsPanel.collapsed h2 {
    white-space: nowrap;
  }

  .agentStatus {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }

  .jobsPanel.collapsed .agentStatus {
    min-width: 0;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .jobsHeader .secondaryButton,
  .modalActions button {
    width: 100%;
  }

  .jobsActions .secondaryButton,
  .aiActions .secondaryButton,
  .tmuxPanelActions .secondaryButton {
    width: auto;
    flex: 0 0 auto;
  }

  .topActions button {
    width: auto;
  }

  .topActions .iconButton {
    width: 38px;
    flex: 0 0 38px;
  }

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

  .messageList {
    max-height: 46vh;
  }

  .messageItem {
    max-width: 92%;
  }

  .messageItem.codeLike {
    max-width: 100%;
  }
}

.shell {
  padding-top: 18px;
  padding-bottom: 18px;
}

.topbar {
  min-height: 48px;
  margin-bottom: 12px;
}

.controls,
.jobsPanel,
.tmuxPanel,
.aiPanel,
.authPanel {
  padding: 10px;
  margin-bottom: 10px;
}

.stats {
  gap: 10px;
  margin-bottom: 10px;
}

.stats div {
  min-height: 58px;
  padding: 10px 12px;
}

.stats .statToken {
  min-height: 62px;
}

.stats span {
  font-size: 22px;
}

.stats small {
  margin-top: 5px;
}

table {
  border-spacing: 0 7px;
}

th,
td {
  padding: 10px 12px;
}

.tableWrap {
  max-height: none;
  overflow: visible;
}

.messageItem {
  padding: 8px 10px;
}

.replyComposer {
  padding-top: 10px;
}

@media (max-width: 700px) {
  .shell {
    padding: 8px 6px 12px;
  }

  .topbar {
    min-height: 42px;
    margin-bottom: 8px;
  }

  h1 {
    font-size: 22px;
  }

  p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.3;
  }

  .topActions {
    gap: 6px;
  }

  .iconButton {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .secondaryButton {
    height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }

  .controls {
    padding: 6px;
    margin-bottom: 8px;
  }

  .filterToggleButton {
    min-height: 32px;
    padding: 0 7px;
    gap: 7px;
  }

  .filterToggleTitle,
  .filterSummary {
    font-size: 12px;
  }

  .filterToggleIcon {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .stats {
    gap: 5px;
    margin-bottom: 8px;
  }

  .stats div {
    min-height: 48px;
    padding: 7px 8px;
  }

  .stats .statToken {
    min-height: 52px;
  }

  .stats span {
    font-size: 18px;
  }

  .stats small {
    margin-top: 3px;
    font-size: 10px;
  }

  .tmuxPanel,
  .jobsPanel,
  .aiPanel {
    padding: 8px 10px;
    margin-bottom: 8px;
  }

  .tmuxPanel.emptyState {
    padding: 8px 10px;
  }

  .tmuxPanel.emptyState .tmuxPanelHeader {
    gap: 8px;
  }

  .tmuxPanel.emptyState .tmuxPanelHeader h2,
  .jobsPanel h2 {
    font-size: 14px;
  }

  .tmuxPanel.emptyState .tmuxPanelHeader p {
    margin-top: 2px;
    font-size: 11px;
  }

  .tmuxPanelActions {
    gap: 6px;
  }

  .tmuxPanelActions .secondaryButton,
  .jobsActions .secondaryButton,
  .aiActions .secondaryButton {
    height: 30px;
    padding: 0 8px;
  }

  .jobsHeader {
    gap: 8px;
    margin-bottom: 8px;
  }

  .agentStatus {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
  }

  .jobsToggleButton {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  tbody tr {
    border-radius: 8px;
  }

  tbody tr + tr {
    margin-top: 6px;
  }

  td[data-label="对话名字"] {
    padding: 9px 10px 6px;
  }

  .sessionTitleLine {
    gap: 8px;
  }

  .sessionTitle {
    font-size: 14px;
    line-height: 1.28;
  }

  .sessionIdText {
    margin-top: 3px;
    font-size: 11px;
  }

  .mobileCardActions {
    gap: 6px;
  }

  .mobileCardActions .sendButton {
    min-width: 56px;
    height: 30px;
    padding: 0 11px;
    font-size: 12px;
  }

  .mobileCardActions .deleteSessionButton {
    min-width: 36px;
    height: 30px;
    font-size: 12px;
  }

  td[data-label="最近内容"] {
    padding: 0 10px 8px;
  }

  .recentText {
    font-size: 12px;
    line-height: 1.35;
  }

  td[data-label="模型"],
  td[data-label="最后活动"],
  td[data-label="轮次"],
  td[data-label="已使用 Token"] {
    gap: 2px;
    padding: 7px 10px;
    font-size: 12px;
  }

  td[data-label="模型"]::before,
  td[data-label="最后活动"]::before,
  td[data-label="轮次"]::before,
  td[data-label="已使用 Token"]::before {
    font-size: 10px;
  }

  .modelText {
    min-height: 24px;
    padding: 0 7px;
    font-size: 11px;
  }

  .cellMain,
  .tokenTotal {
    font-size: 13px;
  }

  td[data-label="轮次"] .lastText,
  td[data-label="已使用 Token"] .lastText {
    margin-top: 0;
    font-size: 11px;
  }

  .modalHeader {
    min-height: 44px;
    padding: 6px 8px 6px 12px;
  }

  .messageList {
    gap: 5px;
    padding: 8px 6px 10px;
  }

  .messageItem {
    padding: 6px 8px;
  }

  .replyComposer {
    padding: 6px 7px calc(6px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 700px) {
  tbody td[data-label="模型"],
  tbody td[data-label="最后活动"],
  tbody td[data-label="轮次"],
  tbody td[data-label="已使用 Token"] {
    display: flex !important;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.25;
  }

  tbody td[data-label="模型"]::before,
  tbody td[data-label="最后活动"]::before,
  tbody td[data-label="轮次"]::before,
  tbody td[data-label="已使用 Token"]::before {
    display: inline-block;
    flex: 0 0 48px;
    width: 48px;
    font-size: 10px;
    line-height: 1.2;
  }

  .modelText {
    min-height: 22px;
    padding: 0 7px;
    font-size: 11px;
  }

  .cellMain,
  .tokenTotal {
    display: inline;
    font-size: 13px;
    line-height: 1.2;
  }

  tbody td[data-label="轮次"] .lastText,
  tbody td[data-label="已使用 Token"] .lastText {
    display: inline;
    margin: 0 0 0 4px;
    font-size: 11px;
    line-height: 1.2;
  }
}

@media (max-width: 700px) {
  tbody td[data-label="模型"],
  tbody td[data-label="最后活动"],
  tbody td[data-label="轮次"],
  tbody td[data-label="已使用 Token"] {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.25;
  }

  tbody td[data-label="模型"]::before,
  tbody td[data-label="最后活动"]::before,
  tbody td[data-label="轮次"]::before,
  tbody td[data-label="已使用 Token"]::before {
    display: inline-block;
    flex: 0 0 48px;
    width: 48px;
    font-size: 10px;
    line-height: 1.2;
  }

  .modelText {
    min-height: 22px;
    padding: 0 7px;
    font-size: 11px;
  }

  .cellMain,
  .tokenTotal {
    display: inline;
    font-size: 13px;
    line-height: 1.2;
  }

  tbody td[data-label="轮次"] .lastText,
  tbody td[data-label="已使用 Token"] .lastText {
    display: inline;
    margin: 0 0 0 4px;
    font-size: 11px;
    line-height: 1.2;
  }
}

@media (max-width: 700px) {
  .tmuxPanel {
    padding: 12px;
  }

  .tmuxPanel.emptyState {
    padding: 11px 12px;
  }

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

  .tmuxPanel.emptyState .tmuxPanelHeader h2 {
    font-size: 15px;
  }

  .tmuxPanel.emptyState .tmuxPanelHeader p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.28;
  }

  .tmuxPanelActions {
    flex-direction: row;
    gap: 8px;
  }

  .tmuxPanelActions .secondaryButton {
    width: auto;
    flex: 0 0 auto;
  }

  .tmuxTable {
    gap: 8px;
    min-width: 0;
  }

  .tmuxTableHeader {
    display: none;
  }

  .tmuxRow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: 0;
    padding: 11px;
  }

  .tmuxCell {
    height: auto;
    padding: 0;
    border-left: 0;
  }

  .tmuxTerminalCell {
    gap: 3px;
  }

  .tmuxStateCell {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .tmuxStatus,
  .tmuxClient {
    width: fit-content;
  }

  .tmuxPreviewCell {
    -webkit-line-clamp: 3;
  }

  .tmuxModelCell,
  .tmuxMetricCell,
  .tmuxActivityCell {
    font-size: 11px;
  }

  .tmuxMetricCell {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .tmuxMetricCell::before {
    content: attr(data-label);
    min-width: 68px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
  }

  .tmuxAccessActions {
    justify-content: flex-start;
    padding-top: 4px;
  }

  .terminalPanel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .terminalModal .terminalPanel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .terminalHeader {
    padding: 8px 10px 8px 14px;
    border-bottom: 1px solid rgba(174, 185, 202, 0.7);
    background: rgba(255, 255, 255, 0.96);
  }

  .terminalHeader .modalMeta {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .terminalTabs {
    justify-content: flex-end;
    gap: 7px;
    padding: 7px 8px;
    border-bottom: 1px solid rgba(174, 185, 202, 0.7);
    background: #fff;
    overflow-x: auto;
  }

  .terminalTabs .toolIconButton {
    flex: 0 0 auto;
  }

  .terminalScreen {
    border: 0;
    border-radius: 0;
    font-size: 11px;
    line-height: 1.42;
    padding: 10px 9px 12px;
  }

  .terminalComposer {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 7px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(174, 185, 202, 0.75);
    background: rgba(255, 255, 255, 0.98);
  }

  .terminalComposer textarea {
    height: 46px;
    min-height: 46px;
    max-height: 96px;
    padding: 10px 12px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.35;
  }
}

@media (max-width: 700px) {
  .modal {
    align-items: stretch;
    justify-items: stretch;
    padding: 0;
    background: #dfe7f1;
  }

  .modalPanel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    overflow: hidden;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #e8eef6;
    box-shadow: none;
  }

  .terminalModal .terminalPanel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #e8eef6;
    box-shadow: none;
  }

  .smallModalPanel {
    align-self: end;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 28px);
    overflow: auto;
    grid-template-rows: auto auto auto;
    gap: 12px;
    padding: 14px;
    border-radius: 12px 12px 0 0;
    background: #fff;
  }

  .smallModalPanel .modalHeader {
    min-height: 40px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
  }

  .modalActionRow {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .modalHeader {
    min-height: 52px;
    padding: 8px 10px 8px 14px;
    border-bottom: 1px solid rgba(174, 185, 202, 0.7);
    background: rgba(255, 255, 255, 0.96);
  }

  .modalHeader h2 {
    min-width: 0;
    font-size: 16px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .flatButton {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 20px;
    background: #f5f7fb;
    box-shadow: none;
  }

  .modalMeta {
    margin: 0;
    padding: 6px 14px;
    border-bottom: 1px solid rgba(174, 185, 202, 0.55);
    background: rgba(255, 255, 255, 0.96);
    color: #667085;
    font-size: 11px;
    line-height: 1.25;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .messageList {
    min-height: 0;
    max-height: none;
    overflow: auto;
    gap: 6px;
    padding: 10px 8px 12px;
    border: 0;
    border-radius: 0;
    background: #e8eef6;
  }

  .messageItem {
    max-width: 84%;
    gap: 4px;
    padding: 7px 9px;
    border: 0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08);
  }

  .messageItem.user {
    max-width: 84%;
    border: 0;
    background: #dff4dc;
  }

  .messageItem.assistant {
    border: 0;
    background: #ffffff;
  }

  .messageItem.codeLike {
    max-width: 92%;
  }

  .messageTopline {
    gap: 6px;
    color: #6b778c;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 650;
  }

  .messageTopline span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .messageTopline span:last-child {
    flex: 0 0 auto;
  }

  .messageText {
    color: #1f2a37;
    font-size: 12px;
    line-height: 1.36;
  }

  .messageItem.codeLike .messageText {
    padding: 6px 7px;
    border: 1px solid rgba(174, 185, 202, 0.7);
    border-radius: 8px;
    background: #f7f9fc;
    font-size: 11px;
    line-height: 1.35;
  }

  .aiOutput {
    max-height: 120px;
    margin: 0 8px 8px;
    padding: 8px;
    font-size: 12px;
  }

  .replyComposer {
    position: sticky;
    bottom: 0;
    gap: 6px;
    margin: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(174, 185, 202, 0.75);
    background: rgba(255, 255, 255, 0.98);
  }

  .composerToolbar {
    justify-content: flex-end;
    min-height: 34px;
    gap: 7px;
  }

  .toolIconButton,
  .sendIconButton {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 13px;
  }

  .sendIconButton {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }

  .replyInputRow {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 7px;
  }

  .replyControls {
    gap: 4px;
    font-size: 11px;
  }

  .replyControls > span {
    font-size: 11px;
  }

  .replyControls textarea {
    height: 46px;
    min-height: 46px;
    max-height: 92px;
    padding: 10px 12px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.35;
    resize: vertical;
  }

  .replyGrid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .replyGrid label {
    gap: 4px;
    font-size: 11px;
  }

  .replyGrid select {
    height: 34px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 12px;
  }

}

*,
*::before,
*::after {
  transition: none !important;
}

.iconButton:hover,
.secondaryButton:hover,
.filterToggleButton:hover,
.jobsToggleButton:hover,
.jobOpenButton:hover,
.copyButton:hover,
.toolIconButton:hover {
  border-color: var(--line);
  background: #fff;
}

.primaryButton:hover,
.sendButton:hover,
.tmuxOpenButton:hover,
.sendIconButton:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.deleteSessionButton:hover,
.jobDeleteButton:hover,
.dangerIconButton:hover {
  border-color: #efc0bc;
  background: #fff7f6;
}

.sessionTitleButton:hover .sessionTitle,
.sessionTitleButton.autoTitle:hover .sessionTitle {
  color: inherit;
}

tbody tr:hover td {
  border-color: var(--line);
  background: var(--panel);
}

.filterToggleIcon,
.filterToggleButton.open .filterToggleIcon {
  transform: none;
}

@media (max-width: 700px) {
  .shell {
    width: 100%;
    padding: 12px 8px 16px;
  }

  .topbar {
    min-height: 48px;
    margin-bottom: 10px;
    gap: 10px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.18;
  }

  p {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.35;
  }

  .controls,
  .tmuxPanel,
  .jobsPanel,
  .aiPanel,
  .authPanel,
  .stats div,
  tbody tr {
    border-radius: 8px;
  }

  .controls {
    padding: 8px;
    margin-bottom: 10px;
  }

  .filterToggleButton {
    min-height: 36px;
    padding: 0 8px;
  }

  .stats {
    gap: 6px;
    margin-bottom: 10px;
  }

  .stats div {
    min-height: 54px;
    padding: 8px 10px;
  }

  .stats .statToken {
    min-height: 58px;
  }

  .stats span {
    font-size: 20px;
    line-height: 1.05;
  }

  .stats small {
    margin-top: 5px;
  }

  .tmuxPanel.emptyState {
    padding: 10px 12px;
  }

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

  .tmuxPanel.emptyState .tmuxPanelHeader h2 {
    font-size: 15px;
  }

  .tmuxPanel.emptyState .tmuxPanelHeader p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.3;
  }

  .tmuxPanelActions .secondaryButton,
  .jobsActions .secondaryButton,
  .aiActions .secondaryButton {
    height: 32px;
    padding: 0 9px;
  }

  .tableWrap {
    overflow: visible;
  }

  table {
    min-width: 0;
    border-spacing: 0;
  }

  thead {
    display: none;
  }

  tbody,
  tr {
    display: block;
    width: 100%;
  }

  tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d7e0ec;
    background: var(--panel);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  }

  tbody tr + tr {
    margin-top: 8px;
  }

  tbody td,
  tbody td:first-child,
  tbody td:last-child {
    display: none;
    width: auto !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
  }

  td[data-label="对话名字"] {
    display: block;
    grid-column: 1 / -1;
    order: 1;
    width: 100% !important;
    padding: 12px 12px 8px;
  }

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

  .sessionTitleBlock {
    min-width: 0;
  }

  .sessionTitle {
    font-size: 15px;
    line-height: 1.35;
    font-weight: 760;
  }

  .sessionIdText {
    display: block;
    margin-top: 4px;
    color: #667085;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .mobileCardActions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .mobileCardActions .sendButton {
    min-width: 62px;
    height: 34px;
    padding: 0 13px;
    border-radius: 8px;
    font-size: 13px;
  }

  .mobileCardActions .deleteSessionButton {
    min-width: 42px;
    height: 34px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: #b42318;
    font-size: 13px;
  }

  .mobileCardActions .deleteSessionButton:hover {
    border-color: transparent;
    background: transparent;
  }

  td[data-label="最近内容"] {
    display: block;
    grid-column: 1 / -1;
    order: 2;
    width: 100% !important;
    padding: 0 12px 10px;
    border-bottom: 1px solid #e7edf5;
  }

  .recentText {
    display: -webkit-box;
    color: #27364a;
    font-size: 13px;
    line-height: 1.45;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  td[data-label="模型"],
  td[data-label="最后活动"],
  td[data-label="轮次"],
  td[data-label="已使用 Token"] {
    display: grid;
    grid-column: auto;
    order: 3;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border-top: 0;
    color: #27364a;
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
  }

  td[data-label="最后活动"],
  td[data-label="已使用 Token"] {
    border-left: 1px solid #e7edf5;
  }

  td[data-label="轮次"],
  td[data-label="已使用 Token"] {
    border-top: 1px solid #e7edf5;
  }

  td[data-label="模型"]::before,
  td[data-label="最后活动"]::before,
  td[data-label="轮次"]::before,
  td[data-label="已使用 Token"]::before {
    display: block;
    margin: 0;
    color: #667085;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 700;
    text-align: left;
  }

  td[data-label="模型"]::before {
    content: "模型";
  }

  td[data-label="最后活动"]::before {
    content: "最后活动";
  }

  td[data-label="轮次"]::before {
    content: "轮次";
  }

  td[data-label="已使用 Token"]::before {
    content: "Token";
  }

  td[data-label="创建时间"],
  td[data-label="恢复命令"],
  td[data-label="tmux命令"],
  td[data-label="复制"],
  td[data-label="远程复制"],
  body.remoteMode td.desktopAction,
  td.desktopDanger {
    display: none !important;
  }

  .modelText {
    width: fit-content;
    min-width: 0;
    min-height: 26px;
    max-width: 100%;
    padding: 0 8px;
    justify-self: start;
    border-radius: 8px;
    font-size: 12px;
  }

  .cellMain {
    font-size: 14px;
    line-height: 1.25;
  }

  .tokenTotal {
    font-size: 14px;
    line-height: 1.25;
    white-space: normal;
  }

  td[data-label="轮次"] .cellMain::before,
  td[data-label="轮次"] .lastText::before {
    content: "" !important;
  }

  td[data-label="轮次"] .lastText,
  td[data-label="已使用 Token"] .lastText {
    display: block;
    margin: 1px 0 0;
    color: #667085;
    font-size: 12px;
    line-height: 1.25;
  }

  .time {
    white-space: normal;
  }

  .sessionRenameForm {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .sessionRenameInput {
    grid-column: auto;
    height: 34px;
    font-size: 13px;
  }

  .renameSaveButton,
  .renameCancelButton {
    width: auto;
    height: 34px;
    padding: 0 9px;
  }
}

@media (max-width: 700px) {
  .shell {
    padding: 8px 6px 12px;
  }

  .topbar {
    min-height: 42px;
    margin-bottom: 8px;
  }

  h1 {
    font-size: 22px;
  }

  p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.3;
  }

  .topActions {
    gap: 6px;
  }

  .iconButton {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .secondaryButton {
    height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }

  .controls {
    padding: 6px;
    margin-bottom: 8px;
  }

  .filterToggleButton {
    min-height: 32px;
    padding: 0 7px;
    gap: 7px;
  }

  .filterToggleTitle,
  .filterSummary {
    font-size: 12px;
  }

  .filterToggleIcon {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .stats {
    gap: 5px;
    margin-bottom: 8px;
  }

  .stats div {
    min-height: 48px;
    padding: 7px 8px;
  }

  .stats .statToken {
    min-height: 52px;
  }

  .stats span {
    font-size: 18px;
  }

  .stats small {
    margin-top: 3px;
    font-size: 10px;
  }

  .tmuxPanel,
  .jobsPanel,
  .aiPanel {
    padding: 8px 10px;
    margin-bottom: 8px;
  }

  .tmuxPanel.emptyState {
    padding: 8px 10px;
  }

  .tmuxPanel.emptyState .tmuxPanelHeader {
    gap: 8px;
  }

  .tmuxPanel.emptyState .tmuxPanelHeader h2,
  .jobsPanel h2 {
    font-size: 14px;
  }

  .tmuxPanel.emptyState .tmuxPanelHeader p {
    margin-top: 2px;
    font-size: 11px;
  }

  .tmuxPanelActions {
    gap: 6px;
  }

  .tmuxPanelActions .secondaryButton,
  .jobsActions .secondaryButton,
  .aiActions .secondaryButton {
    height: 30px;
    padding: 0 8px;
  }

  .jobsHeader {
    gap: 8px;
    margin-bottom: 8px;
  }

  .agentStatus {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
  }

  .jobsToggleButton {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  tbody tr {
    border-radius: 8px;
  }

  tbody tr + tr {
    margin-top: 6px;
  }

  tbody td[data-label="对话名字"] {
    display: block;
    grid-column: 1 / -1;
    order: 1;
    width: 100% !important;
    padding: 9px 10px 6px;
  }

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

  .sessionTitle {
    font-size: 14px;
    line-height: 1.28;
  }

  .sessionIdText {
    margin-top: 3px;
    font-size: 11px;
  }

  .mobileCardActions {
    display: flex;
    gap: 6px;
  }

  .mobileCardActions .sendButton {
    min-width: 56px;
    height: 30px;
    padding: 0 11px;
    font-size: 12px;
  }

  .mobileCardActions .deleteSessionButton {
    min-width: 36px;
    height: 30px;
    font-size: 12px;
  }

  tbody td[data-label="最近内容"] {
    display: block;
    grid-column: 1 / -1;
    order: 2;
    width: 100% !important;
    padding: 0 10px 8px;
  }

  .recentText {
    font-size: 12px;
    line-height: 1.35;
  }

  tbody td[data-label="模型"],
  tbody td[data-label="最后活动"],
  tbody td[data-label="轮次"],
  tbody td[data-label="已使用 Token"] {
    display: grid;
    grid-column: auto;
    order: 3;
    gap: 2px;
    padding: 7px 10px;
    font-size: 12px;
  }

  tbody td[data-label="模型"]::before,
  tbody td[data-label="最后活动"]::before,
  tbody td[data-label="轮次"]::before,
  tbody td[data-label="已使用 Token"]::before {
    font-size: 10px;
  }

  .modelText {
    min-height: 24px;
    padding: 0 7px;
    font-size: 11px;
  }

  .cellMain,
  .tokenTotal {
    font-size: 13px;
  }

  tbody td[data-label="轮次"] .lastText,
  tbody td[data-label="已使用 Token"] .lastText {
    margin-top: 0;
    font-size: 11px;
  }

  .modalHeader {
    min-height: 44px;
    padding: 6px 8px 6px 12px;
  }

  .messageList {
    gap: 5px;
    padding: 8px 6px 10px;
  }

  .messageItem {
    padding: 6px 8px;
  }

  .replyComposer {
    padding: 6px 7px calc(6px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 700px) {
  tbody td[data-label="模型"],
  tbody td[data-label="最后活动"],
  tbody td[data-label="轮次"],
  tbody td[data-label="已使用 Token"] {
    display: flex !important;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.25;
  }

  tbody td[data-label="模型"]::before,
  tbody td[data-label="最后活动"]::before,
  tbody td[data-label="轮次"]::before,
  tbody td[data-label="已使用 Token"]::before {
    display: inline-block;
    flex: 0 0 48px;
    width: 48px;
    font-size: 10px;
    line-height: 1.2;
  }

  .modelText {
    min-height: 22px;
    padding: 0 7px;
    font-size: 11px;
  }

  .cellMain,
  .tokenTotal {
    display: inline;
    font-size: 13px;
    line-height: 1.2;
  }

  tbody td[data-label="轮次"] .lastText,
  tbody td[data-label="已使用 Token"] .lastText {
    display: inline;
    margin: 0 0 0 4px;
    font-size: 11px;
    line-height: 1.2;
  }
}


/* final fixed jobs layout */
.jobsPanel,
.jobsPanel.collapsed {
  padding: 8px 10px;
}

.jobsHeader,
.jobsPanel.collapsed .jobsHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 8px;
}

.jobsPanel.collapsed .jobsHeader {
  margin-bottom: 0;
}

.jobsTitleLine,
.jobsPanel.collapsed .jobsTitleLine {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 30px;
}

.jobsTitleLine h2,
.jobsPanel.collapsed .jobsTitleLine h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.jobsTitleLine .agentStatus,
.jobsPanel.collapsed .agentStatus {
  width: auto;
  min-height: 22px;
  margin: 0;
  padding: 2px 7px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.jobsToggleButton {
  height: 24px;
  padding: 0 8px;
  line-height: 22px;
}

.jobsActions {
  align-items: center;
  justify-content: end;
}

.jobList {
  margin-top: 0;
}

@media (max-width: 700px) {
  .jobsPanel,
  .jobsPanel.collapsed {
    padding: 8px 10px;
  }

  .jobsHeader,
  .jobsPanel.collapsed .jobsHeader {
    display: block;
    min-height: 30px;
    margin-bottom: 8px;
  }

  .jobsPanel.collapsed .jobsHeader {
    margin-bottom: 0;
  }

  .jobsTitleLine,
  .jobsPanel.collapsed .jobsTitleLine {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    justify-content: start;
    gap: 8px;
    min-height: 30px;
  }

  .jobsTitleLine h2,
  .jobsPanel.collapsed .jobsTitleLine h2 {
    font-size: 15px;
  }

  .jobsActions {
    justify-content: flex-end;
    margin-top: 8px;
    min-height: 24px;
  }
}

/* new conversation dialog */
.newConversationModal .modalPanel {
  width: min(760px, calc(100vw - 40px));
  max-height: min(620px, calc(100vh - 40px));
  gap: 10px;
  padding: 16px;
  overflow: visible;
}

.newConversationModal .modalHeader {
  min-height: 34px;
}

.newConversationModal .modalHeader h2 {
  font-size: 16px;
  line-height: 1.25;
}

.newConversationModal .flatButton {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
}

.newConversationModal .modalMeta {
  margin: -4px 0 0;
  color: #667085;
  font-size: 12px;
}

.newConversationModal .messageList {
  min-height: 0;
  max-height: 170px;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.newConversationModal .newPromptHint {
  min-height: 0;
  height: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
  color: #526176;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.newConversationModal .messageItem {
  max-width: 100%;
}

.newConversationModal .replyComposer {
  position: relative;
  bottom: auto;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.newConversationModal .composerToolbar {
  min-height: 30px;
  gap: 6px;
}

.newConversationModal .toolIconButton,
.newConversationModal .settingsIconButton {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 13px;
}

.newConversationModal .replyInputRow {
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
}

.newConversationModal .replyControls > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.newConversationModal .replyControls textarea {
  height: 112px;
  min-height: 112px;
  max-height: 220px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.newConversationModal .sendIconButton {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 18px;
}

@media (max-width: 700px) {
  .newConversationModal.modal {
    align-items: end;
    justify-items: stretch;
    padding: 12px;
    background: rgba(15, 23, 42, 0.34);
  }

  .newConversationModal .modalPanel {
    align-self: end;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 24px);
    gap: 8px;
    padding: 12px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .newConversationModal .modalHeader {
    min-height: 34px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
  }

  .newConversationModal .modalMeta {
    display: block;
    margin: -2px 0 0;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    font-size: 11px;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .newConversationModal .newPromptHint {
    padding: 9px 10px;
    font-size: 12px;
  }

  .newConversationModal .replyComposer {
    position: relative;
    gap: 7px;
    padding: 8px;
    border-radius: 10px;
  }

  .newConversationModal .composerToolbar {
    min-height: 30px;
  }

  .newConversationModal .replyControls textarea {
    height: 118px;
    min-height: 118px;
    max-height: 38dvh;
    padding: 11px;
    border-radius: 10px;
    font-size: 13px;
  }

}

/* rename popover */
.sessionTitleBlock {
  position: relative;
}

.sessionRenamePopover {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 40;
  display: grid;
  gap: 6px;
  width: min(380px, calc(100vw - 40px));
  padding: 8px;
  border: 1px solid #b8cdf4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.sessionRenamePopover .sessionRenameInput {
  width: 100%;
  height: 38px;
  grid-column: auto;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 38px;
}

.sessionRenameHint {
  color: #667085;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .sessionRenamePopover {
    top: -6px;
    left: -2px;
    width: min(330px, calc(100vw - 28px));
    padding: 8px;
  }

  .sessionRenamePopover .sessionRenameInput {
    height: 40px;
    font-size: 14px;
    line-height: 40px;
  }
}

/* session runtime status */
.sessionIdText {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sessionLiveDot {
  flex: 0 0 auto;
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  box-shadow: none;
}

.sessionLiveDot.live-busy {
  color: #16a34a;
}

.sessionLiveDot.live-attached {
  color: #d92d20;
}

.sessionLiveDot.live-idle {
  color: #f59e0b;
}

.sessionLiveDot.live-closed {
  color: #98a2b3;
}

.sessionLiveLabel {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.sessionDeviceBadge {
  max-width: 92px;
  overflow: hidden;
  color: #344054;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* compact new conversation dialog */
.newConversationModal .modalPanel {
  width: min(680px, calc(100vw - 44px));
  max-height: min(560px, calc(100vh - 44px));
  gap: 8px;
  padding: 14px;
  overflow: visible;
  border-radius: 10px;
  background: #fff;
}

.newConversationModal .modalHeader {
  min-height: 32px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.newConversationModal .modalHeader h2 {
  font-size: 16px;
  line-height: 1.2;
}

.newConversationModal .flatButton {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 18px;
}

.newConversationModal .modalMeta {
  display: block;
  margin: -2px 0 1px;
  padding: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.newConversationModal .messageList {
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.newConversationModal .newPromptHint {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid #d7e2f1;
  border-radius: 8px;
  background: #f8fafc;
  color: #526176;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.newConversationModal .replyComposer {
  position: relative;
  bottom: auto;
  display: block;
  margin: 2px 0 0;
  padding: 0;
  overflow: visible;
  border: 1px solid #c9d6e8;
  border-radius: 10px;
  background: #fff;
}

.newConversationModal .replyComposer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 100, 217, 0.12);
}

.newConversationModal .composerToolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  min-height: 30px;
  gap: 6px;
}

.newConversationModal .toolIconButton,
.newConversationModal .settingsIconButton {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
}

.newConversationModal .replyInputRow {
  display: block;
}

.newConversationModal .replyControls {
  display: block;
}

.newConversationModal .replyControls > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.newConversationModal .replyControls textarea {
  width: 100%;
  height: 132px;
  min-height: 132px;
  max-height: 260px;
  padding: 16px 58px 52px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.newConversationModal .replyControls textarea:focus {
  outline: none;
}

.newConversationModal .sendIconButton {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 18px;
}

.newConversationModal .modelControl select {
  display: none;
}

.newConversationModal .modelSegmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.newConversationModal .modelChoice {
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.newConversationModal .modelChoice.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.newConversationModal .replyGrid {
  grid-template-columns: 1fr minmax(112px, 0.62fr);
  gap: 8px;
}

@media (max-width: 700px) {
  .newConversationModal.modal {
    align-items: end;
    justify-items: stretch;
    padding: 10px;
  }

  .newConversationModal .modalPanel {
    align-self: end;
    width: 100%;
    max-height: calc(100dvh - 20px);
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
  }

  .newConversationModal .modalMeta {
    font-size: 11px;
  }

  .newConversationModal .newPromptHint {
    min-height: 30px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .newConversationModal .replyControls textarea {
    height: 128px;
    min-height: 128px;
    max-height: 42dvh;
    padding: 14px 56px 50px 12px;
    font-size: 13px;
  }

  .newConversationModal .replyGrid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .newConversationModal .modelSegmented {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .newConversationModal .modelChoice {
    height: 32px;
    font-size: 11px;
  }
}

/* final detail dialog sizing */
@media (min-width: 701px) {
  #commandModal:not(.newConversationModal) {
    padding: 24px;
  }

  #commandModal:not(.newConversationModal) .modalPanel {
    width: min(1040px, calc(100vw - 48px));
    max-height: calc(100dvh - 48px);
    overflow: visible;
    grid-template-rows: auto auto minmax(260px, 1fr) auto auto;
    gap: 10px;
  }

  #commandModal:not(.newConversationModal) .messageList {
    min-height: 260px;
    max-height: min(56vh, 560px);
  }

  #commandModal:not(.newConversationModal) .replyComposer {
    position: relative;
    bottom: auto;
    z-index: 20;
  }

  #commandModal:not(.newConversationModal) .composerToolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
  }

  #commandModal:not(.newConversationModal) .replyInputRow {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  #commandModal:not(.newConversationModal) .replyControls textarea {
    height: 118px;
    min-height: 118px;
    max-height: 220px;
    border-radius: 8px;
  }
}

/* final send settings modal */
.sendSettingsSummary {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: #526176;
  font-size: 12px;
  font-weight: 680;
}

.sendSettingsSummary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settingsModal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.18);
}

.settingsModal[hidden] {
  display: none;
}

.settingsModalPanel {
  width: min(460px, calc(100vw - 36px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.settingsModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}

.settingsModalHeader h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

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

.settingsDialogBody .replyGrid {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.7fr);
}

.settingsDialogBody .modelControl select {
  display: none;
}

.settingsDialogBody .modelSegmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.settingsDialogBody .modelChoice {
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.settingsDialogBody .modelChoice.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.settingsModalActions {
  display: flex;
  justify-content: flex-end;
}

.settingsModalActions .secondaryButton {
  min-width: 74px;
}

@media (max-width: 700px) {
  .sendSettingsSummary {
    flex-wrap: wrap;
    gap: 4px 8px;
    min-height: 34px;
    padding: 6px 9px;
    line-height: 1.25;
  }

  .sendSettingsSummary span {
    flex: 0 1 auto;
    max-width: 100%;
  }

  .settingsModal {
    align-items: end;
    justify-items: stretch;
    padding: 10px;
    background: rgba(15, 23, 42, 0.28);
  }

  .settingsModalPanel {
    width: 100%;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
  }

  .settingsDialogBody .replyGrid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settingsDialogBody .modelChoice {
    height: 32px;
    font-size: 11px;
  }
}

@media (max-width: 700px) {
  .machinePicker {
    height: 34px;
    padding: 0 7px;
    font-size: 11px;
  }

  .machinePicker select {
    height: 28px;
    min-width: 72px;
    padding-right: 16px;
  }
}

.topbar > div:first-child {
  min-width: 0;
}

.topActions {
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.topbar > div:first-child {
  width: 100%;
}

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

.clientDevicePicker select {
  min-width: 64px;
}

@media (max-width: 700px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .topbar > div:first-child {
    width: 100%;
  }

  .topbar h1 {
    max-width: none;
    white-space: normal;
  }

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

  .machinePicker {
    flex: 1 1 150px;
    min-width: 150px;
    max-width: 210px;
  }

  .guiCopyTopButton {
    flex: 0 0 auto;
  }
}

.sessionTitleBlock .sessionTaskName {
  display: block;
  max-width: 100%;
}

.sessionTimeCell {
  line-height: 1.35;
}

.sessionTimeCell .timeMain,
.sessionTimeCell .timeSub {
  display: block;
  white-space: nowrap;
}

.sessionTimeCell .timeSub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.creatorIpCell {
  color: #344054;
}

.creatorIpText {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.sessionTitleBlock .sessionTitle.sessionConversationTitle {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}

@media (max-width: 700px) {
  .sessionTitleBlock .sessionTaskName {
    font-size: 14px;
    line-height: 1.28;
  }

  .sessionTitleBlock .sessionTitle.sessionConversationTitle {
    font-size: 13px;
    line-height: 1.3;
  }

  tbody td[data-label="时间"],
  tbody td[data-label="创建者 IP"] {
    display: grid !important;
    gap: 3px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.25;
  }

  tbody td[data-label="时间"]::before {
    content: "时间";
    color: #667085;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
  }

  tbody td[data-label="创建者 IP"]::before {
    content: "创建者 IP";
    color: #667085;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
  }

  tbody td[data-label="时间"] .timeSub {
    margin-top: 0;
    font-size: 11px;
  }
}
