@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=JetBrains+Mono:wght@400&display=swap");

body {
  font-family: "Inter", sans-serif;
  background-color: #181818;
  color: #d4d4d8;
}

html[lang="ja-JP"] body {
  font-family: "Noto Sans JP", "Inter", sans-serif;
}

.service-status-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 48px);
  background: #181818;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-status-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.service-status-overlay-bg {
  display: none;
}

.service-status-card {
  position: relative;
  width: min(480px, calc(100vw - 36px));
  padding: 0 clamp(16px, 4vw, 40px);
  text-align: center;
}

.service-status-title {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.service-status-description {
  margin: 8px 0 0;
  color: #888888;
  font-size: 14px;
  line-height: 1.7;
}

.service-status-hint {
  margin: 12px 0 0;
  color: #777777;
  font-size: 12px;
  line-height: 1.6;
}

.service-status-dot {
  position: relative;
  width: 18px;
  height: 16px;
  margin: 0 auto 18px;
  background: #ef4444;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.service-status-dot::after {
  content: "!";
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.service-status-loading-track {
  position: relative;
  width: 160px;
  height: 1px;
  margin: 26px auto 0;
  background: #333333;
  overflow: hidden;
}

.service-status-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #666666;
  transform: translateX(-100%);
  animation: service-progress-slide 2s linear infinite;
}

@keyframes service-progress-slide {
  0%,
  15% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.header-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-left-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: block;
  padding: 0;
  background: #181818;
  backdrop-filter: none;
  animation: auth-fade-in 0.25s ease-out;
}

.auth-gate.hidden {
  display: none;
}

.auth-card {
  width: 100vw;
  min-height: 100vh;
  border: none;
  border-radius: 0;
  background: #181818;
  box-shadow: none;
  padding: clamp(28px, 5vw, 60px) clamp(16px, 4vw, 56px);
  position: relative;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: auth-card-enter 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.auth-card::after {
  content: none;
}

.auth-card-head,
.auth-tabs,
.auth-form,
.auth-divider,
.auth-oauth-actions,
.auth-message {
  width: min(351px, calc(100vw - 38px));
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.auth-card-head {
  margin-bottom: 18px;
  min-height: 120px;
  padding-top: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-title {
  margin: 0;
  color: #fafafa;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  margin: 8px 0 0;
  color: #a1a1aa;
  font-size: 12px;
  line-height: 1.5;
  max-width: 420px;
  text-align: center;
}

.auth-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.auth-tab {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 10px 10px;
  cursor: pointer;
  transition: all 0.22s ease;
}

.auth-tab.is-active {
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.auth-tab:hover {
  color: #d4d4d8;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.auth-form.is-active {
  display: flex;
  animation: auth-form-enter 0.22s ease-out;
}

.auth-field-label {
  color: #b4b4bb;
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: #e4e4e7;
  font-size: 13px;
  line-height: 1.4;
  padding: 11px 12px;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
}

.auth-turnstile-wrap {
  display: flex;
  justify-content: center;
  min-height: 66px;
  margin-top: 6px;
  overflow: hidden;
}

.auth-turnstile-wrap > div {
  width: auto;
  margin: 0 auto;
}

.auth-secondary-btn {
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.auth-secondary-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.auth-submit-btn {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #f4f4f5;
  color: #181818;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-submit-btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.25);
}

.auth-submit-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.auth-divider {
  position: relative;
  margin: 16px auto 12px;
  text-align: center;
  color: #71717a;
  font-size: 11px;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(-50%);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 10px;
  background: #181818;
}

.auth-oauth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-oauth-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: #d4d4d8;
  font-size: 12px;
  line-height: 1.2;
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-oauth-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.auth-oauth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-message {
  min-height: 22px;
  margin: 14px auto 0;
  color: #b4b4bb;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  transition: color 0.2s ease;
  text-align: center;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e4e4e7;
  box-shadow: 0 0 0 1000px #1d1d1d inset;
  transition: background-color 5000s ease-in-out 0s;
}

.auth-message.is-error {
  color: #fca5a5;
}

.auth-message.is-success {
  color: #e4e4e7;
}

.sidebar-user-wrap {
  position: relative;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user-panel {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.sidebar-user-panel:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #202020;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.sidebar-user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user-name {
  color: #f4f4f5;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  color: #8f8f95;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(15, 15, 15, 0.98);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.sidebar-user-menu.hidden {
  display: none;
}

.sidebar-user-wallet-panel {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-user-wallet-panel.hidden {
  display: none;
}

.sidebar-user-wallet-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-user-wallet-icon path {
  fill: #fbbf24;
}

.sidebar-user-wallet-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-user-wallet-title {
  color: #f4f4f5;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.sidebar-user-wallet-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sidebar-user-wallet-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sidebar-user-wallet-key {
  color: #8f8f95;
  font-size: 11px;
  line-height: 1.3;
}

.sidebar-user-wallet-value {
  color: #f4f4f5;
  font-size: 12px;
  line-height: 1.3;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
}

.sidebar-user-wallet-divider {
  color: #71717a;
  font-size: 11px;
  line-height: 1;
}

.sidebar-user-menu-item {
  width: 100%;
  text-align: left;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #d4d4d8;
  font-size: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

.sidebar-user-menu-item:first-of-type {
  border-top: none;
}

.sidebar-user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-menu-item.is-danger {
  color: #fda4af;
}

.mono {
  font-family: "JetBrains Mono", monospace;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.brand-glow {
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.session-active {
  background: rgba(255, 255, 255, 0.05);
  border-left: 2px solid #ffffff;
  color: #ffffff;
}

.chat-item {
  color: #a1a1aa;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.session-swipe-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.session-swipe-item .chat-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.session-swipe-delete {
  display: none;
  position: absolute;
  inset: 0 0 0 auto;
  width: 72px;
  border: none;
  border-radius: 0;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.chat-item .chat-item-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
}

.session-item-compact {
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.session-item-compact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.session-item-compact-icon {
  width: 14px;
  height: 14px;
  color: #8f8f95;
  flex-shrink: 0;
}

.session-active-card {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.96), rgba(25, 25, 25, 0.98));
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  min-height: 122px;
  transform-origin: top center;
  animation: session-card-expand 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chat-item-metrics {
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: session-metrics-fade 0.2s ease 0.05s both;
}

.chat-item-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-item-metric-key {
  color: #8f8f95;
  font-size: 11px;
  line-height: 1.2;
}

.chat-item-metric-value {
  color: #f4f4f5;
  font-size: 11px;
  line-height: 1.2;
  font-family: "JetBrains Mono", monospace;
}

.chat-item-storage-progress {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.chat-item-storage-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d4d4d8, #71717a);
}

.mobile-sidebar-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: #d4d4d8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-sidebar-toggle-icon {
  display: block;
}

.mobile-sidebar-toggle-text {
  display: none;
}

.mobile-sidebar-close {
  display: none;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 118;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

body.mobile-sidebar-open .mobile-sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) and (orientation: portrait) {
  body.mobile-portrait-sidebar #leftSidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 100vw;
    max-width: none;
    z-index: 120;
    border-right: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.45);
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  body.mobile-portrait-sidebar.mobile-sidebar-animating #leftSidebar {
    transition: opacity 0.24s ease;
  }

  body.mobile-portrait-sidebar.mobile-sidebar-animating .mobile-sidebar-backdrop {
    transition: opacity 0.24s ease;
  }

  body.mobile-portrait-sidebar.mobile-sidebar-open #leftSidebar {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.mobile-portrait-sidebar #mainPanel {
    width: 100%;
    min-width: 0;
  }

  body.mobile-portrait-sidebar #mobileSidebarToggle:not(.hidden) {
    display: inline-flex;
  }

  body.mobile-portrait-sidebar #mobileSidebarClose:not(.hidden) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.mobile-portrait-sidebar #leftSidebar .h-14 {
    height: 52px;
    padding-left: 16px;
    padding-right: 16px;
  }

  body.mobile-portrait-sidebar #leftSidebar .flex-1.overflow-y-auto {
    padding: 0 10px 10px;
  }

  body.mobile-portrait-sidebar #newChatBtn {
    font-size: 13px;
    padding: 10px 8px;
  }

  body.mobile-portrait-sidebar #chatList {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  body.mobile-portrait-sidebar #chatList .chat-item {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
  }

  body.mobile-portrait-sidebar #chatList .session-swipe-delete {
    display: block;
  }

  body.mobile-portrait-sidebar #chatList .chat-item-title {
    white-space: nowrap;
  }

  body.mobile-portrait-sidebar .sidebar-user-wrap {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 10, 0.35);
  }

  body.mobile-portrait-sidebar .sidebar-user-panel {
    border-radius: 12px;
    padding: 10px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
  }

  body.mobile-portrait-sidebar .sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  body.mobile-portrait-sidebar .sidebar-user-name {
    font-size: 13px;
  }

  body.mobile-portrait-sidebar .sidebar-user-email {
    font-size: 12px;
  }

  body.mobile-portrait-sidebar .sidebar-user-menu {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 10px;
    border-radius: 12px;
    border-color: rgba(255, 255, 255, 0.14);
    max-height: 48vh;
    overflow-y: auto;
  }

  body.mobile-portrait-sidebar .sidebar-user-menu-item {
    font-size: 13px;
    padding: 12px 14px;
  }
}

