:root {
  --ink: #162033;
  --ink-soft: #5d6879;
  --navy: #10233f;
  --navy-deep: #09182d;
  --teal: #087f74;
  --teal-bright: #19a997;
  --teal-pale: #e6f5f1;
  --paper: #f3f5f7;
  --surface: #ffffff;
  --line: #dde3e9;
  --line-dark: rgba(255, 255, 255, 0.12);
  --danger: #b53c35;
  --warning: #a56711;
  --shadow: 0 18px 48px rgba(20, 34, 54, 0.09);
  --radius: 14px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 90% 0%, rgba(8, 127, 116, 0.06), transparent 32rem),
    var(--paper);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 18px;
  color: #74c9bd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.eyebrow-dark {
  color: var(--teal);
}

.muted {
  color: var(--ink-soft);
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  background: var(--navy);
}

.login-brand {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(48px, 8vw, 128px);
  color: #f7fafc;
  background:
    linear-gradient(140deg, rgba(13, 52, 78, 0.28), rgba(4, 24, 44, 0.76)),
    repeating-linear-gradient(
      118deg,
      transparent 0,
      transparent 48px,
      rgba(255, 255, 255, 0.034) 49px,
      rgba(255, 255, 255, 0.034) 50px
    ),
    var(--navy-deep);
  position: relative;
}

.login-brand::after {
  position: absolute;
  right: -140px;
  bottom: -180px;
  width: 500px;
  height: 500px;
  border: 1px solid rgba(48, 183, 164, 0.24);
  border-radius: 50%;
  box-shadow:
    0 0 0 82px rgba(48, 183, 164, 0.035),
    0 0 0 164px rgba(48, 183, 164, 0.025);
  content: "";
}

.brand-mark {
  display: grid;
  width: 74px;
  height: 74px;
  margin-bottom: clamp(56px, 9vh, 106px);
  place-items: center;
  border: 1px solid rgba(126, 216, 202, 0.58);
  color: #b8eee5;
  font-family: Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.login-brand h1 {
  max-width: 720px;
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(40px, 5.3vw, 78px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.18;
}

.login-lead {
  max-width: 610px;
  margin: 34px 0 0;
  color: rgba(238, 246, 249, 0.68);
  font-size: 16px;
  line-height: 1.9;
}

.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 48px;
}

.login-points span {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  padding: 48px;
  place-items: center;
  background:
    radial-gradient(circle at 100% 0%, rgba(8, 127, 116, 0.09), transparent 25rem),
    #f5f7f8;
}

.password-view {
  display: grid;
  min-height: 100vh;
  padding: 32px 20px;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(8, 127, 116, 0.08), transparent 35%),
    var(--navy);
}

.policy-view {
  display: grid;
  min-height: 100vh;
  padding: 32px 20px;
  place-items: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(8, 127, 116, 0.12), transparent 30rem),
    var(--navy);
}

.policy-card {
  width: min(760px, 100%);
  border-radius: 18px;
  padding: clamp(26px, 5vw, 50px);
  background: #fff;
  box-shadow: 0 30px 80px rgba(9, 24, 45, 0.26);
}

.policy-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.policy-heading h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(25px, 4vw, 34px);
}

.policy-heading .muted {
  margin: 9px 0 0;
  font-size: 11px;
}

.policy-mark {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  margin: 0;
  border-color: rgba(8, 127, 116, 0.3);
  color: var(--teal);
  font-size: 14px;
}

.policy-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 20px;
}

.policy-body section {
  border: 1px solid #e7ecef;
  border-radius: 10px;
  padding: 15px;
  background: #fafbfc;
}

.policy-body section:last-child {
  grid-column: 1 / -1;
}

.policy-body h3 {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 12px;
}

.policy-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
}

.policy-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.7;
}

.policy-check input {
  margin-top: 3px;
  accent-color: var(--teal);
}

.password-card {
  background: #fff;
}

.password-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.text-button-dark {
  color: var(--ink-soft);
  font-size: 12px;
}

.text-button-dark:hover {
  color: var(--teal);
}

.login-register-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  text-align: center;
}

.login-card {
  width: min(420px, 100%);
  padding: 44px;
  border: 1px solid rgba(26, 48, 72, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 80px rgba(20, 35, 56, 0.12);
}

.login-card h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 31px;
}

