﻿*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-size: 15px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  background: #eef2f7;
  touch-action: pan-x pan-y;
}

/* ── IDE grid ── */
.create-page {
  display: grid;
  grid-template-columns: 380px 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(127, 215, 199, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(234, 220, 200, 0.16), transparent 28%),
    #f4f6f4;
}

/* ── Top bar ── */
.create-topbar {
  grid-column: 1 / -1;
  position: relative;
  height: 40px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
  z-index: 10;
}

.create-topbar-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.create-topbar-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 100%;
  padding: 0 0.95rem;
}

.create-topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 0.4rem;
  color: rgba(255,255,255,0.7);
  transition: background 0.15s ease, color 0.15s ease;
}

.create-topbar-back:hover {
  background: rgba(159,227,215,0.18);
  color: #dff6ef;
}

.create-topbar-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.01em;
}

.create-topbar-content .projects-topbar-user {
  font-size: 0.84rem;
}

.create-topbar-content .projects-token-progress-label {
  font-size: 0.76rem;
}

.create-topbar-content .projects-topbar-logout {
  min-height: 30px;
  font-size: 0.8rem;
}

/* ── Welcome page ── */
.welcome-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow: hidden;
  background: #f4f6f4;
}

.welcome-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.welcome-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.welcome-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 6px 18px rgba(11, 63, 74, 0.18));
}

.welcome-title {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  color: #0b3f4a;
  letter-spacing: -0.02em;
}

.welcome-subtitle {
  margin: 0.75rem 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #4a6b72;
  max-width: 440px;
}

.welcome-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.75rem;
  width: 100%;
}

.welcome-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(11, 63, 74, 0.06);
  backdrop-filter: blur(6px);
  text-align: left;
}

.welcome-feature-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: rgba(11, 63, 74, 0.07);
  color: #0b3f4a;
}

.welcome-feature-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.welcome-feature-text strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0b3f4a;
}

.welcome-feature-text span {
  font-size: 0.78rem;
  color: #5d7479;
  line-height: 1.45;
}

.welcome-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0.85rem 2rem;
  border-radius: 0.9rem;
  background: #0b3f4a;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(11, 63, 74, 0.22);
  transition: background 0.18s ease, transform 0.14s ease;
}

.welcome-cta:hover {
  background: #10606d;
  color: #fff;
  transform: translateY(-1px);
}

@media (max-width: 540px) {
  .welcome-features {
    grid-template-columns: 1fr;
  }

  .welcome-title {
    font-size: 1.8rem;
  }
}

/* ── Welcome toast ── */
.welcome-toast {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  background: rgba(11, 63, 74, 0.92);
  color: #dff6ef;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: min(600px, calc(100vw - 3rem));
  min-height: 48px;
  box-shadow: 0 12px 40px rgba(11, 63, 74, 0.28), 0 0 0 1px rgba(159, 227, 215, 0.12);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
  overflow: hidden;
}

.welcome-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.welcome-toast-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.55rem;
  background: rgba(159, 227, 215, 0.15);
  color: #9fe3d7;
}

.welcome-toast-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.welcome-toast-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #9fe3d7;
  border-radius: 1px;
  margin-left: 1px;
  animation: welcome-blink 0.7s steps(2) infinite;
  vertical-align: text-bottom;
  flex-shrink: 0;
}

@keyframes welcome-blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
}

@media (max-width: 540px) {
  .welcome-toast {
    bottom: 1rem;
    font-size: 0.8rem;
    padding: 0.65rem 1rem;
    white-space: normal;
  }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(127, 215, 199, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(234, 220, 200, 0.2), transparent 32%),
    #f4f6f4;
}

.login-shell {
  width: 100%;
  max-width: 420px;
}

.login-card {
  padding: 2rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 60px rgba(11, 63, 74, 0.1);
  backdrop-filter: blur(10px);
}

.login-kicker {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(11, 63, 74, 0.08);
  color: #295c62;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.login-title {
  margin: 1rem 0 0;
  color: #0b3f4a;
  font-size: 2rem;
  font-weight: 700;
}

.login-subtitle {
  margin: 0.65rem 0 1.5rem;
  color: #5d7479;
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-submit {
  border: none;
  min-height: 46px;
  border-radius: 0.9rem;
  background: #0b3f4a;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(11, 63, 74, 0.16);
  transition: background 0.18s ease, transform 0.14s ease;
}

.login-submit:hover {
  background: #10606d;
  transform: translateY(-1px);
}

.new-project-endpoint {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: rgba(11, 63, 74, 0.05);
  word-break: break-all;
  font-size: 0.85rem;
  color: #335a61;
}

/* ── Projects list page ── */
.projects-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(127, 215, 199, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(234, 220, 200, 0.18), transparent 26%),
    #f4f6f4;
}

.projects-topbar {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.projects-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.projects-topbar-usage {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.projects-topbar-user {
  color: #e9f8f4;
  font-size: 0.8rem;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(6, 22, 27, 0.18);
}

.projects-topbar-user:hover {
  color: #ffffff;
}

.projects-topbar-logout {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  border-radius: 0.55rem;
  font-size: 0.78rem;
}

.projects-topbar-logout:hover {
  background: rgba(255,255,255,0.14);
}

/* ── Topbar chat button ── */
.topbar-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  padding: 0.25rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.topbar-chat-btn:hover {
  background: rgba(159,227,215,0.18);
  color: #dff6ef;
}

.topbar-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  animation: topbar-badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes topbar-badge-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.projects-topbar-impersonate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.projects-topbar-impersonate-label {
  font-size: 0.75rem;
  color: #fbbf24;
  white-space: nowrap;
}

.projects-topbar-impersonate-btn {
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  min-height: 26px;
  padding: 0.15rem 0.6rem;
  border-radius: 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.projects-topbar-impersonate-btn:hover {
  background: rgba(251, 191, 36, 0.25);
}

.projects-token-progress {
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  overflow: hidden;
}

.projects-token-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7fd7c7 0%, #eadcc8 100%);
}

.projects-token-progress-over-limit .projects-token-progress-bar {
  background: linear-gradient(90deg, #f08a8a 0%, #d94c4c 55%, #8f1f1f 100%);
}

.projects-token-progress-over-limit + .projects-token-progress-label {
  color: #f4b1b1;
}

.projects-token-progress-extra .projects-token-progress-bar {
  background: linear-gradient(90deg, #f0c040 0%, #e6a020 100%);
}

.projects-token-extra-label {
  color: #f0c040;
  font-size: 0.7em;
  margin-left: 3px;
  cursor: pointer;
}

.projects-token-progress-label {
  color: #edf7f5;
  font-size: 0.74rem;
  text-shadow: 0 1px 1px rgba(6, 22, 27, 0.14);
}

.create-chat-userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0 0.85rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(11, 63, 74, 0.08);
}

.create-chat-userbar .projects-topbar-user {
  color: #0b3f4a;
}

.create-chat-userbar .projects-token-progress {
  background: rgba(11, 63, 74, 0.1);
}

.create-chat-userbar .projects-token-progress-label {
  color: #5d7479;
}

.create-chat-userbar .projects-topbar-logout {
  border-color: rgba(11, 63, 74, 0.12);
  background: rgba(11, 63, 74, 0.04);
  color: #0b3f4a;
}

.create-chat-userbar .projects-topbar-logout:hover {
  background: rgba(11, 63, 74, 0.08);
}

.users-shell {
  padding-top: 1.5rem;
}

.users-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.users-panel-header {
  margin-bottom: 0;
}

.users-create-card,
.users-table-card {
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.78);
  padding: 1.2rem;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.05);
}

.users-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.users-section-header h2 {
  margin: 0;
  font-size: 1rem;
  color: #0b3f4a;
}

.users-section-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.users-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: end;
}

.users-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
}

.users-create-actions {
  display: flex;
  justify-content: flex-end;
}

.users-table {
  margin: 0;
}

.users-table thead th {
  color: #5d7479;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom-color: rgba(11, 63, 74, 0.1);
}

.users-table td {
  vertical-align: middle;
  border-color: rgba(11, 63, 74, 0.08);
}

.users-table .form-control {
  min-width: 120px;
}

.users-table-actions {
  min-width: 120px;
}

.users-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(11, 63, 74, 0.12);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  color: #335a61;
  transition: transform 0.14s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.users-edit-btn:hover {
  background: #fff;
  color: #0b3f4a;
  border-color: rgba(11, 63, 74, 0.18);
  transform: translateY(-1px);
}

/* ── Users: Last seen indicator ── */

.users-lastseen {
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
}

.users-lastseen--online {
  color: #16a34a;
  font-weight: 600;
}

.users-lastseen--online::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  margin-right: 4px;
  vertical-align: middle;
}

.dark-mode .users-lastseen {
  color: rgba(255,255,255,0.45);
}

.dark-mode .users-lastseen--online {
  color: #4ade80;
}

.dark-mode .users-lastseen--online::before {
  background: #4ade80;
}

.backup-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: #6b7d82;
  font-size: 0.97rem;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(11, 63, 74, 0.04);
}

.backup-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.backup-item-info strong {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-item-info small {
  color: #6b7d82;
  font-size: 0.8rem;
}

.backup-restore-btn {
  flex-shrink: 0;
}

.help-item {
  padding: 1rem 1.1rem;
  border-left: 3px solid #10606d;
  background: rgba(11, 63, 74, 0.03);
  border-radius: 0 0.5rem 0.5rem 0;
  margin-bottom: 0.85rem;
}

.help-item:last-child {
  margin-bottom: 0;
}

.help-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #10606d;
  margin-bottom: 0.35rem;
}

.help-item-header svg {
  flex-shrink: 0;
  color: #10606d;
  fill: #10606d;
}

.help-item-header svg[fill="currentColor"] {
  fill: #10606d;
}

.help-item-header svg:not([fill="currentColor"]) {
  stroke: #10606d;
}

.help-item-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #555;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(11, 63, 74, 0.04);
}

.profile-stat-label {
  color: #5d7479;
  font-size: 0.82rem;
}

.projects-shell {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  padding: 2rem 1.4rem 2.4rem;
}

.projects-shell::before {
  content: "";
  position: fixed;
  inset: auto auto 8% 5%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 215, 199, 0.12), transparent 70%);
  pointer-events: none;
  filter: blur(8px);
}

.projects-hero {
  position: relative;
  overflow: hidden;
  max-width: 1240px;
  margin: 0 auto 1.25rem;
  padding: 1.65rem 1.75rem 1.5rem;
  border-radius: 1.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.projects-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.projects-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.projects-hero-copy {
  max-width: 720px;
}

.projects-hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(11, 63, 74, 0.08);
  color: #295c62;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.95rem;
}

.projects-hero-title {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: #0b3f4a;
}

.projects-hero-subtitle {
  margin: 0.8rem 0 0;
  max-width: 620px;
  color: #547177;
  font-size: 0.98rem;
  line-height: 1.6;
}

.projects-hero-actions {
  display: flex;
  align-items: stretch;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.projects-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 150px;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.projects-stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  color: #0b3f4a;
}

.projects-stat-label {
  margin-top: 0.35rem;
  color: #6a7f82;
  font-size: 0.83rem;
}