.chat-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

@keyframes session-card-expand {
  from {
    opacity: 0.68;
    transform: scaleY(0.9);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes session-metrics-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.right-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.right-tab {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: #71717a;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.right-tab:hover {
  color: #d4d4d8;
  border-color: rgba(255, 255, 255, 0.16);
}

.right-tab.is-active {
  color: #f4f4f5;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(71, 85, 105, 0.24);
}

.right-tab-panels {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.right-tab-panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 12px;
}

.right-tab-panel.is-active {
  display: block;
}

.file-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.file-panel-title {
  color: #f4f4f5;
  font-size: 12px;
  font-weight: 600;
}

.file-panel-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 3px 8px;
  font-size: 10px;
  line-height: 1.1;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.file-panel-status.is-loading {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(30, 64, 175, 0.32);
  color: #bfdbfe;
}

.file-panel-status.is-ready {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(6, 78, 59, 0.42);
  color: #99f6e4;
}

.file-panel-status.is-error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(127, 29, 29, 0.42);
  color: #fecaca;
}

.file-panel-status.is-idle {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(51, 65, 85, 0.24);
  color: #cbd5e1;
}

.right-file-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 120px;
}

.right-file-tree-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #a1a1aa;
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 6px 3px calc(6px + (var(--depth, 0) * 14px));
  border: none;
  border-radius: 4px;
  background: transparent;
  min-height: 22px;
}

.right-file-tree-item.is-directory {
  color: #d4d4d8;
  font-weight: 500;
  cursor: pointer;
}

.right-file-tree-item.is-file {
  color: #a1a1aa;
}

.right-file-tree-item.is-file.is-clickable {
  cursor: pointer;
}

.right-file-tree-item.is-file.is-clickable:hover {
  background: rgba(148, 163, 184, 0.1);
}

.right-file-tree-item.is-file.is-clickable:active {
  background: rgba(148, 163, 184, 0.16);
}

.right-file-tree-item.is-directory:hover,
.right-file-tree-item.is-directory:focus-visible {
  background: rgba(148, 163, 184, 0.12);
}

.right-file-tree-toggle,
.right-file-tree-toggle-placeholder {
  width: 10px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.right-file-tree-toggle {
  color: #a1a1aa;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.right-file-tree-toggle.is-expanded {
  transform: rotate(90deg);
}

.right-file-tree-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.82;
}

.right-file-tree-children {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.right-file-tree-children.is-collapsed {
  display: none;
}

.right-file-tree-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-file-tree-empty,
.right-file-tree-error {
  color: #71717a;
  font-size: 11px;
  line-height: 1.5;
  padding: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
}

.right-file-tree-error {
  color: #fda4af;
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.2);
  word-break: break-word;
}

.file-storage-card {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.file-storage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.file-storage-row:first-child {
  border-top: none;
}

.file-storage-key {
  color: #94a3b8;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.file-storage-value {
  color: #e2e8f0;
  font-size: 11px;
}

.file-panel-hint {
  margin-top: 10px;
  color: #71717a;
  font-size: 11px;
  line-height: 1.45;
}

.file-panel-download-link {
  margin-top: 8px;
  border: none;
  background: transparent;
  padding: 0;
  color: #60a5fa;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  -webkit-text-stroke: 0.35px rgba(30, 64, 175, 0.8);
  text-shadow: 0 0 0.01px rgba(30, 64, 175, 0.9);
}

.file-panel-download-link:hover {
  color: #93c5fd;
}

.file-panel-download-link:active {
  color: #3b82f6;
}

.file-panel-download-link.is-disabled {
  opacity: 0.52;
  cursor: not-allowed;
  text-decoration: none;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 9, 14, 0.7);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.profile-modal.hidden {
  display: none;
}

.profile-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.profile-dialog {
  width: min(680px, calc(100vw - 32px));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #181818;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.52);
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  opacity: 0.92;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.profile-modal.is-open .profile-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-title {
  margin: 0;
  color: #ededed;
  font-size: 14px;
  font-weight: 700;
}

.profile-close-btn {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: #202020;
  color: #d8d8d8;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.profile-close-btn:hover {
  background: #2a2a2a;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.profile-layout {
  display: flex;
  gap: 14px;
}

.profile-left {
  width: 188px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 10px;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-avatar-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.profile-avatar-image,
.profile-avatar-fallback {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-image {
  object-fit: cover;
  background: #181818;
}

.profile-avatar-fallback {
  background: #181818;
  color: #ececec;
  font-size: 22px;
  font-weight: 700;
}

.profile-hero-name {
  margin: 0;
  color: #efefef;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
  word-break: break-all;
}

.profile-hero-email {
  margin: 0;
  color: #a7a7a7;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  word-break: break-all;
}

.profile-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #1d1d1d;
}

.profile-row-key {
  width: 64px;
  flex-shrink: 0;
  color: #a6a6a6;
  font-size: 11px;
  line-height: 1.3;
}

.profile-row-value {
  color: #efefef;
  font-size: 13px;
  line-height: 1.4;
  min-height: 20px;
  word-break: break-all;
}

.profile-row-editable {
  flex: 1;
  min-width: 0;
}

.profile-inline-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #181818;
  color: #eeeeee;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px;
  outline: none;
}

.profile-inline-input:focus {
  border-color: rgba(255, 255, 255, 0.24);
}

.profile-row-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.profile-icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: #202020;
  color: #d9d9d9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-icon-btn:hover {
  background: #292929;
}

.profile-mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: #202020;
  color: #e0e0e0;
  font-size: 11px;
  line-height: 1.2;
  padding: 6px 10px;
  cursor: pointer;
}

