: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-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.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;
}

.auth-switch {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-switch a {
  color: var(--accent-strong);
  font-weight: 700;
}

.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;
}

.status-strip .quota-empty {
  border-color: rgba(255, 194, 172, 0.34);
  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;
}

.admin-users-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  color: #f7f3ea;
  padding: 0 13px;
}

.admin-users-link[hidden] {
  display: none;
}

.admin-users-link:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.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.thought .message-body {
  border-color: rgba(91, 107, 105, 0.24);
  background: #f3f5f3;
  color: #52605e;
  padding: 0;
}

.thought-card {
  min-width: 0;
}

.thought-card summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 11px 14px;
}

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

.thought-title {
  min-width: 0;
  color: #52605e;
  font-size: 13px;
  font-weight: 700;
}

.thought-action {
  margin-left: auto;
  color: #7b8986;
  font-size: 12px;
  font-weight: 650;
  flex-shrink: 0;
}

.thought-action::after {
  content: "展开";
}

.thought-card[open] .thought-action::after {
  content: "收起";
}

.thought-content {
  border-top: 1px solid rgba(91, 107, 105, 0.16);
  padding: 11px 14px 13px;
  font-size: 13px;
  line-height: 1.6;
}

.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;
}

.hide-thoughts .message.thought {
  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;
}

.processing-status {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(14, 130, 116, 0.2);
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(221, 240, 235, 0.92), rgba(239, 247, 244, 0.78));
  color: #0a6d62;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

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

.quota-notice {
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(178, 77, 42, 0.24);
  border-radius: 6px;
  background: rgba(255, 233, 227, 0.9);
  color: var(--warning);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.quota-notice[hidden] {
  display: none;
}

.processing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.processing-dots i {
  width: 5px;
  height: 5px;
  display: block;
  border-radius: 50%;
  background: currentColor;
  animation: processing-dot 1.05s ease-in-out infinite;
}

.processing-dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.processing-dots i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes processing-dot {
  0%,
  60%,
  100% {
    opacity: 0.38;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.composer-toolbar {
  min-height: 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  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;
}

.composer textarea:disabled {
  background: #f1eee7;
  color: var(--muted);
}

.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;
}

.about-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: #171c22;
  color: #f8f3e8;
}

html:has(.about-page) {
  overflow-x: clip;
}

.about-topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 22, 28, 0.64);
  backdrop-filter: blur(16px);
}

.about-topbar-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
}

.about-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 14px;
}

.about-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.about-nav .about-nav-primary {
  border-color: #ee7c3b;
  background: #ee7c3b;
  color: #171c22;
  font-weight: 750;
}

.about-hero {
  width: min(1180px, calc(100% - 40px));
  min-height: 760px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(36px, 7vw, 100px);
  position: relative;
  margin: 0 auto;
  padding: 134px 0 76px;
}

.about-hero::before {
  content: "";
  width: 720px;
  height: 720px;
  position: absolute;
  top: -250px;
  left: -360px;
  border: 1px solid rgba(61, 224, 207, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 0 100px rgba(61, 224, 207, 0.025),
    0 0 0 210px rgba(61, 224, 207, 0.018);
  pointer-events: none;
}

.about-hero-copy {
  position: relative;
  z-index: 2;
  animation: about-rise 680ms ease-out both;
}

.about-kicker {
  margin: 0 0 16px;
  color: #72dacd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.about-hero h1 {
  max-width: 720px;
  margin: 0;
  color: #fffaf0;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(48px, 6.6vw, 84px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.about-lead {
  max-width: 650px;
  margin: 26px 0 0;
  color: #b9c3c8;
  font-size: 17px;
  line-height: 1.85;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.about-action-primary,
.about-action-secondary {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 19px;
  font-size: 14px;
  font-weight: 750;
}

.about-action-primary {
  background: #ee7c3b;
  color: #171c22;
}

.about-action-secondary {
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fffaf0;
}

.about-action-primary:hover,
.about-action-secondary:hover {
  transform: translateY(-2px);
}

.about-mission-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 48px 0 0;
  background: rgba(255, 255, 255, 0.12);
}

.about-mission-stats div {
  min-width: 0;
  background: #171c22;
  padding: 14px 14px 14px 0;
}

.about-mission-stats dt {
  color: #ee7c3b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.about-mission-stats dd {
  margin: 4px 0 0;
  color: #9caaaf;
  font-size: 12px;
  line-height: 1.45;
}

.about-emblem {
  width: min(100%, 510px);
  aspect-ratio: 1;
  position: relative;
  margin: 0;
  animation: about-rise 800ms 100ms ease-out both;
}

.about-emblem::before {
  content: "";
  position: absolute;
  inset: 9%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(48, 163, 190, 0.24);
  filter: blur(50px);
}

.about-emblem img {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48);
  object-fit: cover;
}

