:root {
  --paper: #f5f6f2;
  --surface: #fff;
  --ink: #22271f;
  --muted: #687062;
  --line: #e4e8df;
  --accent: #d2ed91;
  --rail: #f0f2eb;
  --subsurface: #fafbf8;
  --soft: #f1f4e9;
  --hover: #edf0e7;
  --action: #22271f;
  --action-text: #fff;
  --accent-ink: #22271f;
  --error: #a33b3b;
  --link: #526449;
  --focus: #658635;
  --assistant-bubble: #f1f4ec;
  --user-bubble: #e3edcf;
  color-scheme: light;
  --body-size: 18px;
  --body-leading: 1.7;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  color: inherit;
}
button {
  border: 0;
  background: none;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
}
button[aria-busy="true"] {
  cursor: progress;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  background: var(--surface);
  color: var(--ink);
}
textarea {
  resize: vertical;
  line-height: var(--body-leading);
  font-size: var(--body-size);
}
p,
.reading {
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -1.5px;
}
h2 {
  font-size: 25px;
  font-weight: 550;
}
h3 {
  font-size: 19px;
}
small,
.meta {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.initial {
  display: grid;
  place-items: center;
  height: 100dvh;
  font-size: 18px;
}
.primary {
  background: var(--action);
  color: var(--action-text);
  border-radius: 12px;
  padding: 12px 20px;
  min-height: 48px;
}
.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 16px;
  min-height: 44px;
}
.danger {
  color: var(--error);
}
.error {
  color: var(--error);
  font-size: 18px;
  line-height: 1.7;
}
.field-error {
  display: block;
  color: var(--error);
  font-size: 16px;
  line-height: 1.7;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 260px;
  padding: 40px;
  text-align: center;
}
.empty p {
  max-width: 480px;
  color: var(--muted);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.8px;
}
.brand img {
  width: 38px;
  height: 38px;
}
.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1300px;
  margin: auto;
  padding: 70px;
  align-items: center;
  gap: 100px;
}
.login-story {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.login-story h1 {
  font-size: 52px;
  line-height: 1.3;
}
.login-story .sub {
  color: var(--muted);
  max-width: 420px;
}
.login-art {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  gap: 12px;
  padding: 20px 0;
}
.login-art span {
  width: 70px;
  height: 70px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 24px;
}
.login-art span:nth-child(2) {
  background: var(--accent);
  transform: translateY(-15px);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 36px;
  border-radius: 26px;
  box-shadow: 0 18px 60px #27311a06;
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 28px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 18px;
  line-height: 1.7;
}
.login-card .primary {
  margin-top: 8px;
}
.demo {
  border-top: 1px solid var(--line);
  margin-top: 25px;
  padding-top: 20px;
}
.demo summary {
  cursor: pointer;
  line-height: 1.7;
}
.demo-list {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}
.demo-account {
  text-align: left;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.demo-account span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 80px 290px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.rail {
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 24px 8px;
  gap: 13px;
  background: var(--rail);
}
.rail img {
  width: 42px;
  height: 42px;
  margin-bottom: 26px;
}
.rail button {
  width: 62px;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--muted);
}
.rail button span {
  font-size: 21px;
  line-height: 1.2;
}
.rail button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px #00000004;
}
.rail .bottom {
  margin-top: auto;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--subsurface);
}
.enterprise {
  padding: 28px 22px 18px;
}
.enterprise h2 {
  font-size: 20px;
  margin: 10px 0 6px;
}
.enterprise .kicker {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}
.side-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 18px 18px;
}
.side-action .primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  text-align: left;
}
.side-action b {
  float: right;
  font-size: 20px;
}
.history {
  padding: 0 10px;
  overflow: auto;
  flex: 1;
}
.history-label {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}
.history button {
  display: block;
  width: 100%;
  padding: 13px 12px;
  text-align: left;
  border-radius: 12px;
  line-height: 1.6;
}
.history button.active {
  background: var(--soft);
}
.history .history-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}
.workspace {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.topbar {
  height: 88px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 20px;
}
.topbar h2 {
  font-size: 20px;
}
.topbar .subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}
.top-actions {
  display: flex;
  gap: 10px;
}
.top-actions button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
}
.panel {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.welcome {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 810px;
  min-height: 100%;
  margin: auto;
  padding: 55px 48px;
  gap: 24px;
}
.eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}
.welcome h1 {
  font-size: 38px;
  line-height: 1.4;
}
.welcome > p {
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr));
  gap: 20px;
  align-items: start;
}
.person {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 3 / 5;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #20251b12;
  border-radius: 18px;
  background: #e6e8df;
  color: #fff;
  text-align: left;
}
.person:hover,
.person:focus-visible {
  box-shadow: 0 12px 32px #242d1b18;
}
.portrait-art {
  position: relative;
  display: block;
  overflow: hidden;
  background: #e7e9e0;
}
.person > .portrait-art,
.hero-portrait {
  position: absolute;
  inset: 0;
}
.portrait-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
  transition: transform 220ms ease;
}
.portrait-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 60px;
  color: #526449;
  font:
    72px/1.6 "Songti SC",
    serif;
  background: linear-gradient(145deg, #e7eddc, #b4c8bc);
}
.person:hover img,
.person:focus-visible img {
  transform: scale(1.035);
}
.person-shade,
.hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 25%,
    #101b1220 45%,
    #0c180fee 100%
  );
}
.person-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 42px 19px 20px;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}
.person .category {
  display: block;
  color: #ffffffcc;
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}
.person .name {
  display: block;
  font:
    500 26px/1.6 "Songti SC",
    "STSong",
    serif;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}