.profile-mini-btn:hover {
  background: #2a2a2a;
}

.profile-message {
  min-height: 18px;
  margin: 0;
  color: #aaaaaa;
  font-size: 12px;
  line-height: 1.4;
}

.profile-message.is-error {
  color: #fda4af;
}

.profile-message.is-success {
  color: #86efac;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.profile-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #efefef;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 9px 14px;
  cursor: pointer;
}

.profile-action-btn:hover {
  background: #ffffff;
}

.profile-action-btn.is-ghost {
  background: #202020;
  color: #dedede;
}

.profile-action-btn.is-ghost:hover {
  background: #2a2a2a;
}

.profile-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .profile-layout {
    flex-direction: column;
  }

  .profile-left {
    width: 100%;
  }

  .profile-row {
    flex-wrap: wrap;
  }

  .profile-row-key {
    width: 100%;
  }

  .profile-row-tools {
    margin-left: 0;
  }
}

.file-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 9, 14, 0.7);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.file-preview-modal.hidden {
  display: none;
}

.file-preview-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.file-preview-dialog {
  width: min(1080px, calc(100vw - 72px));
  height: min(78vh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #1e1e1e;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.52);
  overflow: hidden;
  opacity: 0.92;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.file-preview-modal.is-open .file-preview-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.file-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #252526;
}

.file-preview-path {
  min-width: 0;
  margin: 0;
  color: #d4d4d4;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-close {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: #d4d4d4;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.file-preview-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.file-preview-content {
  flex: 1;
  margin: 0;
  padding: 12px;
  color: #d4d4d4;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
  overflow: auto;
  background: #1e1e1e;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 131, 146, 0.85) rgba(30, 30, 30, 0.95);
}

.file-preview-content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.file-preview-content::-webkit-scrollbar-track {
  background: rgba(46, 52, 64, 0.72);
  border-radius: 999px;
}

.file-preview-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(161, 174, 193, 0.92), rgba(128, 142, 163, 0.95));
  border-radius: 999px;
  border: 2px solid rgba(46, 52, 64, 0.72);
}

.file-preview-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(190, 202, 219, 0.96), rgba(147, 162, 184, 0.98));
}

.file-preview-content::-webkit-scrollbar-corner {
  background: transparent;
}

.file-preview-content > code {
  display: block;
  min-height: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.file-preview-content > code.hljs {
  padding: 0;
  background: transparent;
}

.file-preview-content.is-markdown {
  font-family: "Inter", sans-serif;
  white-space: normal;
  line-height: 1.7;
}

.file-preview-content.is-markdown > * {
  margin: 0 0 12px;
}

.file-preview-content.is-markdown > *:last-child {
  margin-bottom: 0;
}

.file-preview-content.is-markdown h1,
.file-preview-content.is-markdown h2,
.file-preview-content.is-markdown h3,
.file-preview-content.is-markdown h4 {
  color: #f3f4f6;
  font-weight: 700;
  line-height: 1.35;
}

.file-preview-content.is-markdown p {
  margin: 0 0 10px;
  color: #d4d4d4;
}

.file-preview-content.is-markdown ul {
  list-style: disc;
  margin: 0 0 12px 1.3em;
  padding-left: 0.4em;
}

.file-preview-content.is-markdown ol {
  list-style: decimal;
  margin: 0 0 12px 1.3em;
  padding-left: 0.4em;
}

.file-preview-content.is-markdown li {
  margin: 2px 0;
}

.file-preview-content.is-markdown blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: #cfcfcf;
}

.file-preview-content.is-markdown a {
  color: #9ec5ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-preview-content.is-markdown img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.file-preview-content.is-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 12px;
}

.file-preview-content.is-markdown th,
.file-preview-content.is-markdown td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 8px;
  text-align: left;
}

.file-preview-content.is-markdown pre {
  margin: 10px 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 18, 25, 0.9);
  overflow: auto;
  white-space: pre;
}

.file-preview-content.is-markdown code {
  display: inline;
  min-height: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.file-preview-content.is-markdown pre code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.file-preview-content.is-error {
  color: #fca5a5;
}

.session-info-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);


}

.session-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-info-title {
  color: #f5f7fb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.session-info-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 3px 8px;
  font-size: 10px;
  line-height: 1.1;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.session-info-status.is-loading {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(30, 64, 175, 0.32);
  color: #bfdbfe;
}

.session-info-status.is-ready {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(6, 78, 59, 0.42);
  color: #99f6e4;
}

.session-info-status.is-error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(127, 29, 29, 0.42);
  color: #fecaca;
}

.session-info-status.is-idle {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(51, 65, 85, 0.24);
  color: #cbd5e1;
}

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

.session-info-item {
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;

  display: flex;
  flex-direction: column;
  gap: 5px;
}

.session-info-item.session-info-item-wide {
  grid-column: 1 / -1;
}

