/* Unified corporate polish for Tick Chat.
   Visual overrides only. No API, routing, or application logic changes. */

:root {
  --corp-primary: #315fd6;
  --corp-primary-2: #244da8;
  --corp-ink: #111827;
  --corp-muted: #667085;
  --corp-soft: #f5f6f8;
  --corp-surface: #fffefd;
  --corp-border: rgba(31, 41, 55, 0.105);
  --corp-border-strong: rgba(31, 41, 55, 0.16);
  --corp-shadow: 0 14px 40px rgba(15, 23, 42, 0.075);
  --corp-radius: 12px;
  --corp-radius-lg: 16px;
}

body,
button,
input,
textarea,
select {
  letter-spacing: 0 !important;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(49, 95, 214, 0.45) !important;
  outline-offset: 2px !important;
}

/* Main app additions */
.workspace-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 254, 253, 0.62);
}

html.dark .workspace-card {
  background: rgba(21, 26, 35, 0.42);
}

.workspace-card__icon {
  display: grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(49, 95, 214, 0.14);
  border-radius: 9px;
  color: var(--primary);
  background: rgba(49, 95, 214, 0.055);
}

.workspace-card__main {
  min-width: 0;
  flex: 1;
}

.workspace-card__label {
  overflow: hidden;
  color: var(--text);
  font-size: 12.7px;
  font-weight: 680;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card__meta {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.1;
}

.workspace-card__status {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.10);
}

.topbar-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-3);
  background: transparent;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.topbar-icon-button:hover {
  color: var(--primary);
  border-color: var(--border-2);
  background: rgba(49, 95, 214, 0.045);
}

.notifications-wrap[open] .topbar-icon-button {
  color: var(--primary);
  border-color: rgba(49, 95, 214, 0.22);
  background: rgba(49, 95, 214, 0.075);
}

.notifications-wrap {
  position: relative;
  display: inline-flex;
}

.notifications-wrap > summary {
  list-style: none;
  cursor: pointer;
}

.notifications-wrap > summary::-webkit-details-marker {
  display: none;
}

.notifications-menu {
  position: fixed;
  top: 62px;
  right: 14px;
  z-index: 9999;
  width: min(340px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 254, 253, 0.96);
  box-shadow: var(--shadow-lg, 0 18px 48px rgba(15, 23, 42, 0.12));
  color: var(--text);
}

.notifications-wrap:not([open]) .notifications-menu {
  display: none;
}

html.dark .notifications-menu {
  background: rgba(15, 19, 27, 0.98);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
}

.notifications-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.notifications-menu__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.notifications-menu__meta {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.2;
}

.notifications-menu__status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 999px;
  color: #16a34a;
  background: rgba(34, 197, 94, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.notifications-menu__list {
  display: grid;
  gap: 0;
}

.notifications-menu__item {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.notifications-menu__item:last-child {
  border-bottom: 0;
}

.notifications-menu__dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--primary);
}

.notifications-menu__dot--soft {
  background: #22c55e;
}

.notifications-menu__item-title {
  color: var(--text);
  font-size: 12.7px;
  font-weight: 680;
  line-height: 1.25;
}

.notifications-menu__item-text {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11.4px;
  line-height: 1.45;
}

.empty-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-3);
  background: rgba(255, 254, 253, 0.66);
  font-size: 11px;
  font-weight: 650;
}

html.dark .empty-state-badge {
  background: rgba(21, 26, 35, 0.58);
}

.empty-state-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
}

/* Corporate tables for chat markdown and admin data views */
.prose table,
.corporate-admin table {
  width: 100% !important;
  min-width: min(540px, 100%) !important;
  max-width: 100% !important;
  margin: 0.95rem 0 1.1rem !important;
  border: 1px solid var(--corp-border) !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: rgba(255, 254, 253, 0.82) !important;
  box-shadow: none !important;
  color: var(--text, var(--corp-ink)) !important;
  font-size: 13.2px !important;
  line-height: 1.45 !important;
}

html.dark .prose table,
.dark .corporate-admin table {
  background: rgba(15, 19, 27, 0.72) !important;
  border-color: rgba(226, 232, 240, 0.10) !important;
}

.prose thead,
.corporate-admin table thead {
  background: transparent !important;
}