.projects-primary-btn,
.projects-secondary-btn,
.projects-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.78rem 1.1rem;
  border-radius: 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.projects-primary-btn {
  border: none;
  background: #0b3f4a;
  color: #fff;
  box-shadow: 0 10px 22px rgba(11, 63, 74, 0.16);
}

.projects-primary-btn:hover {
  background: #0f4f5d;
  color: #fff;
  transform: translateY(-1px);
}

.projects-secondary-btn {
  border: 1px solid rgba(11, 63, 74, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: #335a61;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.projects-secondary-btn:hover {
  background: #fff;
  color: #0b3f4a;
  transform: translateY(-1px);
}

.projects-open-link {
  border: 1px solid rgba(11, 63, 74, 0.1);
  background: linear-gradient(135deg, #0b3f4a, #10606d);
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 63, 74, 0.12);
}

.projects-open-link:hover {
  color: #fff;
  transform: translateY(-1px);
}

/* ── Models info section ── */

.projects-models-info {
  max-width: 1240px;
  margin: 0 auto 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(240,248,245,0.82) 100%);
  border: 1px solid rgba(16, 96, 109, 0.1);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(8px);
}

.projects-models-info-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  color: #0b3f4a;
}

.projects-models-info-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.projects-models-info-desc {
  margin: 0 0 0.9rem;
  color: #5d7479;
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: 720px;
}

.projects-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.projects-model-card {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(16, 96, 109, 0.08);
}

.projects-model-emoji {
  font-size: 1.1rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.projects-model-card strong {
  font-size: 0.84rem;
  color: #0b3f4a;
}

.projects-model-price {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #10606d;
  padding: 0.08rem 0.35rem;
  border-radius: 0.3rem;
  vertical-align: middle;
  margin-left: 0.2rem;
}

.projects-model-price--expensive {
  background: #c0392b;
}

.projects-model-use {
  font-size: 0.78rem;
  color: #6a8080;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.projects-models-notice {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.6rem;
  background: rgba(16, 96, 109, 0.06);
  border: 1px solid rgba(16, 96, 109, 0.1);
  font-size: 0.82rem;
  color: #335b62;
  line-height: 1.4;
}

.projects-models-notice svg {
  flex-shrink: 0;
  color: #10606d;
}

.projects-panel {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem;
  border-radius: 1.6rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(10px);
}

.projects-alert {
  border-radius: 1rem;
  border: 1px solid rgba(248, 113, 113, 0.18);
}

.projects-panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.projects-panel-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0b3f4a;
}

.projects-panel-subtitle {
  margin: 0.35rem 0 0;
  color: #5d7479;
  font-size: 0.95rem;
}

.projects-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: min(100%, 340px);
  padding: 0.82rem 0.95rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(11, 63, 74, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 24px rgba(15, 23, 42, 0.05);
  color: #8aa4a7;
}

.projects-search-wrap:focus-within {
  border-color: rgba(127, 215, 199, 0.65);
  box-shadow: 0 0 0 4px rgba(127, 215, 199, 0.18);
}

.projects-search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #0b3f4a;
  font-size: 0.95rem;
}

.projects-search-input::placeholder {
  color: #9ab0b3;
}

/* ── Panel toolbar (search + view toggle) ── */

.projects-panel-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.projects-view-toggle {
  display: flex;
  border: 1px solid rgba(11, 63, 74, 0.1);
  border-radius: 0.6rem;
  overflow: hidden;
}

.projects-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255, 255, 255, 0.6);
  color: #8aa4a7;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.projects-view-btn:not(:last-child) {
  border-right: 1px solid rgba(11, 63, 74, 0.08);
}

.projects-view-btn:hover {
  background: rgba(127, 215, 199, 0.12);
  color: #0b3f4a;
}

.projects-view-btn.active {
  background: #0b3f4a;
  color: #fff;
}

/* ── List view ── */

.projects-view-list .projects-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

.projects-view-list .projects-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: auto;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: none;
  background: transparent;
}

.projects-view-list .projects-card:first-child {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.projects-view-list .projects-card:hover {
  transform: none;
  box-shadow: none;
  background: rgba(127, 215, 199, 0.04);
}

.projects-view-list .projects-card-checkbox {
  position: static;
  order: -1;
  flex-shrink: 0;
  padding-left: 0.65rem;
}

.projects-view-list .projects-card-content {
  flex: 1;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  min-width: 0;
}

.projects-view-list .projects-card-topline {
  display: none;
}

.projects-view-list .projects-card-title {
  font-size: 0.92rem;
  min-width: 140px;
  flex-shrink: 0;
}

.projects-view-list .projects-card-domain {
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-view-list .projects-card-actions {
  margin-top: 0;
  gap: 0.5rem;
  flex-shrink: 0;
}

.projects-view-list .projects-card-updated-inline {
  display: inline;
  color: #8aa4a7;
  font-size: 0.78rem;
  white-space: nowrap;
}

.projects-view-grid .projects-card-updated-inline {
  display: none;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.projects-group:not(:last-child) {
  margin-bottom: 1.4rem;
}

.projects-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  background: #f1f1f1;
}

.projects-group-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #0b3f4a;
}

.projects-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(127, 215, 199, 0.18);
  color: #2d6b6f;
  font-size: 0.76rem;
  font-weight: 700;
}

.projects-group-grid {
  gap: 0.9rem;
}

.projects-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.92));
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.projects-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  border-color: rgba(203, 213, 225, 0.95);
}

.projects-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  padding: 1.25rem;
}

.projects-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.projects-card-meta {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(127, 215, 199, 0.18);
  color: #2d6b6f;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.projects-card-updated {
  color: #708487;
  font-size: 0.78rem;
  white-space: nowrap;
}

.projects-card-title {
  color: #0b3f4a;
  text-decoration: none;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.projects-card-title:hover {
  color: #0b3f4a;
}

.projects-card-domain {
  color: #637b80;
  font-size: 0.92rem;
  line-height: 1.55;
  word-break: break-word;
}

.projects-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  flex-wrap: wrap;
}

.projects-delete-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  background: rgba(220, 53, 69, 0.06);
  border: 1px solid rgba(220, 53, 69, 0.25);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.projects-delete-bar span {
  font-size: 0.88rem;
  font-weight: 600;
  color: #555;
}

.projects-select-all-btn {
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
}

.projects-select-all-btn:hover {
  border-color: #999;
  color: #333;
}

.projects-delete-btn {
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.projects-delete-btn:hover:not(:disabled) {
  background: #b02a37;
}

.projects-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.projects-delete-info {
  font-size: 0.78rem;
  font-weight: 400;
  color: #8a9399;
  font-style: italic;
  margin-left: auto;
}

.projects-card-checkbox {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.projects-card-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #c4cdd5;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.projects-card-checkbox input[type="checkbox"]:hover {
  border-color: #0b3f4a;
}

.projects-card-checkbox input[type="checkbox"]:checked {
  background: #0b3f4a;
  border-color: #0b3f4a;
}

.projects-card-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.projects-card:has(input:checked) {
  border-color: #0b3f4a;
  box-shadow: 0 0 0 2px rgba(11, 63, 74, 0.2), 0 10px 26px rgba(15, 23, 42, 0.06);
}

.projects-preview-banner {
  position: relative;
  overflow: hidden;
  min-height: 42px;
}

.projects-preview-banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.projects-preview-banner-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.55rem 1.5rem;
  text-align: center;
}

.projects-preview-banner-icon {
  flex-shrink: 0;
  color: #f0d98c;
  filter: drop-shadow(0 0 4px rgba(240, 217, 140, 0.5));
}

.projects-preview-banner-text {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.01em;
  line-height: 1.45;
}

.projects-preview-banner-text strong {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.projects-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 360px;
  padding: 2rem 1rem;
  text-align: center;
  border-radius: 1.35rem;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(248, 250, 252, 0.82));
}

.projects-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.85);
  color: #4b5563;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.projects-empty-state h3 {
  margin: 0;
  color: #0b3f4a;
  font-size: 1.35rem;
}

.projects-empty-state p {
  max-width: 520px;
  margin: 0;
  color: #647c80;
  line-height: 1.7;
}

/* ── Chat panel (left) ── */
.create-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, #f7faf8 0%, #edf3f1 100%);
  color: #1a1a1a;
  border-right: 1px solid #dfe9e5;
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.04);
}

.create-panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid #dfe9e5;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.create-panel-header h1 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #111;
}

.create-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.create-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.32rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(11, 63, 74, 0.08);
  background: rgba(255, 255, 255, 0.92);
  color: #47676d;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.create-action-btn:hover {
  background: #f6fbf9;
  border-color: rgba(11, 63, 74, 0.14);
  color: #0b3f4a;
}

.create-action-btn--primary {
  background: #0b3f4a;
  border-color: #0b3f4a;
  color: #fff;
}

.create-action-btn--primary:hover {
  background: #10606d;
  border-color: #10606d;
  color: #fff;
}

.create-action-btn--danger {
  border-color: #f5c6cb;
  color: #c0392b;
}

.create-action-btn--danger:hover {
  background: #fdf0f0;
  border-color: #e6a0a8;
}

.create-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.create-status {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: #5f787d;
  background: rgba(255, 255, 255, 0.74);
  border-bottom: 1px solid #dfe9e5;
  transition: background 0.25s ease, color 0.25s ease;
}

.create-status--running {
  background: linear-gradient(90deg, rgba(127, 215, 199, 0.18) 0%, rgba(127, 215, 199, 0.08) 50%, rgba(127, 215, 199, 0.18) 100%);
  background-size: 200% 100%;
  animation: status-pulse 2s ease-in-out infinite;
  color: #0b3f4a;
  font-weight: 500;
}

@keyframes status-pulse {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.create-chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
  background: linear-gradient(180deg, #f6faf8 0%, #edf3f1 100%);
}

.create-chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #dfe9e5;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.create-chat-form .form-label {
  display: none;
}

.create-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: #f7faf8;
  border: 1px solid #d8e5e1;
  border-radius: 0.75rem;
  padding: 0.5rem 0.55rem 0.5rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.create-chat-input-row:focus-within {
  border-color: #7fd7c7;
  box-shadow: 0 0 0 3px rgba(127, 215, 199, 0.2);
  background: #fff;
}

.create-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #1a1a1a;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  min-height: 1.5em;
  max-height: 160px;
  overflow-y: auto;
}

.create-chat-input::placeholder {
  color: #aaa;
}

.create-chat-send {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 0.55rem;
  background: #0b3f4a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.create-chat-send:hover {
  background: #10606d;
}

.create-chat-send:active {
  transform: scale(0.93);
}

.create-chat-send:disabled {
  opacity: 0.4;
  cursor: default;
}

.create-chat-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.create-chat-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}

.create-chat-toolbar-left .create-prompt-select {
  flex: 0 0 auto;
  min-width: 106px;
}