.session-info-key {
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.session-info-value {
  color: #f1f5f9;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.session-info-hint {
  margin-top: 10px;
  color: #71717a;
  font-size: 11px;
  line-height: 1.45;
}

.main-panel {
  position: relative;
}

.chat-container {
  transition: opacity 0.25s ease;
}

.model-picker-wrap {
  position: relative;
  min-width: 195px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.model-picker-wrap.is-open,
.model-picker-wrap:focus-within {
  box-shadow: none;
}

.model-picker-label {
  display: inline-block;
  margin: 0;
  color: #8f8f95;
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  user-select: none;
}

.model-picker-trigger {
  border: none;
  border-radius: 0;
  background: transparent;
  color: #f1f1f1;
  min-height: 28px;
  padding: 0 2px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.model-picker-trigger:hover {
  color: #ffffff;
}

.model-picker-trigger:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.model-picker-value {
  min-width: 0;
  color: #f0f0f0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-picker-caret {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid rgba(228, 228, 231, 0.76);
  border-bottom: 1.5px solid rgba(228, 228, 231, 0.76);
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.2s ease;
}

.model-picker-wrap.is-open .model-picker-caret {
  transform: translateY(2px) rotate(-135deg);
}

.model-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  right: auto;
  z-index: 35;
  padding: 4px 0;
  border: none;
  border-radius: 0;
  background: #181818;
  box-shadow: none;
  max-height: min(52vh, 360px);
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.model-picker-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.model-picker-menu.hidden {
  display: none;
}

.model-picker-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.model-picker-option {
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #ececec;
  text-align: left;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  animation: model-option-rise 0.22s ease forwards;
  animation-delay: calc(var(--option-index, 0) * 0.018s);
}

.model-picker-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.model-picker-option.is-selected {
  background: rgba(255, 255, 255, 0.14);
}

.model-picker-option-title {
  color: #f3f3f3;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.model-picker-option-sub {
  color: #adadad;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-picker-empty {
  padding: 9px 10px;
  color: #9d9d9d;
  font-size: 12px;
}

@keyframes model-option-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.api-error-banner {
  margin: 12px auto 0;
  width: min(100% - 48px, 1024px);
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(127, 29, 29, 0.16);
  color: #fecaca;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  padding: 9px 12px;
}

.api-error-banner.hidden {
  display: none;
}

.composer-wrap {
  transition:
    transform 0.52s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease-out;
  transform: translateY(0);
  will-change: transform, opacity;
}

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

.composer-action-left {
  position: relative;
  display: flex;
  align-items: center;
}

.composer-action-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #d4d4d8;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.composer-action-trigger:hover,
.composer-action-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

.composer-action-trigger-icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}

.composer-action-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  min-width: 180px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(24, 24, 24, 0.98);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  z-index: 8;
}

.composer-action-menu-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #e4e4e7;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.composer-action-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
}

.empty-brand {
  display: none;
}

.brand-typing {
  display: inline-block;
  color: #f4f4f5;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-height: 42px;
  transform: translateX(5px);
  transition: transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

.brand-typing.brand-rise {
  transform: translate(5px, -7px);
  opacity: 0.94;
}

.brand-typing.typing-active::after {
  content: "|";
  margin-left: 2px;
  color: #f4f4f5;
  animation: cursor-blink 0.75s steps(1, end) infinite;
}

.brand-last-char.blink-twice {
  animation: last-char-blink 0.24s steps(1, end) 2;
}

.brand-hint {
  margin-top: -13px;
  margin-left: 5px;
  min-height: 18px;
  color: #a1a1aa;
  font-size: 13px;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand-hint.show {
  opacity: 1;
  transform: translateY(0);
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fade-up 0.25s ease;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-row.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(78%, 720px);
  font-size: 14px;
  line-height: 1.6;
  padding: 10px 0;
  border-radius: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  border: none;
  color: #f4f4f5;
  box-shadow: none;
}

.message-row.user .message-bubble {
  background: transparent;
  color: #e4e4e7;
  border: none;
}

.message-row.user .message-bubble.user-confirm-result-bubble {
  width: min(78%, 760px);
  max-width: min(78%, 760px);
  padding: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(19, 20, 24, 0.96), rgba(10, 12, 16, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.user-confirm-compact {
  display: grid;
  row-gap: 10px;
  padding: 12px 14px;
  color: #e7e7ee;
}

.user-confirm-compact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.user-confirm-compact-head-main {
  min-width: 0;
}

.user-confirm-compact-title {
  font-size: 12px;
  font-weight: 700;
  color: #fafafa;
  letter-spacing: 0.01em;
}

.user-confirm-compact-subtitle {
  margin-top: 3px;
  color: #a8abb8;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.user-confirm-compact-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1;
  color: #f8fafc;
}

.user-confirm-compact-badge.is-approve {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(5, 46, 22, 0.55);
  color: #86efac;
}

.user-confirm-compact-badge.is-adjust {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(69, 26, 3, 0.55);
  color: #fcd34d;
}

.user-confirm-compact-badge.is-reject {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(69, 10, 10, 0.55);
  color: #fca5a5;
}

.user-confirm-compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.user-confirm-meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 9px;
  font-size: 11px;
  color: #cfd2de;
}

.user-confirm-meta-pill.is-time {
  color: #aeb4c5;
}

.user-confirm-compact-details {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(7, 9, 13, 0.5);
  overflow: hidden;
}

.user-confirm-compact-details summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  padding: 8px 10px;
  color: #d6dae8;
  font-size: 12px;
  border-bottom: 1px solid transparent;
}

.user-confirm-compact-details[open] summary {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.user-confirm-compact-details summary::-webkit-details-marker {
  display: none;
}

.user-confirm-compact-list {
  display: grid;
  row-gap: 6px;
  padding: 9px 10px 10px;
}

.user-confirm-compact-item {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  column-gap: 8px;
}

.user-confirm-compact-key {
  color: #97a0b4;
  font-size: 12px;
  word-break: break-word;
}

.user-confirm-compact-value {
  color: #e8ebf5;
  font-size: 12px;
  word-break: break-word;
}

.user-confirm-compact-feedback {
  border-left: 2px solid rgba(148, 163, 184, 0.46);
  padding-left: 9px;
  color: #d6dae6;
  font-size: 12px;
  line-height: 1.55;
}

.user-confirm-compact.is-approve .user-confirm-compact-title {
  color: #d1fae5;
}

.user-confirm-compact.is-adjust .user-confirm-compact-title {
  color: #fef3c7;
}

.user-confirm-compact.is-reject .user-confirm-compact-title {
  color: #fee2e2;
}

@media (max-width: 768px) {
  .message-row.user .message-bubble.user-confirm-result-bubble {
    width: min(92%, 760px);
    max-width: min(92%, 760px);
  }

  .user-confirm-compact {
    padding: 11px 12px;
    row-gap: 9px;
  }

  .user-confirm-compact-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .user-confirm-compact-item {
    grid-template-columns: 1fr;
    row-gap: 3px;
  }
}

.chat-list-empty {
  color: #71717a;
}

.message-block {
  width: min(100%, 760px);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.assistant-block.is-streaming {
  border: none;
}

.assistant-block.is-error {
  padding: 10px 12px;
  border-left: 2px solid rgba(248, 113, 113, 0.55);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.12);
}

.message-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.message-block-role {
  color: #fafafa;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.message-block-state {
  flex-shrink: 0;
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.message-block-state:empty {
  display: none;
}

.message-block-cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.message-block-cost.is-visible {
  opacity: 1;
}

.message-block-cost.is-fading-out {
  opacity: 0;
}

.message-block-cost-icon {
  width: 11px;
  height: 11px;
  margin-top: 0;
}

.message-block-cost-icon path {
  fill: #97b3a3;
}

.message-block-cost-value {
  color: #97b3a3;
  font-size: 10px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.message-block-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.message-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #a1a1aa;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.message-toolbar.is-generating {
  opacity: 1;
  pointer-events: none;
}

.message-row.assistant.is-latest-assistant:hover .message-toolbar,
.message-row.assistant.is-latest-assistant:focus-within .message-toolbar {
  opacity: 1;
  pointer-events: auto;
}

.message-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.message-toolbar-btn:hover {
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.06);
}

.message-toolbar-btn.is-copied {
  color: #fef3c7;
}

.message-toolbar-btn-icon {
  display: block;
}

.message-toolbar-generating {
  display: none;
  align-items: center;
  width: 190px;
  overflow: hidden;
  position: relative;
  padding-bottom: 2px;
}

.message-toolbar.is-generating .message-toolbar-btn {
  display: none;
}

.message-toolbar.is-generating .message-toolbar-generating {
  display: inline-flex;
}

.message-toolbar-generating-marquee {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.4);
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.14);
  overflow: visible;
}

.message-toolbar-generating-marquee::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  line-height: inherit;
  letter-spacing: inherit;
  color: transparent;
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.24) 30%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.24) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  background-repeat: no-repeat;
  background-size: 120px 100%;
  background-position: -140px 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  will-change: background-position;
  pointer-events: none;
  animation: message-toolbar-glow-marquee 1.9s linear infinite;
}