.login-card > .muted {
  margin: 10px 0 34px;
  font-size: 14px;
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field > span {
  display: block;
  margin-bottom: 8px;
  color: #334258;
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea,
.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input,
.field select {
  height: 46px;
  padding: 0 13px;
}

.field textarea,
.composer textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.composer textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 127, 116, 0.11);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  padding: 0 17px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button-primary {
  background: var(--teal);
  color: white;
}

.button-primary:hover {
  background: #066d64;
}

.button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.button-quiet {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.button-small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.button-wide {
  width: 100%;
}

.form-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.login-note {
  margin: 26px 0 0;
  color: #8a94a3;
  font-size: 11px;
  line-height: 1.7;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(16, 35, 63, 0.96), rgba(9, 24, 45, 0.99)),
    var(--navy);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark-small {
  width: 40px;
  height: 40px;
  margin: 0;
  border-color: rgba(125, 217, 203, 0.38);
  font-size: 13px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.sidebar-brand span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 58px;
}

.nav-item {
  display: flex;
  height: 46px;
  align-items: center;
  gap: 13px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.nav-item:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.045);
}

.nav-item.is-active {
  background: rgba(43, 176, 157, 0.13);
  color: #bcece5;
}

.nav-index {
  color: rgba(255, 255, 255, 0.25);
  font-family: Georgia, serif;
  font-size: 10px;
}

.nav-item.is-active .nav-index {
  color: #65c7b9;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line-dark);
  padding: 20px 6px 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: #d9efe9;
  color: #116b62;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-user strong {
  max-width: 130px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.text-button:hover {
  color: #fff;
}

.sidebar-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-overlay {
  display: none;
}

.main-area {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(24px, 4vw, 56px);
  border-bottom: 1px solid rgba(19, 40, 64, 0.08);
  background: rgba(243, 245, 247, 0.86);
  backdrop-filter: blur(18px);
}

.topbar-kicker {
  margin: 0 0 5px;
  color: var(--teal);
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.19em;
}

.topbar h1 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 29px;
  font-weight: 600;
}

.topbar-usage {
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: right;
}

.topbar-usage > div > span,
.topbar-usage > div > strong {
  display: block;
}

.topbar-usage > div > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.topbar-usage > div > strong {
  margin-top: 4px;
  font-family: Georgia, serif;
  font-size: 15px;
}

.status-badge {
  border-radius: 99px;
  padding: 6px 10px;
  background: #fff1d7;
  color: var(--warning);
  font-size: 10px;
  font-weight: 600;
}

.menu-button {
  display: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.view-content {
  width: min(1480px, 100%);
  padding: clamp(24px, 4vw, 52px);
}

.loading-state,
.empty-state {
  padding: 52px 28px;
  border: 1px dashed #cdd5dd;
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-align: center;
}

.loading-state {
  border: 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 23px;
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

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

.stat-card {
  min-height: 142px;
  padding: 22px;
  border: 1px solid rgba(20, 41, 64, 0.08);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 9px 28px rgba(17, 36, 58, 0.035);
}

.stat-card.is-dark {
  color: #f5f9fa;
  background:
    linear-gradient(145deg, rgba(14, 54, 71, 0.38), transparent),
    var(--navy);
}

.stat-label {
  color: var(--ink-soft);
  font-size: 11px;
}

.stat-card.is-dark .stat-label {
  color: rgba(255, 255, 255, 0.48);
}

.stat-value {
  margin: 19px 0 12px;
  font-family: Georgia, serif;
  font-size: clamp(27px, 3vw, 39px);
  letter-spacing: -0.03em;
}

.stat-meta {
  color: #8b95a3;
  font-size: 10px;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 99px;
  background: rgba(147, 160, 174, 0.17);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--teal-bright);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  border: 1px solid rgba(20, 41, 64, 0.08);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 9px 28px rgba(17, 36, 58, 0.035);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #edf0f3;
}

.panel-heading h3 {
  margin: 0;
  font-size: 15px;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.panel-body {
  padding: 22px;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
  background: #fafbfc;
}

.quick-card strong,
.quick-card span {
  display: block;
}

.quick-card strong {
  font-size: 13px;
}

.quick-card span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f2f5;
  font-size: 12px;
}

.category-row:last-child {
  border-bottom: 0;
}

.category-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf1f3;
}

.category-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #43ad9d;
}