.prose th,
.corporate-admin table th {
  padding: 10px 14px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--corp-border) !important;
  background: rgba(248, 250, 252, 0.96) !important;
  color: var(--text, #111827) !important;
  font-size: 12.5px !important;
  font-weight: 720 !important;
  line-height: 1.35 !important;
  text-align: start !important;
  white-space: nowrap !important;
}

html.dark .prose th,
.dark .corporate-admin table th {
  background: rgba(21, 26, 35, 0.98) !important;
  border-bottom-color: rgba(226, 232, 240, 0.10) !important;
  color: #eef2f7 !important;
}

.prose td,
.corporate-admin table td {
  padding: 10px 14px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(31, 41, 55, 0.075) !important;
  color: var(--text-2, #4b5563) !important;
  font-size: 13.2px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  text-align: start !important;
  vertical-align: middle !important;
}

html.dark .prose td,
.dark .corporate-admin table td {
  border-bottom-color: rgba(226, 232, 240, 0.075) !important;
  color: #b8c0cf !important;
}

.prose th + th,
.prose td + td,
.corporate-admin table th + th,
.corporate-admin table td + td {
  border-inline-start: 1px solid rgba(31, 41, 55, 0.055) !important;
}

html.dark .prose th + th,
html.dark .prose td + td,
.dark .corporate-admin table th + th,
.dark .corporate-admin table td + td {
  border-inline-start-color: rgba(226, 232, 240, 0.065) !important;
}

.prose tbody tr:last-child td,
.corporate-admin table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.prose tbody tr,
.corporate-admin table tbody tr {
  background: transparent !important;
  transition: background-color 0.14s ease;
}

.prose tbody tr:nth-child(even),
.corporate-admin table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.018) !important;
}

html.dark .prose tbody tr:nth-child(even),
.dark .corporate-admin table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.018) !important;
}

.prose tbody tr:hover,
.corporate-admin table tbody tr:hover {
  background: rgba(49, 95, 214, 0.045) !important;
}

html.dark .prose tbody tr:hover,
.dark .corporate-admin table tbody tr:hover {
  background: rgba(96, 165, 250, 0.065) !important;
}

.prose table code,
.corporate-admin table code {
  border: 1px solid rgba(49, 95, 214, 0.12) !important;
  border-radius: 6px !important;
  background: rgba(49, 95, 214, 0.06) !important;
  color: var(--text, #111827) !important;
  font-size: 0.92em !important;
  padding: 1px 5px !important;
}

html.dark .prose table code,
.dark .corporate-admin table code {
  background: rgba(96, 165, 250, 0.10) !important;
  color: #dbeafe !important;
}

.msg-bot .prose table {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02) !important;
}

/* Login page */
.corporate-login {
  background:
    radial-gradient(circle at 18% 18%, rgba(49, 95, 214, 0.18), transparent 34%),
    linear-gradient(135deg, #0b111c 0%, #111827 52%, #0d1320 100%) !important;
}

.corporate-login #three-canvas {
  opacity: 0.18;
  filter: saturate(0.75);
}

.corporate-login .grain,
.corporate-login .left-panel::after,
.corporate-login .btn-shimmer,
.corporate-login .glass-card::before,
.corporate-login .pointer-events-none.absolute {
  display: none !important;
}

.corporate-login .vignette {
  background: linear-gradient(90deg, rgba(9, 14, 23, 0.56), rgba(9, 14, 23, 0.22), rgba(9, 14, 23, 0.68)) !important;
}

.corporate-login .page-grid {
  max-width: 1040px;
  gap: 3rem;
}

.corporate-login .glass-card {
  border-radius: 18px !important;
  border: 1px solid rgba(226, 232, 240, 0.14) !important;
  background: rgba(17, 24, 39, 0.78) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38) !important;
  transform: none !important;
}

.corporate-login .spotlight {
  display: none !important;
}

.corporate-login .submit-btn {
  border-radius: 12px !important;
  background: var(--corp-primary) !important;
  box-shadow: 0 12px 28px rgba(49, 95, 214, 0.24) !important;
}

.corporate-login .submit-btn:hover {
  background: var(--corp-primary-2) !important;
  transform: translateY(-1px) !important;
}

.corporate-login .f-input {
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(226, 232, 240, 0.12) !important;
}

.corporate-login .f-pill,
.corporate-login .stat-box {
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.045) !important;
}