.message-parts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-part-text {
  font-size: 14px;
  line-height: 1.7;
  color: #e4e4e7;
  word-break: break-word;
}

.message-part-text > * {
  margin: 0 0 10px;
}

.message-part-text > *:last-child {
  margin-bottom: 0;
}

.message-part-text p {
  white-space: normal;
}

.message-part-text h1,
.message-part-text h2,
.message-part-text h3,
.message-part-text h4 {
  color: #fafafa;
  font-weight: 700;
  line-height: 1.35;
}

.message-part-text h1 {
  font-size: 22px;
}

.message-part-text h2 {
  font-size: 19px;
}

.message-part-text h3 {
  font-size: 17px;
}

.message-part-text ul,
.message-part-text ol {
  padding-left: 22px;
}

.message-part-text li + li {
  margin-top: 4px;
}

.message-part-text pre {
  margin: 10px 0;
  padding: 12px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 9, 11, 0.92);
  overflow-x: auto;
}

.message-part-text code {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.message-part-text pre code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
}

.message-part-text pre code.hljs {
  display: block;
  padding: 0;
  background: transparent;
  overflow-x: visible;
}

.message-part-text blockquote {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.18);
  color: #b4b4bc;
}

.message-part-text a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-part-text hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.message-part-text table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.message-part-text th,
.message-part-text td {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.message-part-text th {
  color: #f4f4f5;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
}

.assistant-reasoning {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.assistant-reasoning.hidden {
  display: none;
}

.assistant-reasoning summary {
  cursor: pointer;
  list-style: none;
  padding: 0;
  user-select: none;
}

.assistant-reasoning summary::-webkit-details-marker {
  display: none;
}

.assistant-reasoning-summary {
  display: block;
}

.assistant-reasoning-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: #a1a1aa;
  font-size: 12px;
}

.assistant-reasoning-status-viewport {
  height: 24px;
  overflow: hidden;
  flex-shrink: 0;
}

.assistant-reasoning-status-list {
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.35s ease;
}

.assistant-reasoning-status-item {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  font-weight: 600;
  color: #60a5fa;
}

.assistant-reasoning[data-status="tool"] .assistant-reasoning-status-item {
  color: #f59e0b;
}

.assistant-reasoning[data-status="done"] .assistant-reasoning-status-item {
  color: #10b981;
}

.assistant-reasoning-preview {
  margin-left: auto;
  max-width: 62%;
  height: 24px;
  line-height: 24px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #71717a;
  text-align: right;
}

.assistant-reasoning-arrow {
  flex-shrink: 0;
  color: #71717a;
  transition: transform 0.25s ease;
}

.assistant-reasoning[open] .assistant-reasoning-arrow {
  transform: rotate(180deg);
}

.assistant-reasoning-bodywrap {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 12px 12px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(113, 113, 122, 0.75) rgba(24, 24, 27, 0.35);
}

.assistant-reasoning-bodywrap::-webkit-scrollbar {
  width: 8px;
}

.assistant-reasoning-bodywrap::-webkit-scrollbar-track {
  background: rgba(24, 24, 27, 0.35);
  border-radius: 999px;
}

.assistant-reasoning-bodywrap::-webkit-scrollbar-thumb {
  background: rgba(113, 113, 122, 0.78);
  border-radius: 999px;
  border: 2px solid rgba(24, 24, 27, 0.35);
}

.assistant-reasoning-bodywrap::-webkit-scrollbar-thumb:hover {
  background: rgba(161, 161, 170, 0.92);
}

.assistant-reasoning-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.assistant-reasoning-tools:empty {
  display: none;
  margin-bottom: 0;
}

.assistant-reasoning-body {
  color: #c4c4cc;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 0;
}

.tool-call-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(9, 9, 11, 0.45);
  overflow: hidden;
}

.tool-call-block.is-pending-reveal {
  display: none;
}

.tool-call-block.is-revealing {
  opacity: 0;
  transform: translateY(6px);
  animation: tool-call-fade-in 0.24s ease forwards;
}

.tool-call-block.has-user-confirm {
  padding-bottom: 0;
}

.tool-call-block.is-calling {
  border-color: rgba(96, 165, 250, 0.25);
  background: rgba(30, 41, 59, 0.28);
}

.tool-call-block.is-completed {
  border-color: rgba(255, 255, 255, 0.14);
}

.tool-call-block.is-error {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(69, 10, 10, 0.2);
}

.tool-call-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #242424;
  margin: -12px -13px 0;
  padding: 10px 13px;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}

.tool-call-name {
  color: #f4f4f5;
  font-size: 12px;
  font-weight: 600;
}

.tool-call-status {
  color: #a1a1aa;
  font-size: 11px;
  flex-shrink: 0;
}

.tool-call-preview {
  color: #c4c4cc;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.tool-call-preview.hidden {
  display: none;
}