.create-chat-attach {
  border: none;
  background: transparent;
  color: #6a7f82;
  padding: 0.3rem;
  border-radius: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.create-chat-attach:hover {
  color: #0b3f4a;
  background: #eef7f4;
}

.create-chat-file-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.create-prompt-options-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.create-prompt-select {
  flex: 1;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  background: #f5f5f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  background-size: 10px 6px;
  border: 1px solid #d8e5e1;
  color: #335b62;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.42rem 1.8rem 0.42rem 0.65rem;
  border-radius: 0.55rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.create-prompt-select:hover {
  border-color: #bbb;
}

.create-prompt-select:focus {
  border-color: #7fd7c7;
  box-shadow: 0 0 0 3px rgba(127, 215, 199, 0.18);
  background-color: #fff;
}

.create-prompt-select:disabled {
  opacity: 0.5;
  cursor: default;
}

.create-prompt-pills {
  display: inline-flex;
  border-radius: 0.55rem;
  overflow: hidden;
  border: 1px solid #d8e5e1;
  flex-shrink: 0;
}

.create-prompt-pill {
  border: none;
  background: #f5f5f5;
  color: #777;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.2;
}

.create-prompt-pill:not(:last-child) {
  border-right: 1px solid #d8e5e1;
}

.create-prompt-pill:hover:not(.active):not(:disabled) {
  background: #eee;
  color: #444;
}

.create-prompt-pill.active {
  background: #0b3f4a;
  color: #fff;
}

.create-prompt-pill:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Tier button ── */

.create-tier-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #d8e5e1;
  background: #f5f8f7;
  color: #335b62;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.38rem 0.7rem;
  border-radius: 0.55rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  line-height: 1.3;
  flex-shrink: 0;
}

.create-tier-button:hover:not(:disabled) {
  border-color: #7fd7c7;
  background: #eef7f4;
}

.create-tier-button:focus-visible {
  border-color: #7fd7c7;
  box-shadow: 0 0 0 3px rgba(127, 215, 199, 0.18);
}

.create-tier-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.create-tier-button-emoji {
  font-size: 0.9rem;
  line-height: 1;
}

.create-tier-button-label {
  font-weight: 600;
  color: #0b3f4a;
}

.create-tier-button-price {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: #10606d;
  padding: 0.1rem 0.38rem;
  border-radius: 0.35rem;
  line-height: 1.3;
}

.create-tier-button-price--expensive {
  background: #c0392b;
}

/* ── Tier modal ── */

#tierModal .modal-content {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

#tierModal .modal-header {
  border-bottom: 1px solid #e8eeec;
  padding: 1.1rem 1.4rem;
}

#tierModal .modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0b3f4a;
}

#tierModal .modal-body {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.create-tier-option {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  border: 1.5px solid #e0e8e6;
  background: #fafcfb;
  border-radius: 0.7rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  outline: none;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.create-tier-option:hover:not(.active) {
  border-color: #b8d8d0;
  background: #f0f8f5;
}

.create-tier-option.active {
  border-color: #10606d;
  background: linear-gradient(135deg, rgba(16, 96, 109, 0.06) 0%, rgba(127, 215, 199, 0.08) 100%);
  box-shadow: 0 0 0 2px rgba(16, 96, 109, 0.12);
}

.create-tier-option:focus-visible {
  box-shadow: 0 0 0 3px rgba(127, 215, 199, 0.25);
}

.create-tier-option-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.create-tier-option-emoji {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.create-tier-option-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0b3f4a;
}

.create-tier-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #10606d;
  background: rgba(16, 96, 109, 0.1);
  padding: 0.12rem 0.4rem;
  border-radius: 0.3rem;
  line-height: 1.3;
}

.create-tier-option.active .create-tier-badge {
  background: rgba(16, 96, 109, 0.18);
  color: #0a5561;
}

.create-tier-option-price {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: #10606d;
  padding: 0.12rem 0.45rem;
  border-radius: 0.35rem;
  line-height: 1.3;
}

.create-tier-option-price--expensive {
  background: #c0392b;
}

.create-tier-option-details {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 1.45rem;
}

.create-tier-option-model {
  font-size: 0.74rem;
  font-weight: 500;
  color: #7a9a9e;
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

.create-tier-option-desc {
  font-size: 0.78rem;
  color: #6a8080;
  line-height: 1.4;
}

.create-chat-file-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.create-chat-file-picker.d-none {
  display: none;
}

.create-chat-file-picker select {
  flex: 1;
  min-width: 0;
  background: #fafafa;
  border: 1px solid #ddd;
  color: #1a1a1a;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
}

.create-chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #eff8f4;
  border: 1px solid #d0ebe3;
  color: #2d6b6f;
  font-size: 0.78rem;
  box-shadow: 0 6px 16px rgba(127, 215, 199, 0.16);
}

.create-chat-file-chip.d-none {
  display: none;
}

.create-chat-file-chip span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-chat-file-clear {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.create-chat-empty {
  margin: auto;
  padding: 1.5rem;
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
}

.create-message-row {
  display: flex;
  gap: 0.55rem;
}

.create-message-row-user {
  justify-content: flex-end;
}

.create-message-row-user .create-message-avatar {
  order: 2;
}

.create-message-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 1.75rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: #bbb;
}

.create-message-row-assistant .create-message-avatar {
  background: #0b3f4a;
}

.create-message {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.88rem;
  line-height: 1.55;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.create-message-user {
  background: #0b3f4a;
  color: #fff;
}

.create-message-assistant {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e8e8e8;
}

.create-message-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.45;
}

.create-message-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.create-message-token-box {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.28rem 0.55rem;
  border-radius: 0.5rem;
  background: #eff8f4;
  border: 1px solid #d0ebe3;
  color: #2d6b6f;
  font-size: 0.75rem;
  font-weight: 600;
}

.create-message-reference {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.create-message-user .create-message-reference {
  color: #93c5fd;
  background: rgba(255, 255, 255, 0.1);
}

.create-message-assistant .create-message-reference {
  color: #2d6b6f;
  background: rgba(127, 215, 199, 0.18);
}

/* ── Right panel (preview + code) ── */
.create-preview-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, #f7faf8 0%, #eef4f1 100%);
  box-shadow: inset 1px 0 0 rgba(15, 23, 42, 0.04);
}

.create-preview-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "title device actions";
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #dfe9e5;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.create-preview-header h2 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  color: #0b3f4a;
}

.create-preview-title {
  grid-area: title;
  justify-self: start;
  min-width: 0;
}

.create-preview-device-actions,
.create-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.create-preview-device-actions {
  grid-area: device;
  justify-self: center;
}

.create-preview-actions {
  grid-area: actions;
  justify-self: end;
  margin-left: auto;
}

.create-preview-device-actions .btn,
.create-preview-actions .btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
}

.create-preview-device-actions .btn,
.create-preview-actions .btn-ide-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  background: transparent;
  border: 1px solid #ddd;
  color: #888;
  transition: all 0.15s ease;
}

.create-preview-actions .btn-ide-tab--help {
  background: #10606d;
  border-color: #10606d;
  color: #fff;
}

.create-preview-actions .btn-ide-tab--help:hover {
  background: #0b3f4a;
  border-color: #0b3f4a;
  color: #fff;
}

.create-preview-device-actions .btn:hover,
.create-preview-actions .btn-ide-tab:hover {
  border-color: #aaa;
  color: #333;
}

.create-preview-device-actions .btn.active,
.create-preview-actions .btn-ide-tab.active {
  background: #0b3f4a;
  border-color: #0b3f4a;
  color: #fff;
}

.create-preview-frame-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.create-preview-frame-wrapper--mobile {
  padding: 1rem;
  align-items: flex-start;
  overflow: auto;
  background: linear-gradient(180deg, #edf4f1 0%, #e4ece9 100%);
}

.create-preview-device {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.create-preview-device--mobile {
  flex: 0 0 390px;
  width: 390px;
  max-width: 100%;
  height: 844px;
  min-height: 720px;
  border-radius: 1.4rem;
  overflow: hidden;
  border: 1px solid rgba(11, 63, 74, 0.16);
  background: #0f172a;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.2);
}

.create-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(180deg, #fcfdfc 0%, #f2f6f4 100%);
  overflow: hidden;
}

.create-preview-placeholder-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.create-preview-placeholder-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  border-radius: 1.6rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 42px rgba(11, 63, 74, 0.08);
  backdrop-filter: blur(10px);
}

.create-preview-placeholder-orb {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0b3f4a, #7fd7c7 70%, #eadfcf);
  box-shadow: 0 0 0 10px rgba(127, 215, 199, 0.12);
}

.create-preview-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.create-preview-console {
  display: flex;
  flex-direction: column;
  min-height: 140px;
  max-height: 220px;
  border-top: 1px solid rgba(11, 63, 74, 0.12);
  background: #0f172a;
}

.create-preview-console-output {
  flex: 1;
  overflow: auto;
  padding: 0.7rem 0.9rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.76rem;
  line-height: 1.55;
  color: #dbe7f1;
}

.create-preview-console-empty {
  color: #8ea1b5;
}

.create-preview-console-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  padding: 0.16rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.create-preview-console-time {
  color: #7dd3c8;
}

.create-preview-console-line-warn {
  color: #f6d28c;
}

.create-preview-console-line-error {
  color: #f5a3a3;
}

/* ── Code editor panel ── */
.create-code-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.create-code-panel.active {
  display: flex;
}

.create-preview-frame-wrapper.d-none-ide {
  display: none;
}

.create-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.create-code-current-file {
  flex: 1;
  min-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.create-code-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.create-code-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 500;
}

.create-code-filter input {
  margin: 0;
}

.create-code-toolbar .btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
}

.create-code-workspace {
  display: grid;
  grid-template-columns: 260px 1fr;
  flex: 1;
  min-height: 0;
}

.create-code-tree {
  min-height: 0;
  overflow: auto;
  padding: 0.75rem;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}

.create-code-tree-empty {
  color: #94a3b8;
  font-size: 0.82rem;
}

.create-tree-folder {
  margin-bottom: 0.2rem;
}

.create-tree-folder > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.create-tree-folder > summary::-webkit-details-marker {
  display: none;
}

.create-tree-folder > summary:hover {
  background: #eef2f7;
}

.create-tree-children {
  margin-left: 0.65rem;
  padding-left: 0.45rem;
  border-left: 1px solid #e5e7eb;
}

.create-tree-file {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  color: #475569;
  font-size: 0.82rem;
  cursor: pointer;
}

.create-tree-file:hover {
  background: #eef2f7;
  color: #0f172a;
}

.create-tree-file.active {
  background: #111827;
  color: #fff;
}

.create-code-editor {
  flex: 1;
  min-height: 0;
}

/* ── CLI panel ── */
.create-cli-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  height: 440px;
  border-top: 2px solid #333;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.create-cli-panel.d-none {
  display: none;
}

.create-cli-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem;
  background: #111;
  border-bottom: 1px solid #333;
}

.create-cli-header-title {
  font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.create-cli-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
}

.create-cli-close:hover {
  color: #fff;
}

.create-cli-output {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-all;
}

.create-cli-output div {
  padding: 1px 0;
}

.create-cli-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid #333;
  background: #111;
}

.create-cli-prompt {
  color: #6c9eff;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 600;
  user-select: none;
}

.create-cli-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #d4d4d4;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.8rem;
  caret-color: #6c9eff;
}

.create-cli-input::placeholder {
  color: #555;
}

.create-cli-input:disabled {
  opacity: 0.5;
}

