:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #66727d;
  --faint: #8b969f;
  --paper: #f6f5f1;
  --surface: #fffdfa;
  --rail: #20252a;
  --rail-soft: #2d3339;
  --line: #ded9cf;
  --line-dark: #3b4248;
  --accent: #0e8274;
  --accent-strong: #056f64;
  --warning: #b24d2a;
  --agent: #ffffff;
  --user: #e9f4f1;
  --tool: #fff3df;
  --error: #ffe9e3;
  --shadow: 0 20px 70px rgba(27, 31, 35, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(21, 23, 26, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 23, 26, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  font-family: "Aptos", "Helvetica Neue", "Noto Sans SC", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea,
input {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
}

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

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

.primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.ghost {
  background: transparent;
}

.danger {
  border-color: rgba(178, 77, 42, 0.34);
  background: #fff8f3;
  color: var(--warning);
}

.wide {
  width: 100%;
}

.login-page {
  min-height: 100vh;
  padding: 0;
}

.login-topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.9);
}

.login-topbar-inner {
  width: min(1120px, calc(100% - 32px));
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
}

.login-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 14px;
}

.login-shell {
  width: min(980px, calc(100% - 32px));
  min-height: calc(100vh - 65px);
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 32px 0;
}

.login-panel {
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.login-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  width: 50px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}

.login-copy {
  margin: 44px 0 24px;
}

.login-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.login-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.field input,
.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.field input {
  height: 44px;
  padding: 0 12px;
}

.field input:focus,
.composer textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(14, 130, 116, 0.14);
}

.auth-error {
  border: 1px solid rgba(178, 77, 42, 0.25);
  border-radius: 6px;
  background: var(--error);
  color: var(--warning);
  padding: 10px 12px;
}

.login-submit {
  min-height: 44px;
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  background: var(--rail);
  color: #f7f3ea;
  padding: 16px;
}

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

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

.sidebar-close,
.mobile-session-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.sidebar .brand-mark {
  background: #f7f3ea;
  color: var(--rail);
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border-color: var(--line-dark);
  background: var(--rail-soft);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #c9d0d6;
  font-size: 12px;
}

.status-strip span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
}

.status-strip .offline {
  color: #ffc2ac;
}

.session-list {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.session-item {
  width: 100%;
  height: auto;
  min-height: 62px;
  display: grid;
  gap: 5px;
  align-content: center;
  border-color: var(--line-dark);
  background: transparent;
  color: #f7f3ea;
  text-align: left;
}

.session-item.active,
.session-item:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.session-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.session-meta,
.session-empty {
  color: #aeb8c0;
  font-size: 12px;
}

.session-empty {
  padding: 12px 4px;
}

.logout-form {
  margin: 0;
}

.sidebar .ghost {
  border-color: var(--line-dark);
  color: #f7f3ea;
}

.chat-surface {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.9);
  padding: 14px 22px;
}