.tool-call-preview.tool-preview-user-confirm {
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tool-call-preview.tool-preview-project-meta {
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
}

.tool-call-preview.tool-preview-project-perms {
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
}

.tool-call-preview.tool-preview-project-cmds {
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
}

.tool-call-preview.tool-preview-edit-diff {
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.4;
}

.edit-diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.project-meta-card-title {
  color: #f4f4f5;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}

.project-meta-card-desc {
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1.45;
}

.project-meta-card-fields {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  padding-top: 2px;
}

.project-meta-field {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 22, 24, 0.78);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex: 1 1 160px;
  min-width: 0;
}

.project-meta-field-key {
  color: #a1a1aa;
  font-size: 10px;
  flex-shrink: 0;
}

.project-meta-field-value {
  color: #e4e4e7;
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
  word-break: break-word;
}

.project-perms-card-title {
  color: #f4f4f5;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}

.project-perms-card-project {
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1.35;
}

.project-perms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.project-perm-item {
  color: #e4e4e7;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(22, 22, 24, 0.78);
  border-radius: 999px;
  padding: 4px 8px;
}

.project-perms-empty {
  color: #71717a;
  font-size: 11px;
}

.project-cmds-card-title {
  color: #f4f4f5;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}

.project-cmds-card-project {
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1.35;
}

.project-cmds-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}

.project-cmd-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 22, 24, 0.78);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-cmd-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.project-cmd-name {
  color: #e4e4e7;
  font-size: 11px;
  font-weight: 600;
}

.project-cmd-desc {
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1.35;
}

.project-cmd-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-cmd-alias {
  color: #d4d4d8;
  font-size: 10px;
  line-height: 1.2;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 9, 11, 0.64);
  border-radius: 999px;
  padding: 3px 7px;
}

.project-cmds-empty {
  color: #71717a;
  font-size: 11px;
}

.edit-diff-file {
  color: #e4e4e7;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.edit-diff-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  margin-left: auto;
  justify-content: flex-end;
}

.edit-diff-pill {
  font-size: 10px;
  line-height: 1.2;
  border-radius: 999px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
  background: rgba(22, 22, 24, 0.7);
}

.edit-diff-pill.is-add {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(20, 83, 45, 0.32);
}

.edit-diff-pill.is-del {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.28);
}

.edit-diff-pill.is-truncated {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(120, 53, 15, 0.28);
}

.edit-diff-box {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(9, 9, 11, 0.7);
  height: 225px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) rgba(24, 24, 27, 0.65);
}

.edit-diff-box::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.edit-diff-box::-webkit-scrollbar-track {
  background: rgba(24, 24, 27, 0.65);
  border-radius: 999px;
}

.edit-diff-box::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.56), rgba(100, 116, 139, 0.72));
  border: 2px solid rgba(24, 24, 27, 0.65);
  border-radius: 999px;
}

.edit-diff-box::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(186, 200, 216, 0.66), rgba(120, 136, 159, 0.78));
}

.edit-diff-line {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 6px;
  align-items: start;
  padding: 3px 8px;
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 11px;
  line-height: 1.45;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.edit-diff-line:first-child {
  border-top: none;
}

.edit-diff-line.is-add {
  background: rgba(20, 83, 45, 0.22);
}

.edit-diff-line.is-del {
  background: rgba(127, 29, 29, 0.2);
}

.edit-diff-line.is-hunk {
  background: rgba(30, 41, 59, 0.35);
}

.edit-diff-mark {
  color: #a1a1aa;
  text-align: center;
  user-select: none;
}

.edit-diff-line.is-add .edit-diff-mark {
  color: #86efac;
}

.edit-diff-line.is-del .edit-diff-mark {
  color: #fca5a5;
}

.edit-diff-line.is-hunk .edit-diff-mark {
  color: #93c5fd;
}

.edit-diff-text {
  color: #d4d4d8;
  white-space: pre-wrap;
  word-break: break-word;
}

.edit-diff-line.is-hunk .edit-diff-text {
  color: #bfdbfe;
}

.edit-diff-empty {
  color: #71717a;
  font-size: 11px;
  padding: 8px;
}

.user-confirm-card-title {
  color: #f4f4f5;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 0 0;
}

.user-confirm-card-desc {
  color: #a1a1aa;
  font-size: 12px;
  line-height: 1.6;
  padding: 2px 0 0;
}

.user-confirm-card-fields {
  padding: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-confirm-card-empty {
  color: #a1a1aa;
  font-size: 12px;
}

.user-confirm-field {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 22, 24, 0.8);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-confirm-field.is-invalid {
  border-color: rgba(248, 113, 113, 0.5);
}

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

.user-confirm-field-title {
  color: #e4e4e7;
  font-size: 12px;
  font-weight: 600;
}

.user-confirm-field-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-confirm-field-tag {
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  line-height: 1.4;
}

.user-confirm-field-tag.is-required {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(120, 53, 15, 0.28);
}

.user-confirm-field-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-confirm-input {
  width: 100%;
  background: rgba(9, 9, 11, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e4e4e7;
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
}

.user-confirm-input:focus {
  border-color: rgba(148, 163, 184, 0.5);
}

.user-confirm-textarea {
  resize: vertical;
  min-height: 72px;
}

.user-confirm-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-confirm-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d4d4d8;
  font-size: 12px;
}

.user-confirm-option input {
  accent-color: #94a3b8;
}

.user-confirm-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-confirm-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-confirm-toggle-label {
  color: #d4d4d8;
  font-size: 12px;
}

.user-confirm-toggle-input {
  accent-color: #94a3b8;
}

.user-confirm-action-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px -13px 0;
  padding: 10px 13px;
  background: #242424;
  display: flex;
  justify-content: flex-end;
}

.user-confirm-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-confirm-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  font-size: 11px;
  line-height: 1.4;
  padding: 7px 10px;
  cursor: pointer;
}

.user-confirm-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-confirm-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-confirm-action-btn.is-approve {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(71, 85, 105, 0.3);
}

.user-confirm-feedback {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0 -13px;
  padding: 0 13px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.22s ease, opacity 0.22s ease, padding-top 0.22s ease, padding-bottom 0.22s ease;
}

.user-confirm-feedback.is-open {
  max-height: 220px;
  opacity: 1;
  padding-top: 10px;
  padding-bottom: 10px;
}

.user-confirm-feedback-input {
  width: 100%;
  background: rgba(9, 9, 11, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e4e4e7;
  font-size: 12px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 72px;
  outline: none;
}

.user-confirm-feedback-input:focus {
  border-color: rgba(148, 163, 184, 0.5);
}

.user-confirm-feedback-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.user-confirm-submit-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(71, 85, 105, 0.3);
  color: #f4f4f5;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
}

.user-confirm-submit-btn:hover {
  background: rgba(71, 85, 105, 0.44);
}