.corporate-login .grad-hero,
.corporate-login .grad-soft {
  background: none !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Admin page */
.corporate-admin {
  background: #f3f4f6 !important;
}

.corporate-admin.dark,
.dark .corporate-admin {
  background: #0d121b !important;
}

.corporate-admin .gradient-text {
  background: none !important;
  color: var(--corp-primary) !important;
  -webkit-text-fill-color: currentColor !important;
}

.corporate-admin .glass {
  background: rgba(255, 254, 253, 0.86) !important;
  border-color: var(--corp-border) !important;
  backdrop-filter: blur(14px) !important;
}

.dark .corporate-admin .glass {
  background: rgba(15, 19, 27, 0.86) !important;
}

.corporate-admin #sidebar {
  width: 272px !important;
  background: #fffefd !important;
  border-color: var(--corp-border) !important;
  box-shadow: none !important;
}

.dark .corporate-admin #sidebar {
  background: #0f131b !important;
}

.corporate-admin .bg-gradient-to-br,
.corporate-admin .bg-gradient-to-r,
.corporate-admin .btn-primary,
.corporate-admin .toggle-switch.active {
  background-image: none !important;
}

.corporate-admin .from-primary-500,
.corporate-admin .to-purple-600,
.corporate-admin .btn-primary,
.corporate-admin .toggle-switch.active {
  background-color: var(--corp-primary) !important;
}

.corporate-admin .hover-card {
  border-radius: 14px !important;
  box-shadow: none !important;
}

.corporate-admin .hover-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07) !important;
}

.corporate-admin .rounded-2xl {
  border-radius: 14px !important;
}

.corporate-admin .rounded-xl {
  border-radius: 10px !important;
}

.corporate-admin .sidebar-item.active {
  background: rgba(49, 95, 214, 0.07) !important;
  color: var(--corp-primary) !important;
}

.corporate-admin .sidebar-item::before {
  background: var(--corp-primary) !important;
}

.corporate-admin table th {
  background: #f8fafc !important;
}

.dark .corporate-admin table th {
  background: #111827 !important;
}

.corporate-admin #admin-mobile-toggle {
  background: var(--corp-primary) !important;
  box-shadow: 0 10px 24px rgba(49, 95, 214, 0.22) !important;
}

/* About / documentation page */
.corporate-about {
  background: #f4f5f7 !important;
}

.dark .corporate-about {
  background: #0d121b !important;
}

.corporate-about nav {
  background: rgba(255, 254, 253, 0.88) !important;
  border-color: var(--corp-border) !important;
}

.dark .corporate-about nav {
  background: rgba(15, 19, 27, 0.88) !important;
}

.corporate-about .absolute.blur-3xl,
.corporate-about [class*="-inset-1"] {
  display: none !important;
}

.corporate-about .bg-gradient-to-r,
.corporate-about .bg-gradient-to-br {
  background-image: none !important;
}

.corporate-about .text-transparent,
.corporate-about .bg-clip-text {
  color: var(--corp-primary) !important;
  -webkit-text-fill-color: currentColor !important;
}

.corporate-about .feature-card,
.corporate-about .stat-card,
.corporate-about .security-card,
.corporate-about .component-card,
.corporate-about .arch-layer {
  border-radius: 14px !important;
  border-color: var(--corp-border) !important;
  box-shadow: none !important;
}

.corporate-about .feature-card:hover,
.corporate-about .stat-card:hover,
.corporate-about .security-card:hover,
.corporate-about .component-card:hover,
.corporate-about .arch-layer:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07) !important;
}

.corporate-about .feature-icon,
.corporate-about .stat-icon,
.corporate-about .security-icon,
.corporate-about footer .p-2,
.corporate-about nav .relative.p-2 {
  background: var(--corp-primary) !important;
  border-radius: 10px !important;
}

.corporate-about section {
  scroll-margin-top: 80px;
}

.pasted-text-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 300px);
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid var(--corp-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.pasted-text-chip__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  color: #fff;
  background: #0f7df2;
}

.pasted-text-chip__body {
  min-width: 0;
  flex: 1;
}