.category-row > span:last-child {
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 11px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #f0f2f5;
}

.list-row:last-child {
  border-bottom: 0;
}

.list-main {
  min-width: 0;
}

.list-main strong,
.list-main span {
  display: block;
}

.list-main strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-main span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.status {
  flex: 0 0 auto;
  border-radius: 99px;
  padding: 5px 9px;
  background: #eef2f5;
  color: #687587;
  font-size: 9px;
  font-weight: 600;
}

.status.is-open {
  background: #e9f4ff;
  color: #2c6c98;
}

.status.is-completed {
  background: var(--teal-pale);
  color: var(--teal);
}

.ai-workspace,
.channel-workspace,
.admin-layout {
  display: grid;
  min-height: calc(100vh - 204px);
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(20, 41, 64, 0.08);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-workspace {
  display: grid;
  min-height: calc(100vh - 204px);
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(20, 41, 64, 0.08);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-sidebar {
  border-right: 1px solid #eaeef2;
  background: #fafbfc;
}

.project-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px 15px;
  border-bottom: 1px solid #edf0f3;
}

.project-header h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 24px;
}

.project-header p:last-child {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.project-progress {
  min-width: 90px;
  text-align: right;
}

.project-progress strong,
.project-progress span {
  display: block;
}

.project-progress strong {
  font-family: Georgia, serif;
  font-size: 24px;
}

.project-progress span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.project-members {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 11px 24px;
  border-bottom: 1px solid #edf0f3;
  background: #fcfdfd;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e3e8ec;
  border-radius: 99px;
  padding: 3px 9px 3px 3px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
}

.member-chip.is-owner {
  border-color: #bee1d9;
  color: var(--teal);
}

.member-chip .avatar {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  font-size: 9px;
}

.project-members select {
  height: 30px;
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 7px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
}

.project-work-area {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.project-threads {
  min-width: 0;
  border-right: 1px solid #eaeef2;
  background: #fff;
}

.project-thread-list {
  max-height: calc(100vh - 300px);
  overflow: auto;
  padding: 9px;
}

.project-thread-empty {
  padding: 30px 12px;
  color: #8b95a3;
  font-size: 10px;
  text-align: center;
}

.project-chat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #fff;
}

.project-chat .messages {
  min-height: 360px;
}

.project-empty-chat {
  flex: 1;
}

.project-empty-main {
  display: grid;
  min-height: 560px;
  padding: 40px;
  place-items: center;
  text-align: center;
}

.project-empty-main > div {
  max-width: 560px;
}

.project-empty-main h2 {
  margin: 8px 0 14px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 32px;
}

.project-empty-main p:not(.topbar-kicker) {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.9;
}

.project-empty-list {
  padding: 24px 12px;
  text-align: center;
}

.project-empty-list p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 11px;
}

.model-badge {
  border: 1px solid #e1e1e3;
  border-radius: 99px;
  padding: 5px 9px;
  color: #6b6c70;
  font-size: 9px;
}

.empty-model-note {
  margin-top: 18px !important;
  color: #9a9a9f !important;
  font-size: 9px !important;
}

.workspace-sidebar {
  border-right: 1px solid #eaeef2;
  background: #fafbfc;
}

.workspace-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid #eaeef2;
}

.workspace-sidebar-head strong {
  font-size: 13px;
}

.conversation-list {
  max-height: calc(100vh - 294px);
  overflow: auto;
  padding: 9px;
}

.conversation-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.conversation-item:hover {
  background: #f0f3f5;
}

.conversation-item.is-active {
  background: #eaf4f1;
}

.conversation-item strong,
.conversation-item span {
  display: block;
}

.conversation-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item span {
  margin-top: 6px;
  color: #8a94a3;
  font-size: 9px;
}

.chat-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.chat-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid #eaeef2;
}

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