.chat-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-title-text {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.chat-head h1 {
  margin: 0;
  max-width: min(720px, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

.chat-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.mobile-only-action,
.button-icon {
  display: none;
}

.messages {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
}

.empty-state {
  margin: auto;
  width: min(560px, 100%);
  border: 1px dashed #b9b0a2;
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
  padding: 24px;
  text-align: center;
}

.empty-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
}

.empty-state p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.message {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
}

.message-label {
  color: var(--faint);
  font-size: 12px;
  font-weight: 750;
  padding-top: 10px;
  text-align: right;
}

.message-body {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--agent);
  padding: 12px 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.message.user .message-body {
  background: var(--user);
}

.message.tool .message-body {
  background: var(--tool);
  color: #6f4a18;
}

.tool-card {
  color: #402b10;
}

.tool-card summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.tool-card summary::-webkit-details-marker {
  display: none;
}

.tool-card summary::after {
  content: "展开";
  margin-left: auto;
  color: #8a6730;
  font-size: 12px;
  font-weight: 650;
}

.tool-card[open] summary::after {
  content: "收起";
}

.tool-event {
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(111, 74, 24, 0.2);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.7);
  color: #6f4a18;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.tool-card-title {
  min-width: 0;
  overflow: hidden;
  color: #402b10;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-card-meta {
  margin: 8px 0 10px;
  color: #856334;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tool-detail-block {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.tool-detail-label {
  color: #6f4a18;
  font-size: 12px;
  font-weight: 750;
}

.message-body .tool-detail-json,
.message-body .tool-detail-code {
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(111, 74, 24, 0.16);
  border-radius: 6px;
  background: #fffdfa;
  color: #2a2f35;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.message-body .tool-detail-code {
  background: #1d2227;
  color: #f5f1e8;
}

.message-body .tool-detail-json code,
.message-body .tool-detail-code code {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.tool-empty {
  color: #856334;
  font-size: 13px;
}

.hide-tools .message.tool {
  display: none;
}

.message.error .message-body {
  background: var(--error);
  color: var(--warning);
}

.message-body p {
  margin: 0 0 10px;
}

.message-body p:last-child,
.message-body ul:last-child,
.message-body ol:last-child,
.message-body blockquote:last-child,
.message-body .table-wrap:last-child,
.message-body pre:last-child {
  margin-bottom: 0;
}

.message-body h1,
.message-body h2,
.message-body h3 {
  margin: 6px 0 8px;
  font-size: 18px;
  letter-spacing: 0;
}

.message-body code {
  border: 1px solid #d5d1c8;
  border-radius: 4px;
  background: #f4f1eb;
  padding: 1px 4px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.message-body pre {
  overflow-x: auto;
  border-radius: 6px;
  background: #1d2227;
  color: #f5f1e8;
  padding: 12px;
}

.message-body pre code {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.composer {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.94);
  padding: 14px;
}

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

.tool-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}

.tool-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.switch {
  width: 42px;
  height: 23px;
  position: relative;
  display: inline-block;
  border: 1px solid #c7c1b7;
  border-radius: 999px;
  background: #e7e1d7;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.switch::after {
  content: "";
  width: 17px;
  height: 17px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fffdfa;
  box-shadow: 0 2px 5px rgba(21, 23, 26, 0.24);
  transition: transform 0.16s ease;
}

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

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

.tool-toggle input:focus-visible + .switch {
  outline: 3px solid rgba(14, 130, 116, 0.18);
}

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

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

.skill-picker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.98);
  box-shadow: 0 18px 48px rgba(21, 23, 26, 0.18);
  padding: 6px;
}

.skill-picker[hidden] {
  display: none;
}

.skill-option {
  width: 100%;
  min-height: 54px;
  height: auto;
  display: grid;
  gap: 3px;
  align-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
}

.skill-option:hover,
.skill-option.active {
  background: #e9f4f1;
}

.skill-name {
  color: var(--ink);
  font-weight: 750;
}

.skill-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.skill-empty {
  color: var(--muted);
  padding: 12px 10px;
  font-size: 13px;
}

.composer textarea {
  min-height: 54px;
  max-height: 180px;
  resize: vertical;
  padding: 14px;
  line-height: 1.45;
}

.send {
  min-height: 54px;
}

.message-body blockquote {
  margin: 0 0 10px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  padding-left: 12px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 10px 0;
}

.message-body table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: #fffdfa;
  font-size: 14px;
}

.message-body th,
.message-body td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.message-body th {
  background: #eee8dc;
  font-weight: 750;
}

.message-body tr:last-child td {
  border-bottom: 0;
}

.message-body th:last-child,
.message-body td:last-child {
  border-right: 0;
}