.pasted-text-chip__title {
  overflow: hidden;
  color: var(--corp-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pasted-text-chip__meta {
  margin-top: 1px;
  color: var(--corp-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.pasted-text-chip__remove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--corp-muted);
  background: transparent;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.pasted-text-chip__remove:hover {
  border-color: var(--corp-border);
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
}

html.dark .pasted-text-chip {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

html.dark .pasted-text-chip__icon {
  background: #1687ff;
}

#file-preview > .flex {
  align-items: center;
  padding: 8px !important;
}

#file-chips {
  max-height: 86px !important;
}

.message-pasted-files {
  display: grid;
  gap: 8px;
  width: min(100%, 520px);
}

.message-pasted-file {
  overflow: hidden;
  border: 1px solid var(--corp-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.message-pasted-file__summary {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.message-pasted-file__summary::-webkit-details-marker {
  display: none;
}

.message-pasted-file__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: #fff;
  background: #0f7df2;
}

.message-pasted-file__body {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.message-pasted-file__title {
  overflow: hidden;
  color: var(--corp-text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-pasted-file__meta {
  color: var(--corp-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.message-pasted-file__action {
  color: var(--corp-primary);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.message-pasted-file__close,
.message-pasted-file[open] .message-pasted-file__open {
  display: none;
}

.message-pasted-file[open] .message-pasted-file__close {
  display: inline;
}

.message-pasted-file__content {
  border-top: 1px solid var(--corp-border);
  background: rgba(15, 23, 42, 0.03);
}

.message-pasted-file__content pre {
  max-height: 230px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  color: var(--corp-text);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-pasted-file__notice {
  border-top: 1px solid var(--corp-border);
  padding: 8px 12px;
  color: var(--corp-muted);
  font-size: 11px;
  font-weight: 650;
}

html.dark .message-pasted-file {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.7);
}

html.dark .message-pasted-file__content {
  background: rgba(2, 6, 23, 0.22);
}

#user-in {
  direction: auto;
  unicode-bidi: plaintext;
  text-align: start;
}

#user-in[dir="rtl"] {
  text-align: right !important;
}

#user-in[dir="ltr"] {
  text-align: left !important;
}

@media (max-width: 767px) {
  .workspace-card {
    margin-bottom: 12px;
  }

  .notifications-menu {
    position: fixed;
    top: 58px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .corporate-login .page-wrap {
    align-items: center;
    padding: 16px;
  }

  .corporate-login .glass-card {
    border-radius: 16px !important;
  }

  .corporate-admin #sidebar {
    width: min(280px, 86vw) !important;
  }

  .corporate-about .feature-card,
  .corporate-about .stat-card,
  .corporate-about .security-card,
  .corporate-about .component-card {
    border-radius: 12px !important;
  }

  .pasted-text-chip {
    width: 100%;
  }
}

/* Final app shell polish: quieter dark mode and global-app style chrome. */
html.dark body.chat-app {
  --primary: #5d9eff;
  --primary-light: #8bbcff;
  --primary-dark: #2f76e8;
  --primary-glow: rgba(93, 158, 255, 0.10);

  --surface: #101011;
  --surface-2: #0b0b0c;
  --surface-3: #18181a;

  --text: #f4f4f5;
  --text-2: #b8b8bd;
  --text-3: #7d7d86;

  --border: rgba(255, 255, 255, 0.075);
  --border-2: rgba(255, 255, 255, 0.13);

  --sidebar-bg: #070707;
  --topbar-bg: rgba(5, 5, 5, 0.92);
  --chat-bg: #050505;
  --bot-bubble: transparent;
  --user-bubble: #141416;
  --code-bg: #070707;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.42);

  --avatar-user: #4d91ff;
  --avatar-bot: #1b1b1f;
}

html.dark body.chat-app,
html.dark body.chat-app main,
html.dark body.chat-app #chat-container,
html.dark body.chat-app #chat-box {
  background: var(--chat-bg) !important;
}

html.dark body.chat-app #topbar {
  background: var(--topbar-bg) !important;
  border-bottom-color: var(--border) !important;
  box-shadow: none !important;
}

html.dark body.chat-app #sidebar {
  background: var(--sidebar-bg) !important;
  border-right-color: var(--border) !important;
  box-shadow: none !important;
}

body.chat-app #sidebar {
  width: 280px !important;
  flex: 0 0 280px !important;
  min-width: 280px;
  overflow: hidden;
  transition:
    width 0.22s ease,
    min-width 0.22s ease,
    flex-basis 0.22s ease,
    opacity 0.18s ease,
    transform 0.22s ease;
}

body.chat-app #sidebar-open,
body.chat-app #sidebar-close,
body.chat-app #quota-toggle-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0 !important;
  border: 1px solid var(--border);
  border-radius: 10px !important;
  color: var(--text-3);
  background: transparent;
}

body.chat-app #sidebar-open:hover,
body.chat-app #sidebar-close:hover,
body.chat-app #quota-toggle-btn:hover,
body.chat-app .topbar-icon-button:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: rgba(255, 255, 255, 0.055) !important;
}

body.chat-app #quota-toggle-btn,
body.chat-app #quota-panel,
body.chat-app .workspace-card,
body.chat-app .notifications-wrap,
body.chat-app #current-project-name,
body.chat-app .empty-state-badge,
body.chat-app .sidebar-item-meta,
body.chat-app .project-row-meta,
body.chat-app .suggest-desc,
body.chat-app #sidebar-theme {
  display: none !important;
}