.chat-header .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chat-header h2 {
  overflow: hidden;
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

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

.messages {
  min-height: 320px;
  overflow: auto;
  flex: 1;
  padding: 24px clamp(18px, 4vw, 48px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.93)),
    repeating-linear-gradient(0deg, transparent, transparent 31px, #edf0f2 32px);
}

.empty-chat {
  display: grid;
  min-height: 380px;
  place-items: center;
  color: var(--ink-soft);
  text-align: center;
}

.empty-chat h2 {
  margin: 0;
  color: var(--ink);
  font-family: "STSong", "Songti SC", serif;
  font-size: 28px;
}

.empty-chat p {
  max-width: 440px;
  margin: 13px auto 0;
  font-size: 12px;
  line-height: 1.8;
}

.prompt-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.prompt-examples button {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 11px;
  background: white;
  color: var(--ink-soft);
  font-size: 10px;
}

.message {
  display: grid;
  max-width: 820px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  margin-bottom: 24px;
}

.message-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #e9edf1;
  color: #5f6b7b;
  font-size: 9px;
  font-weight: 700;
}

.message.is-assistant .message-avatar {
  background: var(--navy);
  color: #9ee3d8;
}

.message-meta {
  margin-bottom: 7px;
  color: #8b95a3;
  font-size: 9px;
}

.message-content {
  padding: 13px 15px;
  border: 1px solid #e8edf1;
  border-radius: 0 11px 11px;
  background: #f8fafb;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  border: 1px solid #dce6e3;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f7fbfa;
}

.message-file-icon {
  display: grid;
  width: 32px;
  height: 36px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid #cfe2dd;
  border-radius: 6px;
  background: #fff;
  color: var(--teal);
  font-family: Georgia, serif;
  font-weight: 700;
}

.message-file > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.message-file strong,
.message-file span {
  display: block;
}

.message-file strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-file span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.message.is-user .message-content {
  border-color: #dce9e6;
  background: #f2f9f7;
}

.message.is-assistant .message-content {
  white-space: normal;
}

.message.is-assistant .message-content p {
  margin: 0 0 10px;
}

.message.is-assistant .message-content p:last-child {
  margin-bottom: 0;
}

.message.is-assistant .message-content h3,
.message.is-assistant .message-content h4,
.message.is-assistant .message-content h5 {
  margin: 18px 0 8px;
  font-size: 16px;
  line-height: 1.4;
}