.about-orbit {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(114, 218, 205, 0.42);
  border-radius: 50%;
  pointer-events: none;
}

.about-orbit::after {
  content: "";
  width: 9px;
  height: 9px;
  position: absolute;
  top: 50%;
  left: -5px;
  border-radius: 50%;
  background: #ee7c3b;
  box-shadow: 0 0 18px #ee7c3b;
}

.about-orbit-one {
  inset: -5%;
  transform: rotate(-18deg);
}

.about-orbit-two {
  inset: -11%;
  border-color: rgba(255, 255, 255, 0.13);
  transform: rotate(42deg);
}

.about-orbit-two::after {
  width: 5px;
  height: 5px;
  left: auto;
  right: -3px;
  background: #72dacd;
  box-shadow: 0 0 15px #72dacd;
}

.about-emblem figcaption {
  min-width: 230px;
  position: absolute;
  right: -28px;
  bottom: 4%;
  z-index: 3;
  border-left: 3px solid #ee7c3b;
  background: rgba(17, 22, 28, 0.88);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  padding: 12px 15px;
  backdrop-filter: blur(12px);
}

.about-emblem figcaption span,
.about-emblem figcaption strong {
  display: block;
}

.about-emblem figcaption span {
  color: #72dacd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.about-emblem figcaption strong {
  margin-top: 5px;
  color: #fffaf0;
  font-size: 12px;
}

.about-capabilities {
  background:
    linear-gradient(90deg, rgba(21, 23, 26, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 23, 26, 0.05) 1px, transparent 1px),
    #f3f0e9;
  background-size: 34px 34px;
  color: var(--ink);
  padding: 96px max(20px, calc((100vw - 1180px) / 2));
}

.about-section-heading {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  align-items: start;
  gap: 40px;
  margin-bottom: 46px;
}

.about-section-heading .about-kicker {
  color: var(--accent-strong);
}

.about-section-heading h2,
.about-principles h2 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.about-capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.about-capability-grid article {
  min-height: 260px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: rgba(255, 253, 250, 0.68);
  padding: 22px;
  transition: background 180ms ease, transform 180ms ease;
}

.about-capability-grid article:hover {
  background: #fffdfa;
  transform: translateY(-5px);
}

.about-card-index {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.about-capability-grid h3 {
  margin: 72px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.about-capability-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.about-principles {
  width: min(1180px, calc(100% - 40px));
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(40px, 9vw, 130px);
  margin: 0 auto;
  padding: 104px 0;
}

.about-principles ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-principles li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding: 21px 0;
}

.about-principles li:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.about-principles strong {
  color: #ee7c3b;
  font-family: Georgia, "Songti SC", serif;
  font-size: 19px;
}

.about-principles span {
  color: #aab5ba;
  line-height: 1.7;
}

.about-footer {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #87949a;
  padding: 20px max(20px, calc((100vw - 1180px) / 2));
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-footer a {
  color: #72dacd;
  font-weight: 800;
}

@keyframes about-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-hero-copy,
  .about-emblem {
    animation: none;
  }

  .about-action-primary,
  .about-action-secondary,
  .about-capability-grid article {
    transition: none;
  }
}

.admin-page {
  min-height: 100vh;
  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),
    #f2efe8;
  background-size: 34px 34px;
}

.admin-topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line-dark);
  background: rgba(32, 37, 42, 0.96);
  color: #f7f3ea;
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
}

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

.admin-identity {
  max-width: 260px;
  overflow: hidden;
  color: #c5d0cf;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chat-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0 14px;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 72px;
}