body.chat-app #admin-link.hidden {
  display: none !important;
}

body.chat-app #topbar .flex.items-center.gap-2.md\:gap-2\.5 {
  max-width: none !important;
  overflow: visible !important;
}

body.chat-app #topbar .select-pill,
body.chat-app #topbar .topbar-icon-button,
body.chat-app #project-settings-btn,
body.chat-app #topbar a[href="about.html"] {
  border-radius: 10px !important;
}

body.chat-app #usage-pill:not(.hidden) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  max-width: 210px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-2);
  background: rgba(255, 254, 253, 0.72);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
}

body.chat-app #usage-pill[aria-expanded="true"],
body.chat-app #usage-pill:hover {
  border-color: var(--border-2);
  background: rgba(49, 95, 214, 0.055);
}

body.chat-app .usage-pill__bar {
  position: relative;
  width: 46px;
  min-width: 46px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

body.chat-app .usage-pill__bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  transition: width 0.35s ease;
}

body.chat-app #usage-mini-text {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
}

html.dark body.chat-app #usage-pill:not(.hidden) {
  border-color: var(--border) !important;
  background: #0d0d0f !important;
  color: var(--text-2) !important;
}

html.dark body.chat-app #usage-pill[aria-expanded="true"],
html.dark body.chat-app #usage-pill:hover {
  border-color: var(--border-2) !important;
  background: #151517 !important;
  color: var(--text) !important;
}

body.chat-app .usage-wrap {
  position: relative;
  display: inline-flex;
}

body.chat-app .usage-popover {
  position: fixed;
  top: 62px;
  right: 14px;
  z-index: 80;
  width: min(380px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 254, 253, 0.98);
  color: var(--text);
  box-shadow: var(--shadow-lg, 0 18px 48px rgba(15, 23, 42, 0.12));
}

html.dark body.chat-app .usage-popover {
  border-color: var(--border) !important;
  background: #0d0d0f !important;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

body.chat-app .usage-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 750;
}

body.chat-app #usage-detail-status {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 650;
}

body.chat-app .usage-popover__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

body.chat-app .usage-stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.025);
}

html.dark body.chat-app .usage-stat {
  background: #111113;
}

body.chat-app .usage-stat span,
body.chat-app .usage-model-row span,
body.chat-app .usage-model-empty {
  display: block;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

body.chat-app .usage-stat strong,
body.chat-app .usage-model-row strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.chat-app .usage-models {
  display: grid;
  max-height: min(46vh, 320px);
  overflow: auto;
  padding: 0 12px 12px;
  gap: 7px;
}

body.chat-app .usage-model-row,
body.chat-app .usage-model-empty {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
}

html.dark body.chat-app .topbar-icon-button,
html.dark body.chat-app #project-settings-btn,
html.dark body.chat-app #topbar a[href="about.html"] {
  border-color: var(--border) !important;
  background: transparent !important;
  color: var(--text-3) !important;
}

html.dark body.chat-app .topbar-icon-button:hover,
html.dark body.chat-app #project-settings-btn:hover,
html.dark body.chat-app #topbar a[href="about.html"]:hover {
  border-color: var(--border-2) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  color: var(--text) !important;
}