/* ANSI color classes */
.ansi-bold { font-weight: 700; }
.ansi-black { color: #555; }
.ansi-red { color: #f87171; }
.ansi-green { color: #4ade80; }
.ansi-yellow { color: #fbbf24; }
.ansi-blue { color: #60a5fa; }
.ansi-magenta { color: #c084fc; }
.ansi-cyan { color: #22d3ee; }
.ansi-white { color: #e5e5e5; }

.create-chat-actions .btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* ── Scrollbar ── */
.create-chat-log::-webkit-scrollbar {
  width: 6px;
}

.create-chat-log::-webkit-scrollbar-track {
  background: transparent;
}

.create-chat-log::-webkit-scrollbar-thumb {
  background: #d5d5d5;
  border-radius: 3px;
}

.create-chat-log::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* ── Onboarding overlay ── */
.create-onboarding {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: #f7faf8;
  overflow: hidden;
}

.create-onboarding.active {
  display: flex;
}

.create-onboarding-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.create-onboarding-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}

.create-onboarding-logo {
  margin-bottom: 1.5rem;
}

.create-onboarding-logo svg {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

.create-onboarding-title {
  font-size: 2.4rem;
  font-weight: 700;
  color: #0b3f4a;
  margin: 0 0 0.6rem;
  letter-spacing: -0.03em;
}

.create-onboarding-subtitle {
  font-size: 1.08rem;
  color: #5e767b;
  margin: 0 0 2.2rem;
  font-weight: 400;
  line-height: 1.55;
}

.create-onboarding-features {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.create-onboarding-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.create-onboarding-feature-icon {
  width: 3.2rem;
  height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: #fff;
  color: #2d5d62;
  border: 1px solid #e2ece8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.create-onboarding-feature:hover .create-onboarding-feature-icon {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.create-onboarding-feature-label {
  font-size: 0.78rem;
  color: #6d8185;
  font-weight: 500;
}

.create-onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.create-onboarding-file-actions {
  justify-content: center;
}

.create-onboarding-form .create-prompt-options-bar {
  justify-content: center;
}

.create-onboarding-input {
  width: 100%;
  padding: 1.05rem 1.2rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #d8e5e1;
  border-radius: 1rem;
  resize: none;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.create-onboarding-input:focus {
  outline: none;
  border-color: #7fd7c7;
  box-shadow: 0 4px 24px rgba(127, 215, 199, 0.18);
  background: #fff;
}

.create-onboarding-input::placeholder {
  color: #bbb;
}

.create-onboarding-submit {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: #0b3f4a;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.create-onboarding-submit:hover {
  background: #10606d;
  box-shadow: 0 4px 16px rgba(11, 63, 74, 0.16);
}

.create-onboarding-submit:active {
  transform: scale(0.97);
}

/* ── Mobile info button & popover (hidden on desktop) ── */
.topbar-mobile-info-btn {
  display: none;
}

.topbar-mobile-popover {
  display: none;
}

/* ── Mobile tab bar (hidden on desktop) ── */
.create-mobile-tabs {
  display: none;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .create-topbar {
    overflow: visible;
  }

  .create-topbar-bg {
    overflow: hidden;
  }

  .projects-preview-banner-content {
    padding: 0.4rem 0.75rem;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .projects-preview-banner-text {
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .projects-preview-banner-text strong {
    display: block;
    font-size: 0.72rem;
  }

  .projects-preview-banner-icon {
    width: 14px;
    height: 14px;
  }

  .create-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    height: 100dvh;
    padding-bottom: 52px;
  }

  .create-chat-panel {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    min-height: 0;
  }

  .create-preview-panel {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    min-height: 0;
  }

  .create-page.mobile-show-chat .create-chat-panel {
    display: flex;
  }

  .create-page.mobile-show-chat .create-preview-panel {
    display: none;
  }

  .create-page.mobile-show-preview .create-chat-panel {
    display: none;
  }

  .create-page.mobile-show-preview .create-preview-panel {
    display: flex;
  }

  .create-mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 800;
    height: 52px;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #dfe9e5;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
  }

  .create-mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: none;
    background: transparent;
    color: #7c939a;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
  }

  .create-mobile-tab:hover {
    background: rgba(127, 215, 199, 0.08);
  }

  .create-mobile-tab.active {
    color: #0b3f4a;
  }

  .create-mobile-tab.active svg {
    color: #10606d;
  }

  .create-preview-header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "actions device";
    padding: 0.4rem 0.65rem;
  }

  .create-preview-title {
    display: none;
  }

  .create-preview-device-actions .btn,
  .create-preview-actions .btn {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }

  .create-panel-header {
    padding: 0.4rem 0.6rem;
  }

  .create-action-btn {
    font-size: 0.72rem;
    padding: 0.28rem 0.5rem;
  }

  .create-chat-form {
    padding: 0.5rem 0.65rem;
  }

  .create-code-workspace {
    grid-template-columns: 1fr;
  }

  .create-code-tree {
    display: none;
  }

  .create-code-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
  }

  .create-code-toolbar-actions {
    flex-wrap: nowrap;
  }

  .create-onboarding-card {
    padding: 2rem 1.25rem;
  }

  .create-onboarding-title {
    font-size: 1.5rem;
  }

  .create-onboarding-features {
    gap: 1rem;
  }

  .create-cli-panel {
    height: 320px;
    bottom: 52px;
  }

  .create-topbar-content .projects-topbar-usage,
  .create-topbar-content .projects-topbar-logout {
    display: none;
  }

  .topbar-mobile-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 0.45rem;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .topbar-mobile-info-btn:hover {
    background: rgba(159,227,215,0.18);
    color: #dff6ef;
  }

  .topbar-mobile-popover {
    display: none;
    position: absolute;
    top: 100%;
    right: 0.5rem;
    margin-top: 0.35rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #dfe9e5;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
    z-index: 100;
    min-width: 200px;
    flex-direction: column;
    gap: 0.5rem;
  }

  .topbar-mobile-popover.active {
    display: flex;
  }

  .topbar-mobile-popover-user {
    color: #0b3f4a;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
  }

  .topbar-mobile-popover-user:hover {
    color: #10606d;
  }

  .topbar-mobile-popover-usage {
    display: flex;
    align-items: center;
    gap: 0.55rem;
  }

  .topbar-mobile-popover-usage .projects-token-progress {
    background: rgba(11, 63, 74, 0.1);
  }

  .topbar-mobile-popover-label {
    color: #5d7479;
    text-shadow: none;
  }

  .projects-shell {
    padding: 3rem 0.85rem 1.4rem;
  }

  .projects-hero {
    padding: 1.4rem 1.15rem;
    border-radius: 1.3rem;
  }

  .projects-panel {
    padding: 1rem;
    border-radius: 1.2rem;
  }

  .projects-hero-title {
    font-size: 2rem;
  }

  .projects-hero-subtitle {
    font-size: 0.95rem;
  }

  .projects-hero-actions,
  .projects-card-actions {
    width: 100%;
  }

  .projects-stat-card,
  .projects-primary-btn,
  .projects-secondary-btn,
  .projects-open-link,
  .projects-search-wrap {
    width: 100%;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-view-list .projects-card-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .projects-view-list .projects-card-title {
    min-width: 0;
  }

  .projects-view-list .projects-card-domain {
    white-space: normal;
  }

  .projects-view-list .projects-card-actions {
    width: 100%;
  }

  .projects-panel-toolbar {
    width: 100%;
  }
}

/* ── Dark mode mobile tab bar ── */
@media (max-width: 768px) {
  .dark-mode .create-mobile-tabs {
    background: rgba(17, 24, 39, 0.96);
    border-top-color: #1e293b;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
  }

  .dark-mode .create-mobile-tab {
    color: #4b5563;
  }

  .dark-mode .create-mobile-tab:hover {
    background: rgba(127, 215, 199, 0.06);
  }

  .dark-mode .create-mobile-tab.active {
    color: #7fd7c7;
  }

  .dark-mode .create-mobile-tab.active svg {
    color: #7fd7c7;
  }

  .dark-mode .topbar-mobile-popover {
    background: rgba(17, 24, 39, 0.96);
    border-color: #1e293b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .dark-mode .topbar-mobile-popover-user {
    color: #e2e8f0;
  }

  .dark-mode .topbar-mobile-popover-user:hover {
    color: #7fd7c7;
  }

  .dark-mode .topbar-mobile-popover-usage .projects-token-progress {
    background: rgba(148, 163, 184, 0.15);
  }

  .dark-mode .topbar-mobile-popover-label {
    color: #94a3b8;
  }
}

/* ── Dark mode toggle button ── */
.create-darkmode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 0.45rem;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  margin-left: auto;
}

.create-darkmode-toggle:hover {
  background: rgba(159,227,215,0.18);
  color: #dff6ef;
}

.create-darkmode-icon-sun {
  display: none;
}

.dark-mode .create-darkmode-icon-moon {
  display: none;
}

.dark-mode .create-darkmode-icon-sun {
  display: block;
}

/* ── Dark mode ── */
.dark-mode,
.dark-mode body {
  color: #d4dde4;
  background: #0f1520;
}

.dark-mode .create-page {
  background:
    radial-gradient(circle at top left, rgba(127, 215, 199, 0.06), transparent 32%),
    radial-gradient(circle at top right, rgba(234, 220, 200, 0.04), transparent 28%),
    #111827;
}

.dark-mode .create-chat-panel {
  background: linear-gradient(180deg, #111827 0%, #0f1520 100%);
  color: #d4dde4;
  border-right-color: #1e293b;
}

.dark-mode .create-panel-header {
  background: rgba(17, 24, 39, 0.92);
  border-bottom-color: #1e293b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.dark-mode .create-panel-header h1 {
  color: #e2e8f0;
}

.dark-mode .create-action-btn {
  border-color: rgba(148, 163, 184, 0.15);
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dark-mode .create-action-btn:hover {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

.dark-mode .create-action-btn--primary {
  background: #0f4f5d;
  border-color: #0f4f5d;
  color: #fff;
}

.dark-mode .create-action-btn--primary:hover {
  background: #10606d;
  border-color: #10606d;
}

.dark-mode .create-action-btn--danger {
  border-color: rgba(248, 113, 113, 0.25);
  color: #f87171;
}

.dark-mode .create-action-btn--danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
}

.dark-mode .create-status {
  color: #7c939a;
  background: rgba(17, 24, 39, 0.7);
  border-bottom-color: #1e293b;
}

.dark-mode .create-status--running {
  background: linear-gradient(90deg, rgba(127, 215, 199, 0.1) 0%, rgba(127, 215, 199, 0.03) 50%, rgba(127, 215, 199, 0.1) 100%);
  background-size: 200% 100%;
  animation: status-pulse 2s ease-in-out infinite;
  color: #7fd7c7;
}

.dark-mode .create-chat-log {
  background: linear-gradient(180deg, #111827 0%, #0f1520 100%);
}

.dark-mode .create-chat-empty {
  color: #4b5563;
}

.dark-mode .create-message-assistant {
  background: #1e293b;
  color: #d4dde4;
  border-color: #334155;
}

.dark-mode .create-message-user {
  background: #0b3f4a;
  color: #fff;
}

.dark-mode .create-message-token-box {
  background: rgba(127, 215, 199, 0.1);
  border-color: rgba(127, 215, 199, 0.2);
  color: #7fd7c7;
}

.dark-mode .create-message-avatar {
  background: #374151;
}

.dark-mode .create-message-row-assistant .create-message-avatar {
  background: #0b3f4a;
}

.dark-mode .create-chat-form {
  border-top-color: #1e293b;
  background: rgba(17, 24, 39, 0.95);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.3);
}

.dark-mode .create-chat-input-row {
  background: #1e293b;
  border-color: #334155;
}

.dark-mode .create-chat-input-row:focus-within {
  border-color: #7fd7c7;
  box-shadow: 0 0 0 3px rgba(127, 215, 199, 0.15);
  background: #1a2332;
}

.dark-mode .create-chat-input {
  color: #e2e8f0;
}

.dark-mode .create-chat-input::placeholder {
  color: #4b5563;
}

.dark-mode .create-chat-send {
  background: #0f4f5d;
}

.dark-mode .create-chat-send:hover {
  background: #10606d;
}

.dark-mode .create-prompt-select {
  background-color: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.dark-mode .create-prompt-select:focus {
  border-color: #7fd7c7;
  box-shadow: 0 0 0 3px rgba(127, 215, 199, 0.12);
  background-color: #1a2332;
}

.dark-mode .create-prompt-pills {
  border-color: #334155;
}

.dark-mode .create-prompt-pill {
  background: #1e293b;
  color: #64748b;
}

.dark-mode .create-prompt-pill:not(:last-child) {
  border-right-color: #334155;
}

.dark-mode .create-prompt-pill:hover:not(.active):not(:disabled) {
  background: #263043;
  color: #94a3b8;
}

.dark-mode .create-prompt-pill.active {
  background: #0f4f5d;
  color: #fff;
}

/* ── Dark mode: Tier button ── */

.dark-mode .create-tier-button {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.dark-mode .create-tier-button:hover:not(:disabled) {
  border-color: #7fd7c7;
  background: #263043;
}

.dark-mode .create-tier-button:focus-visible {
  border-color: #7fd7c7;
  box-shadow: 0 0 0 3px rgba(127, 215, 199, 0.12);
}

.dark-mode .create-tier-button-label {
  color: #e2e8f0;
}

.dark-mode .create-tier-button-price {
  background: #0f4f5d;
  color: #d1faf0;
}

/* ── Dark mode: Tier modal ── */

.dark-mode #tierModal .modal-content {
  background: #111827;
  color: #e2e8f0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dark-mode #tierModal .modal-header {
  border-bottom-color: #1e293b;
}

.dark-mode #tierModal .modal-title {
  color: #e2e8f0;
}

.dark-mode #tierModal .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.dark-mode .create-tier-option {
  border-color: #283040;
  background: #0f172a;
}

.dark-mode .create-tier-option:hover:not(.active) {
  border-color: #3b5060;
  background: #162030;
}

.dark-mode .create-tier-option.active {
  border-color: #1a8a9a;
  background: linear-gradient(135deg, rgba(16, 96, 109, 0.15) 0%, rgba(127, 215, 199, 0.08) 100%);
  box-shadow: 0 0 0 2px rgba(26, 138, 154, 0.2);
}

.dark-mode .create-tier-option-label {
  color: #e2e8f0;
}

.dark-mode .create-tier-badge {
  color: #7fd7c7;
  background: rgba(127, 215, 199, 0.12);
}

.dark-mode .create-tier-option.active .create-tier-badge {
  background: rgba(127, 215, 199, 0.18);
  color: #9fe3d7;
}

.dark-mode .create-tier-option-price {
  background: #0f4f5d;
  color: #d1faf0;
}

.dark-mode .create-tier-button-price--expensive,
.dark-mode .create-tier-option-price--expensive {
  background: #a93226;
  color: #fde8e6;
}

.dark-mode .create-tier-option-model {
  color: #5e7f84;
}

.dark-mode .create-tier-option-desc {
  color: #6b8a8e;
}

.dark-mode .create-chat-attach {
  color: #64748b;
}

.dark-mode .create-chat-attach:hover {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
}

.dark-mode .create-chat-file-chip {
  background: rgba(127, 215, 199, 0.1);
  border-color: rgba(127, 215, 199, 0.2);
  color: #7fd7c7;
}

.dark-mode .create-preview-panel {
  background: linear-gradient(180deg, #111827 0%, #0d1117 100%);
}

.dark-mode .create-preview-header {
  background: rgba(17, 24, 39, 0.92);
  border-bottom-color: #1e293b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.dark-mode .create-preview-header h2 {
  color: #e2e8f0;
}

.dark-mode .create-preview-device-actions .btn,
.dark-mode .create-preview-actions .btn-ide-tab {
  border-color: #334155;
  color: #64748b;
}

.dark-mode .create-preview-actions .btn-ide-tab--help {
  background: #10606d;
  border-color: #10606d;
  color: #fff;
}

.dark-mode .create-preview-actions .btn-ide-tab--help:hover {
  background: #14808f;
  border-color: #14808f;
  color: #fff;
}

.dark-mode .help-item {
  background: rgba(10, 30, 40, 0.6);
  border-left-color: #1a8a9a;
}

.dark-mode #helpModal .modal-content {
  background: #111827;
  color: #e2e8f0;
}

.dark-mode #helpModal .modal-header {
  border-bottom-color: #1e293b;
}

.dark-mode #helpModal .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.dark-mode .help-item-header {
  color: #9fe3d7;
}

.dark-mode .help-item-header svg {
  color: #9fe3d7;
  fill: #9fe3d7;
}

.dark-mode .help-item-header svg:not([fill="currentColor"]) {
  stroke: #9fe3d7;
}

.dark-mode .help-item-text {
  color: #e2e8f0;
}

.dark-mode .create-preview-device-actions .btn:hover,
.dark-mode .create-preview-actions .btn-ide-tab:hover {
  border-color: #475569;
  color: #94a3b8;
}

.dark-mode .create-preview-device-actions .btn.active,
.dark-mode .create-preview-actions .btn-ide-tab.active {
  background: #0f4f5d;
  border-color: #0f4f5d;
  color: #fff;
}

.dark-mode .create-preview-frame-wrapper {
  border-color: rgba(148, 163, 184, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.dark-mode .create-preview-frame-wrapper--mobile {
  background: linear-gradient(180deg, #0f1520 0%, #0d1117 100%);
}

.dark-mode .create-preview-placeholder {
  background: linear-gradient(180deg, #111827 0%, #0d1117 100%);
}

.dark-mode .create-preview-placeholder-mark {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(51, 65, 85, 0.5);
}

.dark-mode .create-code-toolbar {
  background: rgba(17, 24, 39, 0.92);
  border-bottom-color: #1e293b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.dark-mode .create-code-current-file {
  color: #94a3b8;
}

.dark-mode .create-code-filter {
  border-color: #334155;
  background: #1e293b;
  color: #94a3b8;
}

.dark-mode .create-code-toolbar .btn {
  color: #94a3b8;
  border-color: #334155;
}

.dark-mode .create-code-toolbar .btn:hover {
  color: #e2e8f0;
  border-color: #475569;
}

.dark-mode .create-code-toolbar .btn-outline-success {
  color: #7fd7c7;
  border-color: rgba(127, 215, 199, 0.3);
}

.dark-mode .create-code-toolbar .btn-outline-success:hover {
  background: rgba(127, 215, 199, 0.12);
  color: #9fe3d7;
}

.dark-mode .create-code-toolbar .btn-outline-danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.25);
}

.dark-mode .create-code-toolbar .btn-outline-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

.dark-mode .create-code-tree {
  background: #0d1117;
  border-right-color: #1e293b;
}

.dark-mode .create-code-tree-empty {
  color: #4b5563;
}

.dark-mode .create-tree-folder > summary {
  color: #94a3b8;
}

.dark-mode .create-tree-folder > summary:hover {
  background: #1e293b;
}

.dark-mode .create-tree-children {
  border-left-color: #1e293b;
}

.dark-mode .create-tree-file {
  color: #94a3b8;
}

.dark-mode .create-tree-file:hover {
  background: #1e293b;
  color: #e2e8f0;
}

.dark-mode .create-tree-file.active {
  background: #0f4f5d;
  color: #fff;
}

.dark-mode .create-chat-log::-webkit-scrollbar-thumb {
  background: #334155;
}

.dark-mode .create-chat-log::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.dark-mode .create-onboarding {
  background: #0f1520;
}

.dark-mode .create-onboarding-title {
  color: #e2e8f0;
}

.dark-mode .create-onboarding-subtitle {
  color: #7c939a;
}

.dark-mode .create-onboarding-feature-icon {
  background: #1e293b;
  color: #7fd7c7;
  border-color: #334155;
}

.dark-mode .create-onboarding-feature-label {
  color: #7c939a;
}

.dark-mode .create-onboarding-input {
  color: #e2e8f0;
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode .create-onboarding-input:focus {
  border-color: #7fd7c7;
  box-shadow: 0 4px 24px rgba(127, 215, 199, 0.12);
  background: #1a2332;
}

.dark-mode .create-onboarding-input::placeholder {
  color: #4b5563;
}

.dark-mode .create-onboarding-submit {
  background: #0f4f5d;
}

.dark-mode .create-onboarding-submit:hover {
  background: #10606d;
}

.dark-mode .create-chat-actions .btn.active {
  background: #0f4f5d;
  color: #fff;
  border-color: #0f4f5d;
}

.dark-mode .projects-delete-bar {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.3);
}

.dark-mode .projects-delete-bar span {
  color: #e2e8f0;
}

.dark-mode .projects-select-all-btn {
  border-color: #475569;
  color: #94a3b8;
}

.dark-mode .projects-select-all-btn:hover {
  border-color: #64748b;
  color: #e2e8f0;
}

.dark-mode .projects-card-checkbox input[type="checkbox"] {
  border-color: #475569;
  background: rgba(30, 41, 59, 0.85);
}

.dark-mode .projects-card-checkbox input[type="checkbox"]:hover {
  border-color: #7fd7c7;
}

.dark-mode .projects-card-checkbox input[type="checkbox"]:checked {
  background: #10606d;
  border-color: #10606d;
}

.dark-mode .projects-card:has(input:checked) {
  border-color: #7fd7c7;
  box-shadow: 0 0 0 2px rgba(127, 215, 199, 0.25), 0 10px 26px rgba(0, 0, 0, 0.15);
}

/* ── Dark mode: Models info ── */

.dark-mode .projects-models-info {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.92) 0%, rgba(15, 30, 35, 0.88) 100%);
  border-color: #1e293b;
}

.dark-mode .projects-models-info-header {
  color: #e2e8f0;
}

.dark-mode .projects-models-info-desc {
  color: #94a3b8;
}

.dark-mode .projects-model-card {
  background: rgba(30, 41, 59, 0.6);
  border-color: #283040;
}

.dark-mode .projects-model-card strong {
  color: #e2e8f0;
}

.dark-mode .projects-model-price {
  background: #0f4f5d;
  color: #d1faf0;
}

.dark-mode .projects-model-price--expensive {
  background: #a93226;
  color: #fde8e6;
}

.dark-mode .projects-model-use {
  color: #6b8a8e;
}

.dark-mode .projects-models-notice {
  background: rgba(16, 96, 109, 0.1);
  border-color: rgba(26, 138, 154, 0.2);
  color: #94a3b8;
}

.dark-mode .projects-models-notice svg {
  color: #7fd7c7;
}

/* ── Dark mode: View toggle ── */

.dark-mode .projects-view-toggle {
  border-color: #334155;
}

.dark-mode .projects-view-btn {
  background: rgba(30, 41, 59, 0.7);
  color: #64748b;
}

.dark-mode .projects-view-btn:not(:last-child) {
  border-right-color: #334155;
}

.dark-mode .projects-view-btn:hover {
  background: rgba(127, 215, 199, 0.08);
  color: #94a3b8;
}

.dark-mode .projects-view-btn.active {
  background: #10606d;
  color: #fff;
}

/* ── Dark mode: List view ── */

.dark-mode .projects-view-list .projects-card {
  background: transparent;
  border-bottom-color: #1e293b;
}

.dark-mode .projects-view-list .projects-card:first-child {
  border-top-color: #1e293b;
}

.dark-mode .projects-view-list .projects-card:hover {
  background: rgba(127, 215, 199, 0.03);
}

.dark-mode .projects-view-list .projects-card-updated-inline {
  color: #4b5e66;
}

.dark-mode .projects-group-header {
  background: #1e293b;
}

.dark-mode .projects-group-title {
  color: #e2e8f0;
}

.dark-mode .projects-group-count {
  background: rgba(127, 215, 199, 0.12);
  color: #7fd7c7;
}

/* ── Dark mode: Projects page core ── */

.dark-mode .projects-page {
  background:
    radial-gradient(circle at top left, rgba(127, 215, 199, 0.06), transparent 28%),
    radial-gradient(circle at top right, rgba(234, 220, 200, 0.04), transparent 26%),
    #0f1520;
}

.dark-mode .projects-shell::before {
  background: radial-gradient(circle, rgba(127, 215, 199, 0.05), transparent 70%);
}

.dark-mode .projects-hero {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 35, 0.85));
  border-color: #1e293b;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.dark-mode .projects-hero-kicker {
  background: rgba(127, 215, 199, 0.1);
  color: #7fd7c7;
}

.dark-mode .projects-hero-title {
  color: #e2e8f0;
}

.dark-mode .projects-hero-subtitle {
  color: #7c939a;
}

.dark-mode .projects-stat-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: #334155;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.15);
}

.dark-mode .projects-stat-value {
  color: #e2e8f0;
}

.dark-mode .projects-stat-label {
  color: #64748b;
}

.dark-mode .projects-primary-btn {
  background: #10606d;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.dark-mode .projects-primary-btn:hover {
  background: #1a8a9a;
}

.dark-mode .projects-secondary-btn {
  border-color: #334155;
  background: rgba(30, 41, 59, 0.7);
  color: #94a3b8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.dark-mode .projects-secondary-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
  border-color: #475569;
}

.dark-mode .projects-open-link {
  background: linear-gradient(135deg, #0f4f5d, #10606d);
  border-color: #1a8a9a;
}

/* ── Dark mode: Panel ── */

.dark-mode .projects-panel {
  background: rgba(17, 24, 39, 0.7);
  border-color: #1e293b;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
}

.dark-mode .projects-panel-title {
  color: #e2e8f0;
}

.dark-mode .projects-panel-subtitle {
  color: #64748b;
}

.dark-mode .projects-search-wrap {
  background: rgba(30, 41, 59, 0.7);
  border-color: #334155;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 24px rgba(0, 0, 0, 0.1);
  color: #64748b;
}

.dark-mode .projects-search-wrap:focus-within {
  border-color: rgba(127, 215, 199, 0.5);
  box-shadow: 0 0 0 4px rgba(127, 215, 199, 0.1);
}

.dark-mode .projects-search-input {
  color: #e2e8f0;
}

.dark-mode .projects-search-input::placeholder {
  color: #4b5e66;
}

/* ── Dark mode: Cards ── */

.dark-mode .projects-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.8), rgba(22, 32, 48, 0.75));
  border-color: #283040;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15);
}

.dark-mode .projects-card:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  border-color: #3b5060;
}