.admin-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.admin-intro h1 {
  margin: 4px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 0.98;
}

.admin-intro p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-count {
  min-width: 134px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 16px 20px;
  box-shadow: 8px 8px 0 rgba(21, 23, 26, 0.08);
}

.admin-count strong,
.admin-count span {
  display: block;
}

.admin-count strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1;
}

.admin-count span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-feedback {
  margin-bottom: 18px;
  border: 1px solid rgba(14, 130, 116, 0.25);
  border-radius: 6px;
  background: var(--user);
  color: var(--accent-strong);
  padding: 11px 14px;
}

.admin-feedback.is-error {
  border-color: rgba(178, 77, 42, 0.25);
  background: var(--error);
  color: var(--warning);
}

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

.user-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
  border-radius: 6px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 14px 36px rgba(27, 31, 35, 0.09);
  padding: 20px;
}

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

.user-card-head h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 18px;
}

.user-card-head p,
.user-danger-zone p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.user-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 5px;
}

.user-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.user-badge.is-active {
  border-color: rgba(14, 130, 116, 0.25);
  background: var(--user);
  color: var(--accent-strong);
}

.user-badge.is-disabled {
  background: #ebe9e3;
  color: var(--muted);
}

.user-badge.is-admin {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0;
  border-block: 1px solid var(--line);
  color: var(--muted);
  padding: 11px 0;
  font-size: 12px;
}

