/* 2026 UX pass: clearer hierarchy, compact navigation, and responsive polish. */
:root {
  --ux-green-950: #102c27;
  --ux-green-900: #173f37;
  --ux-green-700: #267568;
  --ux-green-100: #dcefe9;
  --ux-canvas: #e9efec;
  --ux-border: #d3ded9;
  --ux-coral: #d9614f;
}

body {
  background: var(--ux-canvas);
}

.auth-shell {
  background: var(--ux-canvas);
}

.auth-card,
.global-bar,
.left-rail,
.people-pane,
.conversation,
.detail-card {
  border-radius: 8px;
}

.auth-card {
  min-height: 600px;
  border-color: rgba(16, 44, 39, 0.16);
}

.auth-story {
  background: var(--ux-green-950);
}

.auth-story .brand-line span {
  color: rgba(255, 255, 255, 0.62);
}

.brand-mark {
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 8px;
  font-size: 17px;
  line-height: 1;
  white-space: nowrap;
}

.auth-headline h1 {
  font-size: 64px;
  line-height: 1.05;
}

.auth-panel {
  background: var(--paper-soft);
}

.segmented,
input,
textarea,
select,
.primary-btn,
.danger-btn,
.small-btn,
.person-row,
.more-card,
.hint-card,
.status-card,
.command-pill {
  border-radius: 8px;
}

.segment {
  border-radius: 6px;
}

.segment.is-active {
  background: var(--ux-green-900);
  color: #fff;
  box-shadow: none;
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 66px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 50px;
  min-height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--jade);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--ux-green-100);
  outline: none;
}

.qiyu-shell {
  grid-template-rows: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  background: var(--ux-canvas);
}

.global-bar {
  grid-template-columns: 220px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 9px 14px;
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--ux-green-950);
  box-shadow: 0 10px 28px rgba(16, 44, 39, 0.15);
}

.global-brand {
  display: flex;
  min-width: 0;
}

.global-brand .brand-mark {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.global-center {
  grid-template-columns: minmax(180px, 620px);
  justify-content: center;
}

.workspace {
  grid-template-columns: 94px 340px minmax(0, 1fr);
  gap: 10px;
}

.left-rail {
  align-content: start;
  gap: 5px;
  padding: 10px 8px;
  background: var(--ux-green-950);
  box-shadow: 0 10px 30px rgba(16, 44, 39, 0.14);
}

.tab {
  min-height: 48px;
  padding: 0 10px;
  border-radius: 6px;
}

.tab span {
  writing-mode: horizontal-tb;
  letter-spacing: 0;
}

.tab.is-active {
  background: #fff;
  color: var(--ux-green-950);
  box-shadow: none;
}

.tab-dot {
  top: 8px;
  right: 8px;
  background: var(--ux-coral);
}

.people-pane,
.conversation {
  box-shadow: 0 10px 30px rgba(30, 50, 43, 0.1);
}

:root[data-theme="light"] .people-pane {
  border-color: var(--ux-border);
  background: #fff;
  color: var(--ink);
}

:root[data-theme="light"] .people-pane .pane-heading h2,
:root[data-theme="light"] .people-pane .status-card strong,
:root[data-theme="light"] .people-pane .more-card,
:root[data-theme="light"] .people-pane .more-page-header strong {
  color: var(--ink);
}

:root[data-theme="light"] .people-pane .status-card,
:root[data-theme="light"] .people-pane .more-card,
:root[data-theme="light"] .people-pane .hint-card,
:root[data-theme="light"] .people-pane .setting-row {
  border-color: var(--ux-border);
  background: #f5f8f6;
}

:root[data-theme="light"] .people-pane .status-card span,
:root[data-theme="light"] .people-pane .more-card span,
:root[data-theme="light"] .people-pane .hint-card span,
:root[data-theme="light"] .people-pane .side-panel h3 {
  color: var(--ink-soft);
}

.status-card {
  margin: 12px;
  padding: 12px;
}

.pane-heading h2 {
  font-size: 25px;
}

.side-panel {
  padding: 0 12px 12px;
}

.empty-state {
  gap: 8px;
  padding: 24px 16px;
}

.empty-state strong {
  font-size: 18px;
}

.empty-state .small-btn {
  min-width: 128px;
  margin-top: 4px;
  background: var(--ux-green-100);
  color: var(--ux-green-900);
}

.conversation {
  border-color: var(--ux-border);
}

.conversation-header {
  min-height: 72px;
  padding: 12px 16px;
}

.messages {
  padding: 22px;
}

.toast {
  border-radius: 8px;
  background: var(--ux-green-950);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(47, 161, 132, 0.34);
  outline-offset: 2px;
}

@media (max-width: 1180px) and (min-width: 861px) {
  .global-bar {
    grid-template-columns: 190px minmax(0, 1fr) auto;
  }

  .workspace {
    grid-template-columns: 86px 310px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .auth-shell {
    align-items: start;
    padding: 12px;
  }

  .auth-card {
    min-height: 0;
    border-radius: 8px;
  }

  .auth-story {
    min-height: 168px;
    padding: 20px;
  }

  .auth-headline h1 {
    font-size: 42px;
  }

  .auth-panel {
    padding: 24px 20px 28px;
  }

  .qiyu-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 0 0 calc(72px + env(safe-area-inset-bottom));
    background: var(--paper);
  }

  .global-bar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: flex;
    flex: 0 0 62px;
    min-height: 62px;
    justify-content: space-between;
    padding: 8px 14px;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .global-brand {
    display: flex;
  }

  .global-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .global-brand span,
  .global-center,
  .global-user-profile > div:last-child,
  .global-user > .small-btn,
  .global-user > .ghost-link {
    display: none;
  }

  .global-user {
    padding: 0;
  }

  .global-user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .workspace {
    flex: 1 1 auto;
  }

  .left-rail {
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 7px calc(6px + env(safe-area-inset-bottom));
    border-radius: 0;
  }

  .tab {
    min-height: 50px;
    padding: 0 4px;
  }

  .people-pane {
    padding: 0 0 calc(74px + env(safe-area-inset-bottom));
  }

  .side-panel.is-active,
  .more-home.is-active,
  .more-page.is-active {
    padding-top: 18px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
    scroll-padding-top: 18px;
    scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .pane-heading {
    margin: 0 0 18px;
  }

  .mini-stats,
  .search-row,
  .inline-form,
  .discover-filters {
    margin-top: 0;
  }

  .search-row {
    padding-bottom: 10px;
  }

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

  .qiyu-shell.is-chat-open {
    display: grid;
    padding: 0;
  }

  .qiyu-shell.is-chat-open .conversation {
    border-radius: 0;
  }

  .qiyu-shell.is-chat-open .messages {
    padding: 18px 14px calc(22px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 460px) {
  .auth-story .brand-line span {
    display: none;
  }

  .auth-panel h2 {
    font-size: 28px;
  }

  .global-brand strong {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