.message.is-assistant .message-content ul,
.message.is-assistant .message-content ol {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.message.is-assistant .message-content li {
  margin: 5px 0;
}

.message.is-assistant .message-content code {
  border-radius: 4px;
  padding: 2px 5px;
  background: #f0f0f2;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.message.is-assistant .message-content pre {
  overflow-x: auto;
  margin: 12px 0;
  border-radius: 12px;
  padding: 13px 15px;
  background: #171717;
  color: #f4f4f5;
}

.message.is-assistant .message-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.composer {
  padding: 15px 22px 19px;
  border-top: 1px solid #eaeef2;
  background: #fff;
}

.composer textarea {
  min-height: 76px;
  max-height: 220px;
}

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

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.composer-hint {
  color: #939caa;
  font-size: 9px;
}

.channel-workspace {
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
}

.channel-list {
  padding: 10px;
}

.channel-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 12px 13px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.channel-item:hover {
  background: #eff2f4;
}

.channel-item.is-active {
  background: #eaf4f1;
}

.channel-item strong,
.channel-item span {
  display: block;
}

.channel-item strong {
  font-size: 12px;
}

.channel-item span {
  overflow: hidden;
  margin-top: 5px;
  color: #8a94a3;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-message {
  display: grid;
  max-width: 820px;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.channel-message .message-content {
  background: white;
}

.channel-message.is-ai .message-content {
  border-color: #d6e9e5;
  background: #f5faf8;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.check-field input {
  accent-color: var(--teal);
}

.records-grid {
  display: grid;
  gap: 18px;
}

.file-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(330px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.file-create-panel {
  position: sticky;
  top: 20px;
}

.file-create-panel textarea {
  min-height: 150px;
}

.file-upload-field input[type="file"] {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  background: #fafbfc;
  color: var(--ink-soft);
  font-size: 11px;
}

.file-form-note {
  margin: -5px 0 18px;
  color: #8b95a3;
  font-size: 9px;
  line-height: 1.7;
}

.file-list {
  padding: 0 20px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #edf0f3;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-kind {
  display: grid;
  width: 36px;
  height: 42px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid #dce3e8;
  border-radius: 7px;
  background: #f5f8f9;
  color: var(--teal);
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 700;
}

.file-main {
  min-width: 0;
  flex: 1;
}

.file-main strong,
.file-main span {
  display: block;
}

.file-main strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-main span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.file-main .file-error {
  color: var(--danger);
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #eef1f4;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: #7f8a99;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.table-person {
  display: flex;
  align-items: center;
  gap: 9px;
}

.table-person .avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 10px;
}

.table-person strong,
.table-person span {
  display: block;
}

.table-person strong {
  font-size: 11px;
}

.table-person span {
  margin-top: 3px;
  color: #8c96a4;
  font-size: 9px;
}

.admin-layout {
  display: block;
  min-height: auto;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

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

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: #fff;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
}

.segmented button.is-active {
  background: var(--navy);
  color: #fff;
}

.chart {
  display: flex;
  height: 160px;
  align-items: flex-end;
  gap: 5px;
  padding: 22px;
}

.chart-bar {
  position: relative;
  min-width: 4px;
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: #a8d7cf;
}

.chart-bar:last-child {
  background: var(--teal);
}

.chart-bar:hover::after {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  z-index: 4;
  border-radius: 5px;
  padding: 5px 7px;
  background: var(--navy);
  color: #fff;
  content: attr(data-label);
  font-size: 9px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

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

.import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.import-row input[type="file"] {
  min-height: 42px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  background: #fafbfc;
  color: var(--ink-soft);
  font-size: 11px;
}

.import-help {
  margin: 12px 0 0;
  font-size: 10px;
}

.import-result {
  margin-top: 20px;
  border-top: 1px solid #edf0f3;
  padding-top: 18px;
}

.error-list {
  margin-top: 12px;
  border-radius: 8px;
  padding: 10px 13px;
  background: #fff4f2;
  color: var(--danger);
  font-size: 10px;
}

.error-list p {
  margin: 5px 0;
}

.import-result code {
  border-radius: 5px;
  padding: 4px 6px;
  background: #edf4f2;
  color: #17695f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.invite-code-box {
  margin-top: 18px;
  border: 1px solid #b9ddd5;
  border-radius: 10px;
  padding: 14px;
  background: #f1faf7;
}

.invite-code-box > span {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
}

.invite-code-box > div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.invite-code-box code {
  flex: 1;
  border: 1px dashed #94cdc2;
  border-radius: 7px;
  padding: 9px 11px;
  background: #fff;
  color: #126b61;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
}

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

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 9px;
  padding: 12px 16px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(5, 15, 28, 0.45);
  backdrop-filter: blur(3px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(5, 15, 28, 0.48);
  backdrop-filter: blur(4px);
}

.project-modal {
  width: min(500px, 100%);
  border-radius: 16px;
  padding: 30px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(9, 24, 45, 0.26);
}

.project-modal h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 27px;
}

.project-modal > .muted {
  margin: 9px 0 24px;
  font-size: 11px;
}

.project-modal textarea {
  min-height: 90px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.drawer {
  width: min(620px, 100vw);
  height: 100%;
  overflow-y: auto;
  background: var(--paper);
  box-shadow: -24px 0 70px rgba(8, 22, 38, 0.2);
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.drawer-head h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 24px;
}

.drawer-content {
  padding: 22px 24px 40px;
}

.drawer-profile {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.drawer-profile .avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 15px;
}

.drawer-profile strong,
.drawer-profile span {
  display: block;
}

.drawer-profile strong {
  font-size: 15px;
}

.drawer-profile span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.drawer-section {
  margin-top: 18px;
  border: 1px solid rgba(20, 41, 64, 0.08);
  border-radius: var(--radius);
  padding: 18px;
  background: #fff;
}

.drawer-section h3 {
  margin: 0 0 13px;
  font-size: 13px;
}

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

.drawer-mini {
  border-radius: 8px;
  padding: 12px;
  background: #f5f7f8;
}

.drawer-mini span,
.drawer-mini strong {
  display: block;
}

.drawer-mini span {
  color: var(--ink-soft);
  font-size: 9px;
}

.drawer-mini strong {
  margin-top: 6px;
  font-family: Georgia, serif;
  font-size: 18px;
}

.drawer-event {
  padding: 9px 0;
  border-bottom: 1px solid #eef1f4;
  font-size: 10px;
}

.drawer-event:last-child {
  border-bottom: 0;
}

.drawer-event strong {
  margin-right: 8px;
}

.drawer-event span {
  color: var(--ink-soft);
}

.drawer-note {
  margin: 12px 0 0;
  color: #8993a1;
  font-size: 9px;
  line-height: 1.7;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: var(--danger);
}

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

  .dashboard-grid,
  .admin-columns,
  .file-layout {
    grid-template-columns: 1fr;
  }

  .file-create-panel {
    position: static;
  }

  .project-work-area {
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  }

  .login-view {
    grid-template-columns: 1fr 420px;
  }

  .login-brand {
    padding: 64px;
  }
}

@media (max-width: 820px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 42vh;
    padding: 38px 28px;
  }

  .brand-mark {
    margin-bottom: 34px;
  }

  .login-brand h1 {
    font-size: 38px;
  }

  .login-lead,
  .login-points {
    display: none;
  }

  .login-panel {
    min-height: 58vh;
    padding: 30px 20px;
  }

  .login-card {
    padding: 28px;
  }

  .app-view {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: 248px;
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(5, 15, 28, 0.45);
  }

  .nav-open .sidebar-overlay {
    display: block;
  }

  .menu-button {
    display: block;
  }

  .topbar {
    min-height: 82px;
    padding: 16px 20px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar-usage .status-badge {
    display: none;
  }

  .view-content {
    padding: 20px;
  }

  .ai-workspace,
  .channel-workspace,
  .project-workspace,
  .project-work-area {
    display: block;
  }

  .workspace-sidebar {
    border-right: 0;
    border-bottom: 1px solid #eaeef2;
  }

  .conversation-list,
  .channel-list,
  .project-thread-list {
    display: flex;
    max-height: 155px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .conversation-item,
  .channel-item {
    min-width: 210px;
  }

  .project-thread-list .conversation-item {
    min-width: 210px;
  }

  .project-sidebar,
  .project-threads {
    border-right: 0;
    border-bottom: 1px solid #eaeef2;
  }

  .project-members,
  .project-header {
    padding-right: 16px;
    padding-left: 16px;
  }

  .chat-header {
    padding: 12px 16px;
  }

  .messages {
    min-height: 360px;
    padding: 18px 16px;
  }

  .composer {
    padding: 13px 16px 16px;
  }
}

@media (max-width: 520px) {
  .stat-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .policy-body {
    grid-template-columns: 1fr;
  }

  .policy-body section:last-child {
    grid-column: auto;
  }

  .topbar-usage {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-header-actions .button {
    padding: 0 9px;
    font-size: 10px;
  }

  .composer-hint {
    display: none;
  }
}

/* Mainstream AI workspace */

:root {
  --ink: #202123;
  --ink-soft: #6b6c70;
  --navy: #171717;
  --navy-deep: #0d0d0d;
  --teal: #10a37f;
  --teal-bright: #19b893;
  --teal-pale: #e8f7f2;
  --paper: #f7f7f8;
  --surface: #ffffff;
  --line: #e3e3e5;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

body {
  background: var(--paper);
}

.sidebar {
  width: 100%;
  padding: 18px 14px 16px;
  background: #171717;
}

.sidebar-brand {
  padding: 2px 10px;
}

.brand-mark-small {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: #171717;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-brand strong {
  font-size: 14px;
  letter-spacing: 0;
}

.sidebar-brand span {
  margin-top: 2px;
  color: #8e8e93;
  font-size: 9px;
  letter-spacing: 0;
}

.sidebar-new-work {
  display: flex;
  width: 100%;
  height: 42px;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0 13px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  text-align: left;
}

.sidebar-new-work:hover {
  background: rgba(255, 255, 255, 0.09);
}

.sidebar-new-work span {
  font-size: 19px;
  font-weight: 300;
}

.main-nav {
  margin-top: 18px;
  gap: 2px;
}

.nav-item {
  height: 38px;
  gap: 10px;
  border-radius: 8px;
  padding: 0 11px;
  color: #c5c5c9;
  font-size: 12px;
}

.nav-item.is-active {
  background: #2b2b2b;
  color: #fff;
}

.nav-icon {
  width: 18px;
  color: #a9a9ad;
  font-size: 15px;
  text-align: center;
}

.nav-item.is-active .nav-icon {
  color: #fff;
}

.topbar {
  min-height: 68px;
  padding: 11px 28px;
  border-bottom-color: #ededee;
  background: rgba(255, 255, 255, 0.92);
}

.topbar-kicker {
  display: none;
}

.topbar h1,
.section-heading h2,
.project-header h2,
.drawer-head h2,
.panel-heading h3 {
  font-family: inherit;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 650;
}

.topbar-usage {
  gap: 10px;
}

.topbar-usage > div > strong {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

.view-content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

body[data-view="ai"] .topbar {
  min-height: 62px;
  padding: 8px 26px;
}

body[data-view="ai"] .view-content {
  max-width: none;
  height: calc(100vh - 62px);
  padding: 0;
}

body[data-view="ai"] .ai-workspace {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  grid-template-columns: 254px minmax(0, 1fr);
}

.ai-workspace .workspace-sidebar {
  background: #f4f4f5;
}

.workspace-sidebar-head {
  height: 58px;
  padding: 12px 16px;
}

.workspace-sidebar-head strong {
  font-size: 11px;
  font-weight: 600;
}

.conversation-list {
  max-height: calc(100vh - 120px);
  padding: 7px;
}

.conversation-item {
  border-radius: 9px;
  padding: 10px 12px;
}

.conversation-item strong {
  font-size: 11px;
  font-weight: 500;
}

.conversation-item span {
  margin-top: 4px;
  font-size: 8px;
}

.ai-workspace .chat-panel {
  background: #fff;
}

.chat-header {
  min-height: 58px;
  padding: 10px 24px;
  border-bottom-color: #ededee;
}

.chat-header h2 {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
}

.ai-workspace .messages {
  background: #fff;
  padding: 30px max(28px, calc((100% - 820px) / 2));
}

.empty-chat {
  min-height: 100%;
}

.empty-chat h2 {
  font-family: inherit;
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.empty-chat p {
  color: #7a7a7f;
  font-size: 13px;
}

.prompt-examples button {
  border-color: #e1e1e3;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.message {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  max-width: 820px;
}

.message.is-user {
  max-width: 76%;
  margin-left: auto;
  grid-template-columns: minmax(0, 1fr) 30px;
}

.message.is-user .message-avatar {
  order: 2;
}

.message.is-user > div:nth-child(2) {
  order: 1;
}

.message-avatar {
  border-radius: 50%;
}

.message.is-assistant .message-avatar {
  background: #171717;
}

.message-meta {
  margin-bottom: 5px;
  font-size: 9px;
}

.message.is-user .message-meta {
  text-align: right;
}

.message-content {
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.8;
}

.message.is-user .message-content {
  border: 0;
  border-radius: 20px;
  padding: 12px 16px;
  background: #f0f0f2;
}

.message-file {
  border-color: #e0e0e2;
  border-radius: 14px;
  background: #fafafa;
}

.ai-composer {
  padding: 12px max(28px, calc((100% - 820px) / 2)) 10px;
  border-top: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 18%);
}

.ai-composer textarea {
  min-height: 68px;
  max-height: 220px;
  border: 1px solid #d8d8dc;
  border-radius: 22px;
  padding: 16px 17px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  font-size: 13px;
}

.ai-composer .composer-row {
  margin-top: -35px;
  padding: 0 9px 0 12px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 8px;
}

.composer-select,
.tool-pill {
  height: 27px;
  border: 1px solid #dedee1;
  border-radius: 99px;
  padding: 0 9px;
  background: #fff;
  color: #5f6065;
  font-size: 9px;
}

.tool-pill:hover,
.composer-select:hover {
  background: #f4f4f5;
}

.send-button {
  min-width: 38px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 50%;
  padding: 0;
  background: #171717;
  font-size: 0;
}

.send-button::after {
  content: "↑";
  font-size: 18px;
  font-weight: 500;
}

.send-button:hover {
  background: #2c2c2e;
}

.ai-composer > .composer-hint {
  display: block;
  margin-top: 7px;
  text-align: center;
  font-size: 8px;
}

@media (max-width: 820px) {
  body[data-view="ai"] .view-content {
    height: auto;
  }

  body[data-view="ai"] .ai-workspace {
    height: calc(100dvh - 82px);
  }

  .ai-workspace .messages {
    padding: 22px 18px;
  }

  .ai-composer {
    padding: 10px 14px 8px;
  }
}