.person .desc {
  display: block;
  font-size: var(--body-size);
  line-height: var(--body-leading);
  color: #ffffffeb;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 200ms ease,
    opacity 180ms ease;
}
.person:hover .desc,
.person:focus-visible .desc {
  max-height: 320px;
  opacity: 1;
  margin-top: 7px;
}
.person-cta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 8px;
  color: #ffffffbd;
}
.person-cta .icon {
  width: 15px;
  height: 15px;
}
.person[aria-busy="true"] {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.welcome-cards {
  width: min(100%, 468px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.mobile-history {
  display: none;
}
.top-title {
  display: flex;
  align-items: center;
}
.topbar .mobile-back {
  display: none;
}
.welcome {
  max-width: 920px;
}
.browse-people {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  padding: 0;
  min-height: 32px;
  color: var(--link);
}
.people-page {
  max-width: 1480px;
  padding: 42px 44px;
}
.people-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 30px;
}
.people-heading h1 {
  font:
    500 36px/1.6 "Songti SC",
    "STSong",
    serif;
  margin-top: 8px;
}
.people-heading p {
  color: var(--muted);
  margin-top: 8px;
}
.people-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--subsurface);
  border-radius: 14px;
  padding: 0 14px;
  min-width: 250px;
  max-width: 320px;
  width: 100%;
  color: var(--muted);
}
.people-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 13px 0;
  border-radius: 0;
  font-size: 16px;
}
.people-index {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 17px;
  font-size: 16px;
  line-height: 1.6;
  white-space: nowrap;
}
.category-tabs button[aria-pressed="true"] {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-text);
}
.category-tabs button span {
  font-size: 12px;
  opacity: 0.65;
}
.people-index > .meta {
  flex: none;
}
.people-empty {
  grid-column: 1 / -1;
}
.page {
  max-width: 1100px;
  margin: auto;
  padding: 35px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.page-heading input {
  max-width: 280px;
  width: 100%;
}
.messages {
  max-width: 860px;
  margin: auto;
  padding: 30px 40px 50px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.message {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}
.message .avatar {
  height: 34px;
  width: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--soft);
  font-size: 16px;
  margin-top: 4px;
  overflow: hidden;
}
.message .avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.message.user {
  flex-direction: row-reverse;
}
.message.user .avatar {
  background: var(--hover);
}
.message-body {
  min-width: 0;
  max-width: calc(100% - 49px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.message .who {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.bubble {
  min-width: 0;
  max-width: 100%;
  padding: 16px 20px;
  background: var(--assistant-bubble);
  border: 1px solid var(--line);
  border-radius: 5px 20px 20px 20px;
}
.message.user .message-body {
  align-items: flex-end;
  max-width: min(85%, calc(100% - 49px));
}
.message.user .bubble {
  background: var(--user-bubble);
  border-radius: 20px 5px 20px 20px;
}
.message.user .who {
  display: none;
}
.bubble .text {
  font-size: var(--body-size);
  line-height: var(--body-leading);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble .markdown {
  white-space: normal;
}
.markdown > :first-child {
  margin-top: 0;
}
.markdown > :last-child {
  margin-bottom: 0;
}
.markdown p,
.markdown ul,
.markdown ol,
.markdown blockquote,
.markdown pre,
.markdown table {
  margin: 0 0 0.75em;
}
.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  margin: 1em 0 0.4em;
  font-size: 1.12em;
  line-height: 1.6;
  font-weight: 650;
}
.markdown h1 {
  font-size: 1.3em;
}
.markdown h2 {
  font-size: 1.2em;
}
.markdown strong {
  font-weight: 650;
}
.markdown ul,
.markdown ol {
  padding-left: 1.5em;
}
.markdown li + li {
  margin-top: 0.25em;
}
.markdown li > p {
  margin-bottom: 0.3em;
}
.markdown blockquote {
  padding-left: 0.8em;
  border-left: 3px solid var(--muted);
}
.markdown a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.markdown code {
  font-family: ui-monospace, monospace;
  background: var(--hover);
  border-radius: 4px;
  padding: 0.1em 0.25em;
  overflow-wrap: anywhere;
}
.markdown pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 0.6em;
  background: var(--hover);
  border-radius: 8px;
}
.markdown pre code {
  background: none;
  padding: 0;
}
.markdown table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.markdown th,
.markdown td {
  padding: 0.35em 0.6em;
  border: 1px solid var(--line);
  text-align: left;
  min-width: 4em;
}
.markdown hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.8em 0;
}
.message .tools {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}
.message .tools button {
  font-size: 13px;
  color: var(--muted);
  padding: 7px 6px;
  min-height: 36px;
  border-radius: 8px;
}
.message .tools button:hover {
  background: var(--hover);
}
.typing {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}
.typing::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aaf78;
  margin-right: 12px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
.composer-area {
  flex-shrink: 0;
  padding: 10px 32px 20px;
  background: var(--surface);
}
.composer-wrap {
  max-width: 780px;
  margin: auto;
}
.composer {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--subsurface);
  box-shadow: 0 6px 25px #00000004;
  padding: 14px;
}
.composer textarea {
  border: 0;
  background: none;
  display: block;
  resize: none;
  width: 100%;
  min-height: 62px;
  max-height: 200px;
  padding: 3px 6px;
}
.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 0;
}
.composer-bottom .hint {
  font-size: 12px;
  color: var(--muted);
}
.send {
  height: 38px;
  min-width: 64px;
  border-radius: 12px;
  background: var(--action);
  color: var(--action-text);
  font-size: 14px;
  padding: 0 15px;
}
.privacy {
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  color: var(--muted);
  padding-top: 10px;
}
.composer-error {
  margin-bottom: 10px;
}
.list-row {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-row > button {
  text-align: left;
}
.list-row p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.review-answer {
  padding: 20px;
  background: var(--subsurface);
  border-radius: 16px;
  margin: 15px 0;
}
.review-answer pre {
  font-family: inherit;
  white-space: pre-wrap;
  font-size: 18px;
  line-height: 1.7;
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-stack textarea {
  min-height: 130px;
}
.form-stack label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.badge {
  background: var(--soft);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
  color: var(--link);
}
.mobile-back {
  display: none;
}
.notice {
  font-size: 18px;
  line-height: 1.7;
  background: var(--soft);
  padding: 18px 22px;
  border-radius: 15px;
  margin-bottom: 20px;
}
.account-line {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.member-form {
  margin-bottom: 25px;
}
.member-form input {
  width: 100%;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  max-width: min(760px, calc(100vw - 32px));
  max-height: 85dvh;
  width: 650px;
  color: var(--ink);
  background: var(--surface);
}
dialog::backdrop {
  background: #20251e55;
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.modal-head button {
  font-size: 25px;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-body pre {
  font: inherit;
  font-size: 18px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.modal-body input,
.modal-body textarea {
  width: 100%;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #22271f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.7;
  z-index: 20;
  display: none;
  max-width: 90vw;
}
#toast.visible {
  display: block;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 70px 235px minmax(0, 1fr);
  }
  .welcome {
    padding: 35px;
  }
  .welcome h1 {
    font-size: 31px;
  }
  .topbar {
    padding: 0 22px;
  }
  .login {
    padding: 40px;
    gap: 45px;
  }
  .login-story h1 {
    font-size: 42px;
  }
  .messages {
    padding: 25px;
  }
}
@media (max-width: 720px) {
  .mobile-history {
    display: block;
  }
  .topbar .mobile-back {
    display: inline-flex;
  }
  .login {
    display: block;
    padding: 30px 20px;
  }
  .login-story {
    gap: 16px;
    margin-bottom: 30px;
  }
  .login-story h1 {
    font-size: 32px;
  }
  .login-art {
    display: none;
  }
  .login-card {
    padding: 25px;
  }
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 68px;
  }
  .rail {
    grid-row: 2;
    flex-direction: row;
    padding: 0 8px;
    border-right: 0;
    border-top: 1px solid var(--line);
    justify-content: space-around;
    gap: 0;
  }
  .rail img {
    display: none;
  }
  .rail button {
    width: 58px;
    min-height: 54px;
  }
  .rail .bottom {
    margin-top: 0;
  }
  .sidebar {
    display: none;
  }
  .workspace {
    grid-row: 1;
  }
  .topbar {
    height: 76px;
    padding: 0 18px;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions button {
    padding: 8px;
  }
  .welcome {
    padding: 28px 22px;
    gap: 20px;
  }
  .welcome h1 {
    font-size: 30px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .person {
    padding: 20px;
  }
  .messages {
    padding: 22px 17px 35px;
    gap: 23px;
  }
  .message {
    gap: 10px;
  }
  .message .avatar {
    height: 30px;
    width: 30px;
    flex-basis: 30px;
    font-size: 14px;
  }
  .composer-area {
    padding: 8px 12px 12px;
  }
  .composer-bottom .hint {
    display: none;
  }
  .composer-bottom {
    justify-content: flex-end;
  }
  .privacy {
    font-size: 12px;
  }
  .page {
    padding: 24px 18px;
  }
  .page-heading {
    flex-wrap: wrap;
  }
  .top-actions .hide-mobile {
    display: none;
  }
  .shell.in-chat .rail {
    display: none;
  }
  .shell.in-chat {
    grid-template-rows: 1fr;
  }
  .mobile-back {
    display: inline-flex;
    margin-right: 10px;
  }
  .top-title {
    display: flex;
    align-items: center;
  }
  .composer {
    padding: 11px;
  }
  .message-body,
  .message.user .message-body {
    max-width: calc(100% - 40px);
  }
  .message .tools button {
    min-height: 44px;
  }
  .panel {
    overscroll-behavior: contain;
  }
  .composer textarea {
    font-size: var(--body-size);
    line-height: var(--body-leading);
  }
}

/* Shared desktop and web shell: Lucide controls and portrait-first navigation. */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: none;
  vertical-align: middle;
}
.rail button > .icon {
  width: 23px;
  height: 23px;
}
.rail button > span {
  font-size: 12px;
  line-height: 1.4;
}
button.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
}
button.icon-only > span {
  display: none;
}
.top-actions button,
.send,
.message .tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.top-actions button .icon {
  width: 17px;
  height: 17px;
}
.shell.no-sidebar {
  grid-template-columns: 80px minmax(0, 1fr);
}
.sidebar {
  padding: 0;
}
.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 16px;
  min-height: 74px;
}
.side-heading > span {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-switch {
  display: flex;
  flex: none;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}
.view-switch button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 29px;
  border-radius: 7px;
  color: var(--muted);
}
.view-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 5px #0000000a;
}
.view-switch .icon {
  width: 17px;
  height: 17px;
}
.active-person {
  position: relative;
  flex: 1;
  min-height: 180px;
  margin: 0 12px;
  border-radius: 18px;
  overflow: hidden;
  background: #d9e2d1;
  isolation: isolate;
}
.hero-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 45px 22px 24px;
  color: white;
  max-height: 70%;
  overflow: auto;
}
.hero-caption > span {
  font-size: 13px;
  line-height: 1.7;
  color: #ffffffb8;
}
.hero-caption h2 {
  font:
    500 29px/1.6 "Songti SC",
    "STSong",
    serif;
  margin: 4px 0 10px;
}
.hero-caption p {
  font-size: var(--body-size);
  line-height: var(--body-leading);
  color: #ffffffdf;
}
.side-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  min-height: 72px;
}
.side-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  padding: 12px 9px;
  font-size: 14px;
}
.side-controls button:hover {
  background: var(--hover);
}
.side-controls .icon {
  width: 18px;
  height: 18px;
}
.side-action .primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
}
.agent-history-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 20px 20px;
}
.agent-history-head > .portrait-art {
  width: 44px;
  height: 54px;
  border-radius: 9px;
  flex: none;
}
.agent-history-head h2 {
  font-size: 18px;
}
.history button.history-person {
  display: flex;
  align-items: center;
  gap: 11px;
}
.history-person > .portrait-art {
  width: 40px;
  height: 53px;
  border-radius: 9px;
  flex: none;
}
.history-person > span:not(.portrait-art) {
  min-width: 0;
  flex: 1;
}
.history-person > .icon {
  width: 14px;
  height: 14px;
  opacity: 0.45;
}
.history-empty {
  padding: 12px;
}
.history-person .portrait-fallback,
.agent-history-head .portrait-fallback {
  font-size: 22px;
  min-height: 0;
}
.account-menu {
  position: fixed;
  inset: auto auto 18px 88px;
  margin: 0;
  width: 304px;
  max-width: calc(100vw - 24px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 18px 70px #18251025,
    0 3px 12px #1825100a;
}
.account-menu::backdrop {
  background: transparent;
}
.menu-identity {
  display: flex;
  gap: 13px;
  padding: 14px 12px 18px;
  align-items: center;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border-radius: 15px;
  background: var(--soft);
  font-size: 22px;
  flex: none;
}
.menu-identity strong {
  display: block;
  font-size: 18px;
  line-height: 1.6;
}
.menu-identity div > span {
  display: block;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.menu-items {
  border-top: 1px solid var(--line);
  padding: 7px 0;
}
.menu-items button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  text-align: left;
  font-size: 16px;
}
.menu-items button:hover,
.menu-items button:focus-visible {
  background: var(--hover);
}
.menu-items button > span {
  flex: 1;
}
.menu-items button > .icon:last-child:not(:first-child) {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.menu-exit {
  padding-bottom: 0;
}
.menu-version {
  padding: 8px 12px 4px;
  font-size: 12px;
  color: var(--muted);
}
.profile-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 16px;
}
.profile-summary .account-avatar {
  width: 72px;
  height: 72px;
  font-size: 32px;
  border-radius: 22px;
}
.about-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.about-brand img {
  width: 48px;
  height: 48px;
}
@media (max-width: 1050px) {
  .shell.no-sidebar {
    grid-template-columns: 70px minmax(0, 1fr);
  }
  .people-page {
    padding: 30px;
  }
  .people-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }
  .people-search {
    max-width: 380px;
  }
  .hero-caption {
    padding: 30px 17px 20px;
  }
  .side-controls {
    flex-wrap: wrap;
  }
  .account-menu {
    left: 78px;
  }
}
@media (max-width: 720px) {
  .shell.no-sidebar {
    grid-template-columns: 1fr;
  }
  .rail button {
    flex: 1;
    min-width: 0;
    width: auto;
  }
  .rail .bottom {
    margin: 0;
  }
  .people-page {
    padding: 26px 18px;
  }
  .people-heading {
    gap: 18px;
    margin-bottom: 22px;
  }
  .people-heading h1 {
    font-size: 30px;
  }
  .people-search {
    max-width: none;
  }
  .people-index {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 20px;
  }
  .category-tabs {
    gap: 7px;
  }
  .category-tabs button {
    padding: 7px 13px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
  .person {
    padding: 0;
    border-radius: 14px;
  }
  .person-caption {
    padding: 30px 13px 16px;
  }
  .person .name {
    font-size: 23px;
  }
  .person .desc {
    font-size: var(--body-size);
    line-height: var(--body-leading);
  }
  .welcome-cards {
    width: 100%;
  }
  .welcome {
    padding: 28px 20px;
  }
  .mobile-history h3 {
    margin-bottom: 18px;
  }
  .mobile-history .cards {
    margin-bottom: 24px;
  }
  .account-menu {
    inset: auto auto 82px 12px;
  }
  .hero-caption p {
    font-size: var(--body-size);
    line-height: var(--body-leading);
  }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-art img,
  .person .desc {
    transition: none;
  }
}
@media (hover: none) {
  .person .desc {
    max-height: 92px;
    opacity: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }
}

/* Semantic appearance tokens also cover menus, form controls and native dialogs. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171b18;
  --surface: #1c211e;
  --ink: #edf1e9;
  --muted: #b0b9ac;
  --line: #3e493e;
  --rail: #151a16;
  --subsurface: #202721;
  --soft: #2b3829;
  --hover: #303a31;
  --action: #d2ed91;
  --action-text: #20271a;
  --error: #ffaaa5;
  --link: #c6dfa7;
  --focus: #d2ed91;
  --assistant-bubble: #28312a;
  --user-bubble: #35452c;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
}
.login-art span:nth-child(2) {
  color: var(--accent-ink);
}
.auto-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.7;
  white-space: nowrap;
  color: var(--muted);
  cursor: pointer;
}
.auto-read input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #6c8b40;
}
.auto-read.preference {
  font-size: 18px;
  color: var(--ink);
}
.composer-bottom .hint {
  margin-left: auto;
}
.sync-trigger[aria-busy="true"] .icon {
  animation: sync-spin 1.2s linear infinite;
}
@keyframes sync-spin {
  to {
    transform: rotate(360deg);
  }
}
#update-bubble {
  position: fixed;
  z-index: 15;
  right: 24px;
  bottom: 24px;
  width: min(360px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 60px #0004;
}
#update-bubble strong {
  font-size: 20px;
}
#update-bubble p {
  margin: 10px 0 20px;
}
#update-bubble button {
  width: 100%;
}
.desktop-app .rail {
  padding-top: 58px;
  -webkit-app-region: drag;
}
.desktop-app .rail img {
  margin-bottom: 12px;
}
.desktop-app .topbar,
.desktop-app .side-heading {
  -webkit-app-region: drag;
}
.desktop-app button,
.desktop-app input,
.desktop-app select,
.desktop-app textarea,
.desktop-app .account-menu {
  -webkit-app-region: no-drag;
}
.window-controls {
  position: fixed;
  right: 0;
  top: 0;
  display: flex;
  z-index: 30;
}
.window-controls button {
  width: 44px;
  height: 28px;
}
.window-controls button:hover {
  background: var(--hover);
}
.desktop-windows .topbar {
  padding-right: 140px;
}
@media (max-width: 720px) {
  .rail {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .rail button {
    flex-shrink: 0;
  }
  .auto-read {
    margin-right: auto;
  }
  #update-bubble {
    bottom: 82px;
    right: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 721px) and (max-height: 760px) {
  .desktop-app .rail {
    padding: 44px 8px 12px;
    gap: 4px;
  }
  .desktop-app .rail img {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
  }
  .desktop-app .rail button {
    min-height: 44px;
    gap: 3px;
  }
  .desktop-app .rail button > .icon {
    width: 20px;
    height: 20px;
  }
}

/* Cloud connections use the same semantic colors in light and dark mode. */
#connections {
  min-width: 0;
}
#connections h3 {
  margin: 24px 0 12px;
}
#connections h4 {
  font-size: var(--body-size);
  margin: 0;
}
#connections p,
#connections label,
#connections summary {
  font-size: var(--body-size);
  line-height: var(--body-leading);
  overflow-wrap: anywhere;
}
#connections a {
  color: var(--link);
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.connection-providers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.connection-provider {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--subsurface);
  border-radius: 16px;
  padding: 18px 14px;
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.connection-provider .icon:last-child {
  margin-left: auto;
  flex-shrink: 0;
}
.connection-provider:hover {
  background: var(--hover);
}
.connection-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.connection-card,
.connection-empty {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--subsurface);
  overflow-wrap: anywhere;
}
.connection-card p {
  margin: 10px 0;
}
.connection-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.connection-actions,
.connection-submit {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}
.connection-tools {
  padding-left: 24px;
}
.connection-tools strong {
  overflow-wrap: anywhere;
}
#connection-form [data-mode]:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#connection-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#connection-form input,
#connection-form select {
  min-width: 0;
  width: 100%;
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.connection-message:empty {
  display: none;
}
.connection-progress {
  color: var(--muted);
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.connection-submit {
  position: sticky;
  bottom: -28px;
  background: var(--surface);
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.disconnect-confirm {
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.connection-help {
  margin-top: 24px;
}
#connections .connection-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--action-text);
  text-decoration: none;
}
@media (max-width: 520px) {
  .connection-providers {
    grid-template-columns: 1fr;
  }
  .connection-card,
  .connection-empty {
    padding: 14px;
  }
  .top-actions [data-action="connections"] {
    font-size: 14px;
  }
}
#modal:has(#connections) .modal-head {
  position: sticky;
  top: -28px;
  z-index: 3;
  background: var(--surface);
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
#connections .field-error {
  font-size: var(--body-size);
  line-height: var(--body-leading);
}

/* Generic management: the same readable content on desktop and phones. */
.admin-page {
  max-width: 1280px;
}
.admin-heading {
  margin-bottom: 26px;
}
.admin-heading p {
  margin-top: 12px;
}
.admin-tabs,
.admin-shortcuts,
.admin-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-tabs {
  margin: 24px 0;
}
.admin-tabs [aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.admin-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  background: var(--surface);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.admin-filters label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.admin-filters input,
.admin-filters select {
  width: 100%;
  min-width: 0;
}
.admin-filters > .primary {
  align-self: end;
}
.admin-shortcuts {
  grid-column: 1 / -1;
}
.admin-note {
  color: var(--muted);
  margin: 18px 0;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.admin-stats article {
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.admin-stats span {
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.admin-stats strong {
  font-size: 30px;
}
.admin-usage {
  padding: 22px;
  background: var(--soft);
  border-radius: 18px;
}
.admin-usage p {
  margin-top: 10px;
}
.admin-result-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 28px 0 16px;
}
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.admin-row p {
  margin: 6px 0;
}
.admin-row button {
  margin-top: 10px;
}
.admin-pagination {
  margin: 24px 0;
}
.admin-prices {
  max-width: 760px;
}
.admin-prices > p,
.admin-prices form {
  margin: 18px 0 28px;
}
.admin-prices select,
.admin-prices input {
  min-width: 0;
  width: 100%;
}
.admin-price-history {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.admin-turn {
  margin: 26px 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.admin-message {
  margin: 16px 0;
  padding: 16px;
  background: var(--subsurface);
  border-radius: 12px;
}
.admin-message pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: var(--body-size);
  line-height: var(--body-leading);
  margin: 10px 0 0;
}
.admin-detail {
  overflow-wrap: anywhere;
}
.admin-detail > p {
  margin-top: 12px;
}
.admin-call {
  padding: 14px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.admin-call summary {
  cursor: pointer;
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.admin-call p {
  margin-top: 10px;
}
.admin-error {
  padding: 24px 0;
}
.admin-error button {
  margin-top: 16px;
}
.rail {
  overflow-y: auto;
  flex-shrink: 0;
}
.rail > button {
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .admin-page {
    padding: 22px 16px;
  }
  .admin-filters {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-stats article {
    padding: 14px;
  }
  .admin-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .admin-usage {
    padding: 16px;
  }
  .admin-tabs button {
    flex: 1 0 auto;
  }
  .rail {
    overflow-y: hidden;
  }
}
#modal:has(.admin-detail) .modal-head {
  position: sticky;
  top: -28px;
  z-index: 2;
  padding: 16px 0;
  background: var(--surface);
}
@media (max-width: 720px) {
  .admin-filters > .primary {
    position: sticky;
    bottom: 12px;
    z-index: 1;
    box-shadow: 0 4px 18px #0002;
  }
}