@media (max-width: 820px) {
  html {
    min-height: 100%;
  }

  body:not(.login-page) {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body:not(.login-page) {
    background-color: #f4f1ea;
    background-size: 24px 24px;
    -webkit-tap-highlight-color: transparent;
  }

  button {
    touch-action: manipulation;
  }

  .workspace {
    width: 100%;
    min-height: 100svh;
    height: 100svh;
    height: 100dvh;
    position: relative;
    display: block;
    overflow: hidden;
  }

  .sidebar {
    width: min(390px, calc(100vw - 18px));
    min-height: 100svh;
    height: 100svh;
    height: 100dvh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0 24px 24px 0;
    background:
      radial-gradient(circle at 0 0, rgba(31, 149, 132, 0.22), transparent 36%),
      linear-gradient(160deg, #20272a 0%, #171c1f 100%);
    box-shadow: 28px 0 80px rgba(16, 22, 24, 0.42);
    padding:
      calc(env(safe-area-inset-top) + 18px)
      14px
      calc(env(safe-area-inset-bottom) + 14px);
    transform: translateX(-105%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .sessions-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-head {
    min-height: 46px;
  }

  .sidebar .brand {
    gap: 8px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 16px;
  }

  .sidebar .brand-mark {
    width: 48px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: #d9f0e8;
    color: #173d37;
  }

  .sidebar .icon-button,
  .sidebar-close {
    min-height: 40px;
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f7f3ea;
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
  }

  .status-strip {
    gap: 6px;
    padding-bottom: 2px;
  }

  .status-strip span {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
  }

  .session-list {
    max-height: none;
    gap: 7px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .session-item {
    min-height: 66px;
    border-color: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    padding: 10px 12px;
  }

  .session-item.active {
    border-color: rgba(157, 226, 211, 0.5);
    background: linear-gradient(135deg, rgba(37, 139, 122, 0.34), rgba(255, 255, 255, 0.08));
    box-shadow: inset 3px 0 #8ad9c9;
  }

  .session-meta {
    color: #9dabb0;
  }

  .logout-form .ghost {
    min-height: 44px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.045);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(19, 25, 27, 0.48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .chat-surface {
    width: 100%;
    height: 100svh;
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .chat-head {
    min-height: calc(64px + env(safe-area-inset-top));
    position: relative;
    z-index: 10;
    align-items: center;
    gap: 6px;
    border-bottom-color: rgba(128, 116, 98, 0.18);
    background: rgba(247, 245, 239, 0.9);
    box-shadow: 0 8px 26px rgba(45, 49, 47, 0.06);
    padding: calc(env(safe-area-inset-top) + 10px) 10px 10px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .chat-title-wrap {
    min-width: 0;
    flex: 1;
    gap: 9px;
  }

  .mobile-session-toggle {
    min-width: 78px;
    min-height: 42px;
    display: inline-grid;
    grid-template-columns: 15px auto auto;
    align-items: center;
    flex-shrink: 0;
    gap: 6px;
    border-color: rgba(14, 130, 116, 0.2);
    border-radius: 14px;
    background: #dfeee9;
    color: #0a6d62;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 750;
  }

  .menu-glyph {
    width: 15px;
    display: grid;
    gap: 3px;
  }

  .menu-glyph i {
    width: 100%;
    height: 1.5px;
    display: block;
    border-radius: 999px;
    background: currentColor;
  }

  .menu-glyph i:nth-child(2) {
    width: 10px;
  }

  .session-count {
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(10, 109, 98, 0.12);
    padding: 0 4px;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
  }

  .chat-title-text {
    min-width: 0;
    flex: 1;
  }

  .eyebrow {
    margin-bottom: 1px;
    color: #72807d;
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .chat-head h1 {
    max-width: 100%;
    color: #202623;
    font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
    font-size: 17px;
    line-height: 1.25;
  }

  .chat-actions {
    gap: 5px;
  }

  .chat-actions button,
  .mobile-only-action {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    display: inline-grid;
    place-items: center;
    border-color: rgba(128, 116, 98, 0.18);
    border-radius: 14px;
    background: rgba(255, 253, 250, 0.76);
    padding: 0;
  }

  .chat-actions .danger {
    border-color: rgba(178, 77, 42, 0.14);
    background: rgba(255, 241, 233, 0.74);
  }

  .button-icon {
    display: block;
    font-size: 21px;
    line-height: 1;
  }

  .button-icon-text {
    font-size: 13px;
    font-weight: 750;
  }

  .button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .messages {
    gap: 14px;
    overflow-x: hidden;
    overscroll-behavior: contain;
    background:
      radial-gradient(circle at 100% 0, rgba(14, 130, 116, 0.07), transparent 32%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 26%);
    padding: 18px 10px 24px;
    scroll-padding-bottom: 24px;
    -webkit-overflow-scrolling: touch;
  }

  .message {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .message.user {
    width: min(92%, 620px);
  }

  .message-label {
    color: #7b8785;
    padding: 0 5px;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
  }

  .message.user .message-label {
    text-align: right;
  }

  .message-body {
    border-color: rgba(128, 116, 98, 0.2);
    border-radius: 17px;
    background: rgba(255, 254, 251, 0.94);
    box-shadow: 0 7px 22px rgba(43, 48, 46, 0.055);
    padding: 12px 13px;
    font-size: 15px;
    line-height: 1.62;
  }

  .message.assistant .message-body {
    border-left: 3px solid rgba(14, 130, 116, 0.62);
    border-radius: 5px 17px 17px 17px;
  }

  .message.user .message-body {
    border-color: rgba(14, 130, 116, 0.2);
    border-radius: 17px 5px 17px 17px;
    background: linear-gradient(135deg, #dceee9, #e9f4f0);
    box-shadow: 0 7px 22px rgba(14, 130, 116, 0.08);
  }

  .message.tool .message-body {
    border-color: rgba(174, 123, 42, 0.2);
    background: #fff5e3;
  }

  .message-body h1,
  .message-body h2,
  .message-body h3 {
    font-size: 17px;
  }

  .empty-state {
    width: calc(100% - 8px);
    border-color: rgba(128, 116, 98, 0.32);
    border-radius: 20px;
    background: rgba(255, 253, 250, 0.76);
    box-shadow: 0 18px 50px rgba(43, 48, 46, 0.07);
    padding: 24px 18px;
  }

  .empty-title {
    font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
    font-size: 23px;
  }

  .empty-state p {
    font-size: 14px;
  }

  .composer {
    position: relative;
    z-index: 12;
    gap: 6px;
    border-top-color: rgba(128, 116, 98, 0.18);
    background: rgba(248, 246, 241, 0.94);
    box-shadow: 0 -12px 32px rgba(44, 48, 46, 0.07);
    padding: 7px 10px calc(env(safe-area-inset-bottom) + 10px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .composer-toolbar {
    min-height: 24px;
    justify-content: flex-start;
  }

  .tool-toggle {
    gap: 6px;
    color: #697572;
    font-size: 11px;
  }

  .switch {
    width: 36px;
    height: 20px;
  }

  .switch::after {
    width: 14px;
    height: 14px;
  }

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

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

  .composer textarea {
    height: 54px;
    min-height: 54px;
    max-height: 118px;
    border-color: rgba(128, 116, 98, 0.24);
    border-radius: 18px;
    background: rgba(255, 254, 251, 0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 14px 15px;
    resize: none;
    font-size: 16px;
  }

  .send {
    min-height: 54px;
    border-radius: 18px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 750;
  }

  .skill-picker {
    max-height: 42dvh;
    border-radius: 16px;
  }

  .message-body table {
    min-width: 360px;
    font-size: 13px;
  }

  .message-body th,
  .message-body td {
    padding: 7px 8px;
  }

  .message-body .tool-detail-json,
  .message-body .tool-detail-code {
    max-height: 220px;
    font-size: 11px;
  }
}

@media (max-width: 430px) {
  .chat-head {
    gap: 5px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .chat-title-wrap {
    gap: 7px;
  }

  .mobile-session-toggle {
    min-width: 74px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .chat-head h1 {
    font-size: 16px;
  }

  .eyebrow {
    display: none;
  }

  .chat-actions button,
  .mobile-only-action {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .switch::after {
    transition: none;
  }
}