.user-confirm-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-confirm-action-tip {
  color: #b4b4bb;
  font-size: 11px;
  padding: 8px 0 10px;
}

@media (max-width: 1024px) {
  .header-right-controls {
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 18px 14px 22px;
  }

  .auth-close-btn {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
  }

  .auth-title {
    font-size: 18px;
  }

  .auth-oauth-actions {
    grid-template-columns: 1fr;
  }

  .auth-card-head,
  .auth-tabs,
  .auth-form,
  .auth-divider,
  .auth-oauth-actions,
  .auth-message {
    width: 100%;
  }

  .sidebar-user-wrap {
    padding: 8px;
  }

  .sidebar-user-panel {
    padding: 7px;
    gap: 7px;
  }

  .sidebar-user-wallet-panel {
    padding: 9px 10px;
  }

  .sidebar-user-avatar {
    width: 30px;
    height: 30px;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.5);
}

.settings-dialog {
  width: min(440px, calc(100vw - 24px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #202020;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-title {
  margin: 0;
  color: #f4f4f5;
  font-size: 15px;
  font-weight: 700;
}

.settings-close-btn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #d4d4d8;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.settings-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.settings-content {
  padding: 16px;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-row-label {
  color: #a1a1aa;
  font-size: 12px;
}

.settings-language-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #202020;
  color: #e4e4e7;
  font-size: 13px;
  padding: 8px 10px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e4e4e7;
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
}

.settings-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.plan-modal {
  position: fixed;
  inset: 0;
  z-index: 135;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.plan-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.plan-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #181818;
  box-shadow: 0 0 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.98);
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}

.plan-modal.is-open .plan-dialog {
  transform: scale(1);
  opacity: 1;
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.plan-title {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.plan-close-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #71717a;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.plan-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.plan-content {
  padding: 0;
  overflow-y: auto;
}

.plan-cycle-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  margin: 14px auto 10px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.plan-cycle-option {
  position: relative;
  cursor: pointer;
}

.plan-cycle-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}


.plan-cycle-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 8px 14px;
  border-radius: 8px;
  color: #a1a1aa;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.plan-cycle-option input:checked + span {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.32);
}


.plan-summary {
  margin: 0;
  padding: 10px 32px 12px;
  color: #9f9fa6;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
}

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

.plan-card {
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 28px 28px 24px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  transition: background-color 0.2s ease;
}

.plan-card:last-child {
  border-right: none;
}

.plan-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.plan-card.is-current {
  background: rgba(255, 255, 255, 0.015);
}

.plan-card.is-recommended {
  background: rgba(255, 255, 255, 0.03);
}

.plan-card.is-recommended::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.44), transparent);
}

.plan-card-tag {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #71717a;
}

.plan-card-tag.is-current {
  color: #10b981;
}

.plan-card-tag.is-recommended {
  color: #ffffff;
}

.plan-card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.plan-card-title {
  margin: 0;
  color: #ffffff;
  font-size: 22px;
  font-weight: 500;
}

.plan-card-price {
  margin: 0;
  color: #ffffff;
  font-size: 30px;
  font-weight: 300;
  line-height: 1.15;
}

.plan-card-billed {
  margin: 6px 0 0;
  color: #8f8f97;
  font-size: 13px;
  font-weight: 400;
}

.plan-card-features {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  color: #b4b4bb;
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.plan-card-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.plan-feature-icon {
  color: #71717a;
  font-size: 12px;
  margin-top: 1px;
  line-height: 1;
}

.plan-card.is-recommended .plan-feature-icon {
  color: #ffffff;
}

.plan-card-action {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: transparent;
  color: #f4f4f5;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-card.is-recommended .plan-card-action {
  background: #ffffff;
  color: #111111;
  border-color: #ffffff;
}

.plan-card-action:hover:not(:disabled) {
  background: #ffffff;
  color: #111111;
  border-color: #ffffff;
}

.plan-card-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.plan-card.is-recommended .plan-card-action:hover:not(:disabled) {
  background: #e4e4e7;
  color: #000000;
}

.plan-message {
  margin: 0;
  padding: 12px 32px;
  color: #a1a1aa;
  font-size: 12px;
  min-height: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
}


.plan-message.is-error {
  color: #fb7185;
}

.plan-message.is-success {
  color: #4ade80;
}

.plan-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.plan-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
}

.plan-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.version-range-dialog {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
}

.version-range-head {
  padding: 18px 22px;
}

.version-range-content {
  padding: 20px 22px;
  display: grid;
  gap: 16px;
}

.version-range-description {
  margin: 0;
  color: #a1a1aa;
  font-size: 12px;
  line-height: 1.6;
}

.version-range-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.version-range-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: #e4e4e7;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.version-range-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.version-range-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.version-range-option.is-selected {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.42);
  color: #f8fafc;
}

.version-range-option-text {
  pointer-events: none;
  white-space: nowrap;
}

.version-range-actions {
  padding: 12px 22px 16px;
  gap: 10px;
}

.version-range-confirm-btn {
  background: rgba(71, 85, 105, 0.3);
}

.recharge-modal {
  position: fixed;
  inset: 0;
  z-index: 136;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.recharge-modal.hidden {
  display: none;
}

.recharge-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.recharge-dialog {
  width: min(380px, calc(100vw - 24px));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #181818;
  box-shadow: 0 0 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.98);
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}

.recharge-modal.is-open .recharge-dialog {
  transform: scale(1);
  opacity: 1;
}

.recharge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.recharge-head-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recharge-head-marker {
  width: 4px;
  height: 12px;
  background: #ffffff;
}

.recharge-title {
  margin: 0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.recharge-close-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #52525b;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recharge-close-btn:hover {
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.05);
}

.recharge-content {
  padding: 24px;
  display: grid;
  gap: 26px;
}

.recharge-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.recharge-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
}

.recharge-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.recharge-section {
  display: grid;
  gap: 12px;
}

.recharge-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.recharge-section-label {
  color: #71717a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.recharge-section-hint {
  color: #52525b;
  font-size: 10px;
  line-height: 1;
  text-decoration: underline;
  text-decoration-color: #27272a;
  text-underline-offset: 3px;
}

.sidebar-wallet-recharge-amounts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.sidebar-wallet-recharge-amount {
  min-width: 0;
  padding: 10px 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #71717a;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-wallet-recharge-amount.is-active {
  border-color: #ffffff;
  color: #000000;
  background: #ffffff;
  font-weight: 700;
}

.sidebar-wallet-recharge-amount:hover:not(:disabled):not(.is-active) {
  border-color: rgba(255, 255, 255, 0.2);
  color: #d4d4d8;
}

.sidebar-wallet-recharge-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sidebar-wallet-recharge-channel {
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #71717a;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-wallet-recharge-channel.is-active {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-wallet-recharge-channel[data-recharge-channel="wechat"].is-active {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.sidebar-wallet-recharge-channel[data-recharge-channel="wechat"].is-active .recharge-channel-label {
  color: #86efac;
}