.dark-mode .projects-card-meta {
  background: rgba(127, 215, 199, 0.1);
  color: #7fd7c7;
}

.dark-mode .projects-card-updated {
  color: #4b5e66;
}

.dark-mode .projects-card-title {
  color: #e2e8f0;
}

.dark-mode .projects-card-title:hover {
  color: #e2e8f0;
}

.dark-mode .projects-card-domain {
  color: #6b8a8e;
}

/* ── Dark mode: Delete bar ── */

.dark-mode .projects-delete-info {
  color: #64748b;
}

/* ── Dark mode: Empty state ── */

.dark-mode .projects-empty-state {
  border-color: rgba(71, 85, 105, 0.4);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.5), rgba(22, 32, 48, 0.6));
}

.dark-mode .projects-empty-icon {
  background: rgba(30, 41, 59, 0.85);
  color: #64748b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.dark-mode .projects-empty-state h3 {
  color: #e2e8f0;
}

.dark-mode .projects-empty-state p {
  color: #7c939a;
}

/* ── Dark mode: Topbar user/logout ── */

.dark-mode .projects-topbar-user {
  color: rgba(255, 255, 255, 0.85);
}

.dark-mode .projects-topbar-user:hover {
  color: #fff;
}

.dark-mode .projects-topbar-logout {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .projects-topbar-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Dark mode: Modals on /list ── */

.dark-mode #createModal .modal-content,
.dark-mode #renameModal .modal-content {
  background: #111827;
  color: #e2e8f0;
}