.user-settings-form,
.user-password-form {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.admin-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.admin-field input {
  width: 100%;
  height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.admin-field input[type="checkbox"] {
  width: 40px;
  accent-color: var(--accent);
}

.user-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  border-top: 1px dashed rgba(178, 77, 42, 0.35);
  padding-top: 14px;
}

.user-danger-zone p {
  margin: 0;
}

@media (max-width: 980px) {
  .about-hero {
    grid-template-columns: 1fr;
    padding-bottom: 96px;
  }

  .about-hero-copy {
    max-width: 760px;
  }

  .about-emblem {
    width: min(82vw, 540px);
    justify-self: center;
  }

  .about-section-heading,
  .about-principles {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 640px) {
  .about-topbar-inner {
    width: min(100% - 24px, 1180px);
    min-height: 64px;
  }

  .about-nav a {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .about-nav a:first-child {
    display: none;
  }

  .about-hero {
    width: min(100% - 28px, 1180px);
    min-height: auto;
    gap: 58px;
    padding: 110px 0 74px;
  }

  .about-hero h1 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .about-lead {
    font-size: 15px;
  }

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

  .about-mission-stats {
    grid-template-columns: 1fr;
  }

  .about-mission-stats div {
    padding: 12px 0;
  }

  .about-emblem {
    width: min(82vw, 390px);
  }

  .about-emblem figcaption {
    min-width: 0;
    right: -8px;
    bottom: -12px;
  }

  .about-capabilities {
    padding: 72px 14px;
  }

  .about-section-heading {
    gap: 12px;
    margin-bottom: 32px;
  }

  .about-section-heading h2,
  .about-principles h2 {
    font-size: 39px;
  }

  .about-capability-grid {
    grid-template-columns: 1fr;
  }

  .about-capability-grid article {
    min-height: 210px;
  }

  .about-capability-grid h3 {
    margin-top: 44px;
  }

  .about-principles {
    width: min(100% - 28px, 1180px);
    gap: 34px;
    padding: 74px 0;
  }

  .about-principles li {
    grid-template-columns: 74px 1fr;
    gap: 14px;
  }

  .about-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-panel {
    padding: 26px 22px;
  }

  .login-copy {
    margin-top: 34px;
  }

  .login-copy h1 {
    font-size: 32px;
  }

  .admin-topbar {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .admin-topbar-actions {
    gap: 6px;
  }

  .admin-identity {
    display: none;
  }

  .admin-chat-link,
  .admin-topbar button {
    min-height: 42px;
    padding: 0 10px;
    font-size: 13px;
  }

  .admin-shell {
    width: min(100% - 20px, 1180px);
    padding: 28px 0 48px;
  }

  .admin-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-count {
    width: 100%;
    min-width: 92px;
    padding: 12px;
  }

  .admin-count strong {
    font-size: 34px;
  }

  .user-card {
    padding: 16px;
  }

  .user-card-head {
    display: grid;
  }

  .user-badges {
    justify-content: start;
  }

  .user-settings-form,
  .user-password-form {
    grid-template-columns: 1fr 1fr;
  }

  .user-settings-form button,
  .user-password-form button {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .user-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
}

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

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

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

  button {
    touch-action: manipulation;
  }

  .workspace {
    width: var(--app-width, 100%);
    max-width: var(--app-width, 100vw);
    min-height: 0;
    height: var(--app-height, 100dvh);
    max-height: var(--app-height, 100dvh);
    position: fixed;
    inset: auto;
    top: var(--app-top, 0px);
    left: var(--app-left, 0px);
    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%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    min-width: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .chat-head {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: calc(54px + env(safe-area-inset-top));
    position: sticky;
    top: 0;
    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: max(8px, env(safe-area-inset-top)) 8px 8px;
    overflow: hidden;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

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

  .mobile-session-toggle {
    min-width: 68px;
    min-height: 38px;
    display: inline-grid;
    grid-template-columns: 15px auto auto;
    align-items: center;
    flex-shrink: 0;
    gap: 5px;
    border-color: rgba(14, 130, 116, 0.2);
    border-radius: 14px;
    background: #dfeee9;
    color: #0a6d62;
    padding: 0 7px;
    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;
    overflow: hidden;
  }

  .eyebrow {
    display: none;
  }

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

  .chat-actions {
    min-width: 0;
    gap: 5px;
  }

  .chat-actions button,
  .mobile-only-action {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    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 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    gap: 14px;
    overflow-x: clip;
    overflow-y: auto;
    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: 12px 8px 14px;
    scroll-padding-block: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .message {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    gap: 5px;
    overflow: hidden;
  }

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

  .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 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    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;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .message-body > *,
  .tool-card,
  .tool-card summary,
  .tool-detail-block,
  .table-wrap,
  .message-body pre {
    max-width: 100%;
    min-width: 0;
  }

  .message-body p,
  .message-body li,
  .message-body blockquote,
  .message-body h1,
  .message-body h2,
  .message-body h3,
  .tool-card-meta,
  .tool-empty {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .message-body code:not(pre code) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .tool-event,
  .tool-card summary::after {
    flex-shrink: 0;
  }

  .message-body pre,
  .message-body .tool-detail-json,
  .message-body .tool-detail-code,
  .table-wrap {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

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

  .message.thought .message-body {
    border-left-color: rgba(91, 107, 105, 0.42);
    background: rgba(242, 245, 243, 0.94);
  }

  .thought-card summary {
    padding: 10px 12px;
  }

  .thought-content {
    padding: 10px 12px 12px;
    font-size: 12.5px;
  }

  .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 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    position: relative;
    z-index: 12;
    gap: 4px;
    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: 6px 8px 8px;
    overflow: visible;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .composer-toolbar {
    min-width: 0;
    min-height: 20px;
    justify-content: flex-start;
  }

  .processing-status {
    min-height: 28px;
    border-radius: 12px;
    padding: 4px 9px;
    font-size: 11px;
  }

  .quota-notice {
    min-height: 28px;
    border-radius: 12px;
    padding: 4px 9px;
    font-size: 11px;
  }

  .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 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 6px;
  }

  .composer-input-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .composer textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    max-height: 104px;
    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: 12px 13px;
    resize: none;
    font-size: 16px;
  }

  .send {
    width: 56px;
    min-width: 56px;
    min-height: 48px;
    border-radius: 16px;
    padding: 0 6px;
    font-size: 14px;
    font-weight: 750;
  }

  .skill-picker {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 42dvh;
    border-radius: 16px;
  }

  .message-body table {
    min-width: min(360px, calc(100vw - 44px));
    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: 64px;
    padding-right: 6px;
    padding-left: 6px;
  }

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

  .eyebrow {
    display: none;
  }

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

@media (max-width: 820px) and (display-mode: standalone) {
  .composer {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

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

  .processing-dots i {
    animation: none;
  }
}