.sidebar-wallet-recharge-channel[data-recharge-channel="wechat"].is-active .recharge-channel-indicator {
  border-color: #4ade80;
}

.sidebar-wallet-recharge-channel[data-recharge-channel="wechat"].is-active .recharge-channel-indicator span {
  background: #4ade80;
}

.sidebar-wallet-recharge-channel[data-recharge-channel="alipay"].is-active {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

.sidebar-wallet-recharge-channel[data-recharge-channel="alipay"].is-active .recharge-channel-label {
  color: #bfdbfe;
}

.sidebar-wallet-recharge-channel[data-recharge-channel="alipay"].is-active .recharge-channel-indicator {
  border-color: #60a5fa;
}

.sidebar-wallet-recharge-channel[data-recharge-channel="alipay"].is-active .recharge-channel-indicator span {
  background: #60a5fa;
}

.sidebar-wallet-recharge-channel:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.02);
}

.recharge-channel-label {
  font-size: 12px;
  font-weight: 500;
  color: #71717a;
}

.sidebar-wallet-recharge-channel.is-active .recharge-channel-label {
  color: #ffffff;
}

.recharge-channel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid #3f3f46;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recharge-channel-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.sidebar-wallet-recharge-channel.is-active .recharge-channel-indicator {
  border-color: #ffffff;
}

.sidebar-wallet-recharge-channel.is-active .recharge-channel-indicator span {
  background: #ffffff;
}

.sidebar-wallet-recharge-actions {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 6px;
}

.recharge-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.35);
  padding: 18px 24px 20px;
}

.recharge-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.recharge-total-key {
  color: #71717a;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.recharge-total-value {
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.03em;
}

.sidebar-wallet-recharge-pay-btn,
.sidebar-wallet-recharge-manual-btn {
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-wallet-recharge-pay-btn {
  width: 100%;
  border: 1px solid #ffffff;
  background: #ffffff;
  color: #000000;
}

.sidebar-wallet-recharge-manual-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
}

.sidebar-wallet-recharge-pay-btn:hover:not(:disabled),
.sidebar-wallet-recharge-manual-btn:hover:not(:disabled) {
  filter: brightness(0.9);
}

.sidebar-wallet-recharge-pay-btn:disabled,
.sidebar-wallet-recharge-manual-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sidebar-wallet-recharge-message {
  min-height: 16px;
  margin: 0;
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1.4;
}

.sidebar-wallet-recharge-message.is-error {
  color: #fb7185;
}

.sidebar-wallet-recharge-message.is-success {
  color: #4ade80;
}

#sidebarMenuPlan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-menu-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .plan-cards {
    grid-template-columns: 1fr;
  }
  .plan-card {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 0;
    padding: 22px 20px;
  }
  .plan-card:last-child {
    border-bottom: none;
  }
  .plan-head,
  .plan-summary,
  .plan-message {
    padding-left: 20px;
    padding-right: 20px;
  }

  .plan-cycle-switcher {
    margin: 14px auto 10px;
    width: max-content;
  }

}

@keyframes auth-form-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cursor-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes last-char-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes message-toolbar-glow-marquee {
  0% {
    background-position: -140px 0;
  }
  100% {
    background-position: 220px 0;
  }
}

@keyframes tool-call-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 无消息时：输入区动画滑到中间 */
body.chat-empty .chat-container {
  opacity: 0;
}

body.chat-empty .composer-wrap {
  border-top-color: transparent;
  transform: translateY(var(--composer-empty-shift, -180px));
}

body.chat-empty .empty-brand {
  display: block;
}

/* 首次渲染：输入区渐显 */
body.chat-empty:not(.ui-ready) .composer-wrap {
  opacity: 0;
  transform: translateY(calc(var(--composer-empty-shift, -180px) + 8px));
}

@media (max-width: 640px) {
  .service-status-card {
    width: min(460px, calc(100vw - 28px));
    padding: 0 8px;
  }

  .service-status-title {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-status-overlay,
  .service-status-loading-bar,
  .tool-call-block {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
  .message-toolbar-generating-marquee {
    text-shadow: none;
  }
  .message-toolbar-generating-marquee::after {
    animation: none;
    background-position: 40px 0;
  }
}

.closedbeta-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.closedbeta-modal .plan-dialog {
  width: min(560px, calc(100vw - 24px));
}

.session-delete-confirm-modal .session-delete-confirm-dialog {
  width: min(460px, calc(100vw - 28px));
  border-color: rgba(244, 63, 94, 0.28);
  background: linear-gradient(180deg, #202020 0%, #181818 100%);
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.78);
}

.session-delete-confirm-content {
  padding: 18px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-delete-risk-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(244, 63, 94, 0.34);
  border-radius: 999px;
  padding: 4px 10px;
  color: #fecdd3;
  background: rgba(190, 24, 93, 0.16);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.session-delete-confirm-text {
  margin: 0;
  min-height: 98px;
  padding: 14px 14px;
  border: 1px solid rgba(244, 63, 94, 0.26);
  border-radius: 12px;
  background: rgba(39, 11, 22, 0.58);
  color: #ffe4e6;
  font-size: 13px;
  line-height: 1.7;
}

.session-delete-confirm-actions {
  border-top: 1px solid rgba(244, 63, 94, 0.14);
  padding: 12px 16px;
  gap: 10px;
}

.session-delete-confirm-submit-btn {
  border-color: rgba(244, 63, 94, 0.5);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.34), rgba(190, 24, 93, 0.3));
  color: #fff1f2;
  font-weight: 600;
}

.session-delete-confirm-submit-btn:hover {
  border-color: rgba(251, 113, 133, 0.8);
  background: linear-gradient(180deg, rgba(251, 113, 133, 0.44), rgba(225, 29, 72, 0.4));
  color: #ffffff;
}

.closedbeta-guide {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.closedbeta-guide-text {
  margin: 0;
  color: #d4d4d8;
  font-size: 13px;
  line-height: 1.5;
}

.closedbeta-join-btn {
  width: 100%;
  color: #28a8ff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
}

.closedbeta-join-btn:hover {
  color: #5dc2ff;
}

.closedbeta-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.closedbeta-code-label {
  color: #d4d4d8;
  font-size: 13px;
}

.closedbeta-code-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.closedbeta-code-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #202020;
  color: #f4f4f5;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.closedbeta-code-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.closedbeta-submit-btn {
  width: auto;
  min-width: 112px;
}

.closedbeta-message {
  margin-top: 0;
}

@media (max-width: 720px) {
  .closedbeta-code-row {
    flex-direction: column;
    align-items: stretch;
  }

  .closedbeta-submit-btn {
    width: 100%;
  }
}