.dark-mode #createModal .modal-header,
.dark-mode #renameModal .modal-header {
  border-bottom-color: #1e293b;
}

.dark-mode #createModal .modal-footer,
.dark-mode #renameModal .modal-footer {
  border-top-color: #1e293b;
}

.dark-mode #createModal .btn-close,
.dark-mode #renameModal .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.dark-mode #createModal .form-control,
.dark-mode #renameModal .form-control {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

.dark-mode #createModal .form-control:focus,
.dark-mode #renameModal .form-control:focus {
  border-color: #7fd7c7;
  box-shadow: 0 0 0 3px rgba(127, 215, 199, 0.12);
  background: #1a2332;
}

.dark-mode #createModal .form-label,
.dark-mode #renameModal .form-label {
  color: #94a3b8;
}

.dark-mode #createModal .form-text {
  color: #64748b;
}

.dark-mode #createModal .btn-secondary,
.dark-mode #renameModal .btn-secondary {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.dark-mode #createModal .btn-dark,
.dark-mode #renameModal .btn-dark {
  background: #10606d;
  border-color: #10606d;
}

/* ── Dark mode: Alert ── */

.dark-mode .projects-alert {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.3);
  color: #f87171;
}

/* ════════════════════════════════════════════════════════════════
   CHAT PAGE – Light Discord Clone
   ════════════════════════════════════════════════════════════════ */

.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(127, 215, 199, 0.10), transparent 32%),
    radial-gradient(circle at bottom right, rgba(234, 220, 200, 0.10), transparent 28%),
    #f4f6f4;
}

.chat-topbar {
  flex-shrink: 0;
}

/* ── Chat body (sidebar + main) ── */

.chat-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar ── */

.chat-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #0e2a30;
  border-right: 1px solid rgba(127, 215, 199, 0.12);
}

.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(127, 215, 199, 0.10);
}

.chat-sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
}

.chat-add-channel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.chat-add-channel-btn:hover {
  background: rgba(159, 227, 215, 0.15);
  color: #9fe3d7;
}

.chat-channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.chat-channel-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  font-size: 0.88rem;
  border-radius: 0;
  transition: background 0.12s, color 0.12s;
}

.chat-channel-item:hover {
  background: rgba(159, 227, 215, 0.08);
  color: rgba(255,255,255,0.85);
}

.chat-channel-item--active {
  background: rgba(159, 227, 215, 0.14);
  color: #fff;
}

.chat-channel-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}

.chat-channel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-channel-item--unread {
  color: #fff;
  font-weight: 600;
}

.chat-unread-badge {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.chat-no-channels {
  padding: 1.2rem 0.85rem;
  color: rgba(255,255,255,0.3);
  font-size: 0.82rem;
  text-align: center;
}

/* ── Main area ── */

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
}

.chat-channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  gap: 0.5rem;
}

.chat-channel-header-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.chat-channel-header-icon {
  font-size: 1.1rem;
  opacity: 0.6;
}

.chat-channel-header-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
}

.chat-channel-header-desc {
  font-size: 0.78rem;
  color: #888;
  margin-left: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-channel-header-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-shrink: 0;
}

.chat-header-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.5rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #666;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.chat-header-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.chat-header-btn--danger:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.chat-pinned-count {
  font-weight: 600;
  color: #d97706;
}

/* ── Messages ── */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.chat-message {
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  transition: background 0.12s;
  position: relative;
}

.chat-message:hover {
  background: #f7f7f8;
}

.chat-message:hover .chat-message-actions {
  opacity: 1;
}

.chat-message--pinned {
  border-left: 3px solid #d97706;
  background: rgba(217, 119, 6, 0.04);
}

/* ── Message grouping (continuation) ── */

.chat-message--continuation {
  padding-top: 0.1rem;
}

.chat-message--continuation .chat-message-header {
  display: none;
}

.chat-message--continuation .chat-message-content {
  padding-left: 2.1rem;
}

/* ── Unread divider ── */

.chat-new-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0;
  color: #dc3545;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-new-divider::before,
.chat-new-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #dc3545;
  opacity: 0.45;
}

/* ── Reactions ── */

.chat-reactions {
  padding-left: 2.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  min-height: 0;
  margin-top: 0.2rem;
}

.chat-reactions:empty,
.chat-reactions:not(:has(.chat-reaction-chip)) .chat-reaction-add {
  opacity: 0;
}

.chat-message:hover .chat-reactions .chat-reaction-add {
  opacity: 1;
}

.chat-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f7f7f8;
  cursor: pointer;
  font-size: 0.78rem;
  transition: background 0.12s, border-color 0.12s;
}

.chat-reaction-chip:hover {
  background: #eef0f2;
  border-color: #ccc;
}

.chat-reaction-chip--mine {
  background: rgba(16, 96, 109, 0.08);
  border-color: rgba(16, 96, 109, 0.3);
}

.chat-reaction-emoji {
  font-size: 0.88rem;
  line-height: 1;
}

.chat-reaction-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: #555;
}

.chat-reaction-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px dashed #d1d5db;
  border-radius: 50%;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, opacity 0.15s;
}

.chat-reaction-add:hover {
  background: #f0f0f0;
  color: #555;
  border-style: solid;
}

.chat-reaction-info {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #bbb;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s, background 0.12s;
}

.chat-reaction-info:hover {
  background: #f0f0f0;
  color: #666;
}

.dark-mode .chat-reaction-info {
  color: rgba(255,255,255,0.25);
}

.dark-mode .chat-reaction-info:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
}

/* ── Reaction detail modal ── */

.chat-reaction-detail-modal {
  max-width: 320px;
  min-width: 220px;
}

.chat-reaction-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f0ede5;
}

.chat-reaction-detail-row:last-child {
  border-bottom: none;
}

.chat-reaction-detail-emoji {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.chat-reaction-detail-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
}

.chat-reaction-detail-user {
  font-size: 0.82rem;
  color: #333;
  font-weight: 500;
}

.dark-mode .chat-reaction-detail-row {
  border-bottom-color: rgba(255,255,255,0.06);
}

.dark-mode .chat-reaction-detail-user {
  color: rgba(255,255,255,0.75);
}

/* ── Emoji picker ── */

.chat-emoji-picker {
  position: fixed;
  z-index: 200;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 0.5rem;
}

.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.15rem;
}