html.dark body.chat-app .select-pill,
html.dark body.chat-app .strip-pill {
  border: 1px solid var(--border) !important;
  background: #0d0d0f !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html.dark body.chat-app .select-pill select,
html.dark body.chat-app .strip-pill select {
  color: var(--text) !important;
  background: #0d0d0f !important;
}

body.chat-app .sidebar-section-heading {
  display: none !important;
}

body.chat-app .sidebar-section,
body.chat-app .sidebar-conversation-section {
  margin-bottom: 12px !important;
}

body.chat-app .sidebar-section-head {
  justify-content: flex-end !important;
  margin-bottom: 8px !important;
}

body.chat-app .sidebar-general-card,
body.chat-app #chat-list > [data-chat-id],
body.chat-app .project-row {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.dark body.chat-app .sidebar-general-card,
html.dark body.chat-app #chat-list > [data-chat-id],
html.dark body.chat-app .project-row {
  color: var(--text-2) !important;
}

body.chat-app .sidebar-general-card:hover,
body.chat-app #chat-list > [data-chat-id]:hover,
body.chat-app .project-row:hover {
  background: rgba(255, 255, 255, 0.055) !important;
}

body.chat-app #global-chat-item[class*="bg-primary-500"],
body.chat-app #chat-list > [data-chat-id][data-current-chat],
body.chat-app #chat-list > [data-chat-id].is-current-chat {
  border-color: transparent !important;
  background: rgba(255, 255, 255, 0.075) !important;
}

html.dark body.chat-app .sidebar-item-icon,
html.dark body.chat-app .project-row-icon {
  border-color: var(--border) !important;
  background: #101011 !important;
  color: var(--text-3) !important;
}

html.dark body.chat-app #new-chat-btn {
  border: 1px solid var(--border) !important;
  background: #101011 !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html.dark body.chat-app #new-chat-btn:hover {
  border-color: var(--border-2) !important;
  background: #161618 !important;
}

html.dark body.chat-app #chat-box + div {
  background: linear-gradient(to top, #050505 82%, rgba(5, 5, 5, 0)) !important;
  border-top-color: transparent !important;
}

html.dark body.chat-app #composer {
  border-color: var(--border) !important;
  background: #111113 !important;
  box-shadow: none !important;
}

html.dark body.chat-app #composer:focus-within {
  border-color: rgba(93, 158, 255, 0.35) !important;
  box-shadow: 0 0 0 2px rgba(93, 158, 255, 0.10) !important;
}

html.dark body.chat-app .msg-bubble.msg-user {
  border: 1px solid var(--border) !important;
  background: var(--user-bubble) !important;
  box-shadow: none !important;
}

html.dark body.chat-app .msg-bubble.msg-bot {
  background: transparent !important;
  box-shadow: none !important;
}

body.chat-app #empty-state .absolute.-inset-4 {
  display: none !important;
}

html.dark body.chat-app #empty-state > .relative.mb-5 > .relative {
  border-color: var(--border) !important;
  background: #101011 !important;
  box-shadow: none !important;
}

body.chat-app #empty-state h2 {
  margin-bottom: 24px !important;
}

body.chat-app .suggest-card {
  min-height: 56px !important;
}

html.dark body.chat-app .suggest-card {
  border-color: var(--border) !important;
  background: #0d0d0f !important;
  box-shadow: none !important;
}

html.dark body.chat-app .suggest-card:hover {
  border-color: var(--border-2) !important;
  background: #151517 !important;
}

@media (min-width: 768px) {
  body.chat-app.sidebar-collapsed #sidebar {
    width: 0 !important;
    flex-basis: 0 !important;
    min-width: 0 !important;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-18px) !important;
    border-right: 0 !important;
  }

  body.chat-app.sidebar-collapsed #sidebar * {
    visibility: hidden;
  }
}

@media (max-width: 767px) {
  body.chat-app #sidebar {
    width: min(284px, 86vw) !important;
    flex-basis: min(284px, 86vw) !important;
    min-width: min(284px, 86vw) !important;
  }

  body.chat-app #topbar .select-pill,
  body.chat-app #topbar #thinking-pill,
  body.chat-app #project-settings-btn,
  body.chat-app #topbar a[href="about.html"] {
    display: none !important;
  }

  body.chat-app #topbar .topbar-icon-button,
  body.chat-app #sidebar-open,
  body.chat-app #sidebar-close {
    width: 36px;
    height: 36px;
  }

  body.chat-app #usage-pill:not(.hidden) {
    min-width: 106px;
    max-width: 126px;
    height: 36px;
    padding: 0 8px;
    gap: 6px;
  }

  body.chat-app .usage-pill__bar {
    width: 34px;
    min-width: 34px;
  }

  body.chat-app #usage-mini-text {
    max-width: 68px;
    font-size: 11px;
  }

  body.chat-app .usage-popover {
    top: 58px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 76px);
  }

  body.chat-app .usage-popover__grid {
    grid-template-columns: 1fr;
  }
}