.chat-emoji-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.12s;
}

.chat-emoji-btn:hover {
  background: #f0f0f0;
}

/* ── Link previews ── */

.chat-link {
  color: #10606d;
  text-decoration: underline;
  word-break: break-all;
}

.chat-link:hover {
  color: #0b3f4a;
}

.chat-link-preview {
  display: flex;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  margin-top: 0.35rem;
  margin-left: 2.1rem;
  border-left: 3px solid #10606d;
  background: #f9fafb;
  border-radius: 4px;
  max-width: 480px;
  overflow: hidden;
}

.chat-link-preview-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.chat-link-preview-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.chat-link-preview-site {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  font-weight: 600;
}

.chat-link-preview-title {
  font-size: 0.82rem;
  color: #10606d;
  line-height: 1.3;
}

.chat-link-preview-desc {
  font-size: 0.76rem;
  color: #666;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── YouTube embed ── */

.chat-youtube-embed {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 225px;
  margin: 0.4rem 0 0.2rem 2.1rem;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.chat-youtube-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

/* ── Edited badge ── */

.chat-message-edited {
  font-size: 0.68rem;
  color: #aaa;
  font-weight: 400;
  font-style: italic;
}

/* ── Inline edit ── */

.chat-edit-textarea {
  width: 100%;
  border: 1px solid #10606d;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.4;
  resize: vertical;
  min-height: 2.2rem;
  max-height: 200px;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(16, 96, 109, 0.12);
}

.chat-edit-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.chat-edit-save,
.chat-edit-cancel {
  border: none;
  border-radius: 4px;
  padding: 0.2rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

.chat-edit-save {
  background: #0b3f4a;
  color: #fff;
}

.chat-edit-save:hover {
  background: #10606d;
}

.chat-edit-cancel {
  background: transparent;
  color: #888;
}

.chat-edit-cancel:hover {
  background: #f0f0f0;
  color: #333;
}

/* ── Search panel ── */

.chat-search-panel {
  border-bottom: 1px solid #e5e7eb;
  background: #fefdf8;
  flex-shrink: 0;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.chat-search-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #f0ebe0;
}

.chat-search-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.chat-search-input:focus {
  border-color: #10606d;
  box-shadow: 0 0 0 2px rgba(16, 96, 109, 0.12);
}

.chat-search-close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: #888;
}

.chat-search-results {
  overflow-y: auto;
  padding: 0.3rem 1rem 0.5rem;
}

.chat-search-result {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0ebe0;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s;
}

.chat-search-result:hover {
  background: rgba(16, 96, 109, 0.05);
}

.chat-search-result:last-child {
  border-bottom: none;
}

.chat-search-result strong {
  font-size: 0.8rem;
  color: #1a1a1a;
}

.chat-search-result time {
  font-size: 0.68rem;
  color: #aaa;
  margin-left: 0.35rem;
}

.chat-search-result p {
  font-size: 0.78rem;
  color: #555;
  margin: 0.15rem 0 0;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-search-empty {
  padding: 0.8rem 0;
  text-align: center;
  color: #aaa;
  font-size: 0.82rem;
}

/* ── Message highlight (search jump) ── */

.chat-message--highlight {
  animation: chat-highlight-flash 2s ease-out;
}

@keyframes chat-highlight-flash {
  0%, 30% { background: rgba(16, 96, 109, 0.12); }
  100% { background: transparent; }
}

/* ── Toast container ── */

.chat-toast-container {
  position: absolute;
  bottom: 5rem;
  right: 1rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: none;
}

.chat-toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  pointer-events: auto;
  animation: chat-toast-in 0.25s ease-out;
  transition: opacity 0.4s;
}

.chat-toast--success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.chat-toast--danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.chat-toast--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.chat-toast--fade {
  opacity: 0;
}

.chat-toast-close {
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  margin-left: auto;
  line-height: 1;
}

.chat-toast-close:hover {
  opacity: 1;
}

@keyframes chat-toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Jump to latest button ── */

.chat-jump-latest {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 0.78rem;
  font-weight: 600;
  color: #10606d;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
}

.chat-jump-latest:hover {
  background: #f0f9f7;
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}

/* ── Drag-and-drop overlay ── */

.chat-main.chat-drag-over {
  outline: 2px dashed #10606d;
  outline-offset: -4px;
  background: rgba(16, 96, 109, 0.04);
}

.chat-message-reply-ref {
  display: flex;
  align-items: stretch;
  gap: 0;
  font-size: 0.78rem;
  color: #888;
  margin-left: 2.1rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s;
}

.chat-message-reply-ref:hover {
  background: rgba(0,0,0,0.03);
}

.chat-reply-line {
  width: 2px;
  min-height: 100%;
  border-radius: 1px;
  background: #10606d;
  flex-shrink: 0;
  margin-right: 0.5rem;
  opacity: 0.5;
}

.chat-reply-ref-body {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.4rem 0.2rem 0;
  min-width: 0;
}

.chat-reply-ref-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0b3f4a;
  color: #9fe3d7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-reply-author {
  font-weight: 600;
  color: #10606d;
  white-space: nowrap;
}

.chat-reply-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
  color: #777;
}

.chat-message-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-message-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0b3f4a;
  color: #9fe3d7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-message-author {
  font-size: 0.85rem;
  color: #1a1a1a;
}

.chat-message-time {
  font-size: 0.7rem;
  color: #aaa;
}

.chat-message-pin-badge {
  font-size: 0.7rem;
}

.chat-message-content {
  padding-left: 2.1rem;
  font-size: 0.88rem;
  color: #333;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-message-actions {
  position: absolute;
  top: 0.25rem;
  right: 0.4rem;
  display: flex;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.12s;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chat-msg-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.12s, color 0.12s;
}

.chat-msg-action-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.chat-delete-btn:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.chat-no-messages {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.9rem;
}

/* ── Reply bar ── */

.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 1rem;
  background: #f0f9f7;
  border-top: 1px solid #d1e8e3;
  font-size: 0.8rem;
  color: #555;
  flex-shrink: 0;
}

.chat-reply-bar-content {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
}

.chat-reply-bar-close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: #888;
  padding: 0 0.3rem;
}

/* ── Message input ── */

.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  resize: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.4;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
}

.chat-input:focus {
  border-color: #10606d;
  box-shadow: 0 0 0 2px rgba(16, 96, 109, 0.12);
}

.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #0b3f4a;
  color: #9fe3d7;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: #10606d;
}

/* ── Empty state ── */

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: #aaa;
}

/* ── Pinned panel ── */

.chat-pinned-panel,
.chat-members-panel {
  border-bottom: 1px solid #e5e7eb;
  background: #fefdf8;
  max-height: 220px;
  overflow-y: auto;
  flex-shrink: 0;
}

.chat-pinned-panel-header,
.chat-members-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  border-bottom: 1px solid #f0ebe0;
}

.chat-pinned-close,
.chat-members-close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: #888;
}

.chat-pinned-list,
.chat-members-list {
  padding: 0.3rem 1rem 0.5rem;
}

.chat-pinned-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f5f0e5;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s;
}

.chat-pinned-item:hover {
  background: rgba(0,0,0,0.04);
}

.chat-pinned-item:last-child {
  border-bottom: none;
}

.chat-pinned-item time {
  font-size: 0.7rem;
  color: #aaa;
}

.chat-member-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
}

.chat-member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0b3f4a;
  color: #9fe3d7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
}

/* ── Modals ── */

.chat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-modal {
  background: #fff;
  border-radius: 10px;
  width: 400px;
  max-width: 92vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  overflow: hidden;
}

.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 700;
  font-size: 0.92rem;
}

.chat-modal-close {
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

.chat-modal-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.chat-modal-footer {
  padding: 0.65rem 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
}

.chat-form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-form-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.chat-form-input:focus {
  border-color: #10606d;
  box-shadow: 0 0 0 2px rgba(16, 96, 109, 0.12);
}

.chat-form-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #555;
  cursor: pointer;
  margin-top: 0.2rem;
}

.chat-form-toggle input[type="checkbox"] {
  accent-color: #0b3f4a;
}

.chat-form-error {
  font-size: 0.8rem;
  color: #dc3545;
  min-height: 1rem;
}

.chat-modal-btn {
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-modal-btn--primary {
  background: #0b3f4a;
  color: #fff;
}

.chat-modal-btn--primary:hover {
  background: #10606d;
}

/* ── Dark mode: Chat ── */

.dark-mode .chat-page {
  background: #0c1a1e;
}

.dark-mode .chat-sidebar {
  background: #08181c;
  border-right-color: rgba(127, 215, 199, 0.08);
}

.dark-mode .chat-main {
  background: #111e22;
}

.dark-mode .chat-channel-header {
  border-bottom-color: rgba(255,255,255,0.08);
}

.dark-mode .chat-channel-header-name {
  color: #e0e0e0;
}

.dark-mode .chat-channel-header-desc {
  color: rgba(255,255,255,0.4);
}

.dark-mode .chat-header-btn {
  color: rgba(255,255,255,0.5);
}

.dark-mode .chat-header-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

.dark-mode .chat-message:hover {
  background: rgba(255,255,255,0.03);
}

.dark-mode .chat-message--pinned {
  background: rgba(217, 119, 6, 0.06);
}

.dark-mode .chat-new-divider {
  color: #e85d6f;
}

.dark-mode .chat-new-divider::before,
.dark-mode .chat-new-divider::after {
  background: #e85d6f;
}

.dark-mode .chat-reaction-chip {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}

.dark-mode .chat-reaction-chip:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.dark-mode .chat-reaction-chip--mine {
  background: rgba(127, 215, 199, 0.1);
  border-color: rgba(127, 215, 199, 0.3);
}

.dark-mode .chat-reaction-count {
  color: rgba(255,255,255,0.6);
}

.dark-mode .chat-reaction-add {
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.3);
}

.dark-mode .chat-reaction-add:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
}

.dark-mode .chat-emoji-picker {
  background: #14282e;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.dark-mode .chat-emoji-btn:hover {
  background: rgba(255,255,255,0.08);
}

.dark-mode .chat-link {
  color: #7fd7c7;
}

.dark-mode .chat-link:hover {
  color: #9fe3d7;
}

.dark-mode .chat-link-preview {
  background: rgba(255,255,255,0.04);
  border-left-color: #7fd7c7;
}

.dark-mode .chat-link-preview-title {
  color: #7fd7c7;
}

.dark-mode .chat-link-preview-desc {
  color: rgba(255,255,255,0.5);
}

.dark-mode .chat-message-edited {
  color: rgba(255,255,255,0.35);
}

.dark-mode .chat-edit-textarea {
  background: #0c1a1e;
  border-color: #10606d;
  color: #e0e0e0;
}

.dark-mode .chat-edit-cancel:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

.dark-mode .chat-search-panel {
  background: #0e2228;
  border-bottom-color: rgba(255,255,255,0.06);
}

.dark-mode .chat-search-panel-header {
  border-bottom-color: rgba(255,255,255,0.06);
}

.dark-mode .chat-search-input {
  background: #0c1a1e;
  border-color: rgba(255,255,255,0.12);
  color: #e0e0e0;
}

.dark-mode .chat-search-result {
  border-bottom-color: rgba(255,255,255,0.04);
}

.dark-mode .chat-search-result:hover {
  background: rgba(127, 215, 199, 0.06);
}

.dark-mode .chat-search-result strong {
  color: #e0e0e0;
}

.dark-mode .chat-search-result p {
  color: rgba(255,255,255,0.6);
}

@keyframes chat-highlight-flash-dark {
  0%, 30% { background: rgba(127, 215, 199, 0.12); }
  100% { background: transparent; }
}

.dark-mode .chat-message--highlight {
  animation-name: chat-highlight-flash-dark;
}

.dark-mode .chat-toast--success {
  background: #0e2a22;
  border-color: rgba(127, 215, 199, 0.2);
  color: #7fd7c7;
}

.dark-mode .chat-toast--danger {
  background: #2a1218;
  border-color: rgba(220, 53, 69, 0.2);
  color: #f87171;
}

.dark-mode .chat-toast--info {
  background: #0e1a2a;
  border-color: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
}

.dark-mode .chat-jump-latest {
  background: #14282e;
  border-color: rgba(255,255,255,0.1);
  color: #7fd7c7;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.dark-mode .chat-jump-latest:hover {
  background: #1a3a42;
}

.dark-mode .chat-main.chat-drag-over {
  outline-color: #7fd7c7;
  background: rgba(127, 215, 199, 0.04);
}

.dark-mode .chat-message-avatar {
  background: #0e4a55;
}

.dark-mode .chat-message-author {
  color: #e0e0e0;
}

.dark-mode .chat-message-content {
  color: rgba(255,255,255,0.8);
}

.dark-mode .chat-message-actions {
  background: #1a2e33;
  border-color: rgba(255,255,255,0.1);
}

.dark-mode .chat-msg-action-btn {
  color: rgba(255,255,255,0.5);
}

.dark-mode .chat-msg-action-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.dark-mode .chat-reply-bar {
  background: #0e2a30;
  border-top-color: rgba(127, 215, 199, 0.1);
  color: rgba(255,255,255,0.6);
}

.dark-mode .chat-input-area {
  background: #111e22;
  border-top-color: rgba(255,255,255,0.08);
}

.dark-mode .chat-input {
  background: #0c1a1e;
  border-color: rgba(255,255,255,0.12);
  color: #e0e0e0;
}

.dark-mode .chat-input:focus {
  border-color: #10606d;
}

.dark-mode .chat-pinned-panel,
.dark-mode .chat-members-panel {
  background: #0e2228;
  border-bottom-color: rgba(255,255,255,0.06);
}

.dark-mode .chat-pinned-panel-header,
.dark-mode .chat-members-panel-header {
  border-bottom-color: rgba(255,255,255,0.06);
}

.dark-mode .chat-pinned-item {
  border-bottom-color: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.7);
}

.dark-mode .chat-pinned-item:hover {
  background: rgba(255,255,255,0.06);
}

.dark-mode .chat-modal {
  background: #14282e;
  color: #e0e0e0;
}

.dark-mode .chat-modal-header {
  border-bottom-color: rgba(255,255,255,0.08);
}

.dark-mode .chat-modal-footer {
  border-top-color: rgba(255,255,255,0.08);
}

.dark-mode .chat-form-input {
  background: #0c1a1e;
  border-color: rgba(255,255,255,0.12);
  color: #e0e0e0;
}

.dark-mode .chat-form-label {
  color: rgba(255,255,255,0.5);
}

.dark-mode .chat-form-toggle {
  color: rgba(255,255,255,0.6);
}

.dark-mode .chat-no-messages,
.dark-mode .chat-empty-state {
  color: rgba(255,255,255,0.3);
}

/* ── Chat mobile ── */

@media (max-width: 700px) {
  .chat-sidebar {
    width: 180px;
  }
  .chat-channel-header-desc {
    display: none;
  }
  .chat-reply-preview {
    max-width: 180px;
  }
}

@media (max-width: 480px) {
  .chat-sidebar {
    width: 56px;
  }
  .chat-channel-name,
  .chat-sidebar-title,
  .chat-sidebar-header {
    display: none;
  }
  .chat-sidebar {
    align-items: center;
    padding-top: 0.5rem;
  }
  .chat-channel-item {
    justify-content: center;
    padding: 0.5rem;
  }
}

@media (max-width: 700px) {
  .chat-sidebar {
    width: 260px;
    align-items: stretch;
    padding-top: 0;
  }
  .chat-channel-name,
  .chat-sidebar-title,
  .chat-sidebar-header {
    display: revert;
  }
  .chat-channel-item {
    justify-content: flex-start;
    padding: 0.4rem 0.85rem;
  }
}

/* ── Chat: Image messages ── */

.chat-message-image-wrap {
  padding-left: 2.1rem;
  margin-top: 0.3rem;
}

.chat-message-image {
  max-width: min(420px, 100%);
  max-height: 320px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.chat-message-image:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ── Chat: Image lightbox modal ── */

.chat-image-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
  animation: chat-image-modal-in 0.2s ease-out;
}

.chat-image-modal.active {
  display: flex;
}

.chat-image-modal-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.chat-image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.chat-image-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

@keyframes chat-image-modal-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Chat: Attach button ── */

.chat-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #888;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.chat-attach-btn:hover {
  background: #f0f0f0;
  color: #333;
}

/* ── Chat: Image preview bar ── */

.chat-image-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.chat-image-preview img {
  max-height: 80px;
  max-width: 120px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #e0e0e0;
}

.chat-image-preview-remove {
  border: none;
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.12s;
}

.chat-image-preview-remove:hover {
  background: rgba(220, 53, 69, 0.18);
}

/* ── Dark mode: Chat images & attach ── */

.dark-mode .chat-message-image {
  border-color: rgba(255,255,255,0.08);
}

.dark-mode .chat-message-image:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.dark-mode .chat-attach-btn {
  color: rgba(255,255,255,0.4);
}

.dark-mode .chat-attach-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

.dark-mode .chat-image-preview {
  background: #0e2228;
  border-top-color: rgba(255,255,255,0.06);
}

.dark-mode .chat-image-preview img {
  border-color: rgba(255,255,255,0.1);
}

/* ── Dark mode: Improved reply ref ── */

.dark-mode .chat-reply-line {
  background: #7fd7c7;
}

.dark-mode .chat-reply-author {
  color: #7fd7c7;
}

.dark-mode .chat-reply-preview {
  color: rgba(255,255,255,0.4);
}

.dark-mode .chat-reply-ref-avatar {
  background: #0e4a55;
}

.dark-mode .chat-message-reply-ref:hover {
  background: rgba(255,255,255,0.03);
}

/* ── Chat: Date separators ── */

.chat-date-separator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.8rem 0 0.4rem;
  color: #888;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-date-separator::before,
.chat-date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.dark-mode .chat-date-separator {
  color: rgba(255,255,255,0.35);
}

.dark-mode .chat-date-separator::before,
.dark-mode .chat-date-separator::after {
  background: rgba(255,255,255,0.08);
}

/* ── Chat: Continuation hover timestamp ── */

.chat-message-hover-time {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 2.1rem;
  text-align: center;
  font-size: 0.62rem;
  color: #aaa;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  font-variant-numeric: tabular-nums;
}

.chat-message:hover .chat-message-hover-time {
  opacity: 1;
}

.dark-mode .chat-message-hover-time {
  color: rgba(255,255,255,0.35);
}

/* ── Chat: @mentions ── */

.chat-mention {
  background: rgba(16, 96, 109, 0.12);
  color: #10606d;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  font-weight: 600;
}

.dark-mode .chat-mention {
  background: rgba(127, 215, 199, 0.12);
  color: #7fd7c7;
}

/* ── Chat: #channel links ── */

.chat-channel-link {
  background: rgba(16, 96, 109, 0.08);
  color: #10606d;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s;
}

.chat-channel-link:hover {
  background: rgba(16, 96, 109, 0.18);
  color: #0b3f4a;
}

.dark-mode .chat-channel-link {
  background: rgba(127, 215, 199, 0.08);
  color: #7fd7c7;
}

.dark-mode .chat-channel-link:hover {
  background: rgba(127, 215, 199, 0.18);
  color: #9fe3d7;
}

/* ── Chat: Code blocks ── */

.chat-code-block {
  display: block;
  margin: 0.35rem 0;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  background: #f1f3f5;
  border: 1px solid #e5e7eb;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  color: #333;
}

.chat-code-inline {
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: #f1f3f5;
  border: 1px solid #e5e7eb;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 0.82em;
  color: #c0392b;
}

.dark-mode .chat-code-block {
  background: #0c1a1e;
  border-color: rgba(255,255,255,0.1);
  color: #d4d4d4;
}

.dark-mode .chat-code-inline {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: #f87171;
}

/* ── Chat: Delete confirmation toast action buttons ── */

.chat-toast-action {
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 0.25rem;
  transition: background 0.12s;
}

.chat-toast-action--confirm {
  background: #dc3545;
  color: #fff;
}

.chat-toast-action--confirm:hover {
  background: #b02a37;
}

.chat-toast-action--cancel {
  background: transparent;
  color: inherit;
}

.chat-toast-action--cancel:hover {
  background: rgba(0,0,0,0.08);
}

.dark-mode .chat-toast-action--cancel:hover {
  background: rgba(255,255,255,0.1);
}

/* ── Chat: Mobile sidebar ── */

.chat-mobile-hamburger {
  display: none;
}

.chat-sidebar-overlay {
  display: none;
}

@media (max-width: 700px) {
  .chat-mobile-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 60;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #0b3f4a;
    color: #9fe3d7;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: background 0.15s;
  }

  .chat-mobile-hamburger:hover {
    background: #10606d;
  }

  .chat-sidebar {
    position: fixed;
    left: 0;
    top: 40px;
    bottom: 0;
    z-index: 200;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .chat-sidebar--open {
    transform: translateX(0);
  }

  .chat-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  .chat-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

.dark-mode .chat-mobile-hamburger {
  background: #10606d;
  color: #d1faf0;
}

/* ── Chat: Sidebar help button ── */

.chat-sidebar-footer {
  padding: 0.5rem 0.65rem;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
}

.chat-sidebar-help-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #888;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.chat-sidebar-help-btn:hover {
  background: rgba(0,0,0,0.05);
  color: #10606d;
}

.dark-mode .chat-sidebar-footer {
  border-top-color: rgba(255,255,255,0.06);
}

.dark-mode .chat-sidebar-help-btn {
  color: rgba(255,255,255,0.4);
}

.dark-mode .chat-sidebar-help-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #9fe3d7;
}

/* ── Chat: Help modal ── */

.chat-help-modal {
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
}

.chat-help-section {
  margin-bottom: 1.1rem;
}

.chat-help-section h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
}

.chat-help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
}

.chat-help-table td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid #f0ede5;
  vertical-align: middle;
}

.chat-help-table td:first-child {
  white-space: nowrap;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  color: #666;
  width: 40%;
}

.chat-help-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
}

.chat-help-list li {
  padding: 0.2rem 0;
}

.chat-help-list kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: #f1f3f5;
  border: 1px solid #ddd;
  font-family: inherit;
  font-size: 0.78em;
  line-height: 1.3;
}

.dark-mode .chat-help-table td {
  border-bottom-color: rgba(255,255,255,0.06);
}

.dark-mode .chat-help-table td:first-child {
  color: rgba(255,255,255,0.5);
}

.dark-mode .chat-help-list kbd {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}