:root {
  --drawer-width: min(380px, 80vw);
  --drawer-mini-width: 5.2rem;
  --corrections-drawer-width: min(520px, 96vw);
}

html,
body {
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.45), rgba(15, 23, 42, 0.35));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.6), rgba(15, 23, 42, 0.5));
}

.side-drawer::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
}

.side-drawer::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.side-drawer {
  width: var(--drawer-width);
  background: #0f172a;
  color: #e2e8f0;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  transform: translateX(-100%);
  transition: transform 0.25s ease, width 0.25s ease, padding 0.25s ease;
  z-index: 60;
  box-shadow: 6px 0 18px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1rem 1.5rem;
  overflow: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #0f172a;
  padding-top: 0.25rem;
  isolation: isolate;
}

.drawer-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.5rem;
  height: 1.5rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0));
  pointer-events: none;
}

.side-drawer.is-preload {
  transition: none;
}

.tab {
  cursor: pointer;
  transition: 0.18s ease;
  user-select: none;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.side-drawer .tab-active {
  background-color: var(--accent, #2563eb);
  color: #fff;
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.28);
}

.side-drawer .tab-inactive {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}

.side-drawer .tab-inactive:hover {
  background: rgba(148, 163, 184, 0.2);
}

.side-drawer.open {
  transform: translateX(0);
}

.side-drawer.is-collapsed {
  width: var(--drawer-mini-width);
  transform: translateX(0);
  padding: 1.1rem 0.65rem 1.1rem;
}

@media (max-width: 1023px) {
  .side-drawer.is-collapsed {
    width: var(--drawer-width);
    transform: translateX(-100%);
    padding: 1.25rem 1rem 1.5rem;
  }
}

.side-drawer.is-collapsed .drawer-header {
  justify-content: center;
}

.side-drawer.is-collapsed .drawer-heading,
.side-drawer.is-collapsed .drawer-section,
.side-drawer.is-collapsed .sidebar-item__label,
.side-drawer.is-collapsed .sidebar-profile__meta,
.side-drawer.is-collapsed .sidebar-profile__chevron {
  display: none;
}

.side-drawer.is-collapsed #closeDrawer {
  display: none;
}

.side-drawer.is-collapsed .tab,
.side-drawer.is-collapsed .sidebar-profile,
.side-drawer.is-collapsed .sidebar-logout {
  justify-content: center;
  gap: 0;
  padding: 0.75rem;
}

.side-drawer.is-collapsed .tab {
  font-size: 1.05rem;
}

.side-drawer.is-collapsed .cooperation-badge {
  position: absolute;
  top: 8px;
  right: 8px;
}

.side-drawer.is-collapsed .sidebar-profile__avatar {
  height: 2.8rem;
  width: 2.8rem;
}

.side-drawer.is-collapsed .sidebar-profile {
  padding: 0;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.side-drawer.is-collapsed .sidebar-profile:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.35);
}

.side-drawer.is-collapsed .sidebar-profile-wrapper {
  align-items: center;
}

.side-drawer.is-collapsed .sidebar-profile-menu {
  width: min(320px, 80vw);
}

.side-drawer.is-collapsed .sidebar-logout {
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border-radius: 12px;
}

.side-drawer.is-collapsed .tab-inactive:hover {
  background: rgba(148, 163, 184, 0.25);
}

.side-drawer nav {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 18px;
  scrollbar-gutter: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
}

.side-drawer nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.cooperation-badge {
  margin-left: auto;
  min-width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.6);
}

.cooperation-toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  text-decoration: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.nda-peek {
  position: fixed;
  right: 0;
  bottom: 0;
  width: clamp(120px, 20vw, 180px);
  z-index: 40;
  display: inline-flex;
  align-items: flex-end;
  justify-content: flex-end;
  text-decoration: none;
  filter: drop-shadow(0 12px 20px rgba(15, 23, 42, 0.25));
  transform: translate(52px, 52px);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.nda-peek img {
  width: 100%;
  height: auto;
  display: block;
}

.nda-peek:hover {
  transform: translate(42px, 42px);
  filter: drop-shadow(0 16px 28px rgba(15, 23, 42, 0.35));
}

.nda-peek:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.5);
  outline-offset: 6px;
}

@media (max-width: 640px) {
  .nda-peek {
    width: clamp(96px, 26vw, 140px);
    transform: translate(38px, 38px);
  }
}

.cooperation-toast__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.cooperation-toast__text {
  font-size: 0.9rem;
}

.cooperation-toast__chevron {
  color: rgba(15, 23, 42, 0.45);
}

.cooperation-toast:hover {
  transform: translateY(0);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.28);
}

.cooperation-toast:focus-visible {
  outline: 3px solid rgba(249, 115, 22, 0.35);
  outline-offset: 3px;
}

.sidebar-tab-tooltip {
  position: fixed;
  z-index: 80;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: min(280px, 70vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-tab-tooltip.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.drawer-toggle {
  height: 2.75rem;
  width: 2.75rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.35);
  transition: box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.drawer-toggle--floating {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 70;
}

@media (min-width: 1024px) {
  .drawer-toggle--floating {
    opacity: 0;
    pointer-events: none;
  }
}

.drawer-toggle--collapsed {
  display: none;
}

.side-drawer.is-collapsed .drawer-toggle--collapsed {
  display: inline-flex;
}

.drawer-toggle:hover {
  background: #374151;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.45);
}

.drawer-toggle:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.2);
  outline-offset: 2px;
}

body.drawer-open .drawer-toggle--floating {
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .drawer-toggle--floating {
  opacity: 0;
  pointer-events: none;
}

.side-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: none;
}

.side-overlay.active {
  display: block;
}

.corrections-drawer {
  width: var(--corrections-drawer-width);
  background: #f8fafc;
  color: #0f172a;
  position: fixed;
  inset: 0 0 0 auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 90;
  box-shadow: -6px 0 18px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1rem 1.5rem;
}

.corrections-drawer.open {
  transform: translateX(0);
}

.corrections-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 95;
  height: 2.75rem;
  width: 2.75rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0ea5e9;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 26px rgba(14, 165, 233, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.corrections-toggle:hover {
  background: #0284c7;
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.55);
}

.corrections-toggle:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.35);
  outline-offset: 2px;
}

body.corrections-open .corrections-toggle {
  opacity: 0;
  transform: translateX(-1rem) scale(0.95);
  pointer-events: none;
}

body.corrections-open .chat-launcher {
  opacity: 0;
  transform: translateX(-1rem) scale(0.95);
  pointer-events: none;
}

body.chat-open .chat-launcher {
  opacity: 0;
  transform: translateX(-1rem) scale(0.95);
  pointer-events: none;
}

body.chat-open .corrections-toggle {
  opacity: 0;
  transform: translateX(-1rem) scale(0.95);
  pointer-events: none;
}

.corrections-overlay {
  z-index: 80;
}

.corrections-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 16px;
  background: var(--card, #ffffff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.corrections-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.drawer-title {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.sidebar-item__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sidebar-profile {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 1.1rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  text-decoration: none;
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sidebar-profile:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.45);
}

.sidebar-profile__avatar {
  position: relative;
  height: 3rem;
  width: 3rem;
  border-radius: 999px;
  background: radial-gradient(circle at top, #38bdf8, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  overflow: visible;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35);
}

.sidebar-profile__avatar img,
.sidebar-profile__avatar #profileInitials {
  border-radius: 999px;
}

.sidebar-profile__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.sidebar-profile__avatar #profileInitials {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-profile__status {
  position: absolute;
  right: -0.15rem;
  bottom: -0.15rem;
  height: 0.65rem;
  width: 0.65rem;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.35);
}

.sidebar-profile__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar-profile__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(226, 232, 240, 0.7);
}

.sidebar-profile__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile__staff {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile__chevron {
  color: rgba(226, 232, 240, 0.6);
  font-size: 0.85rem;
}

.sidebar-profile-wrapper {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  bottom: 1rem;
  z-index: 4;
  padding-top: 1.5rem;
}

.sidebar-profile-wrapper::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1.5rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.98));
  pointer-events: none;
}

.sidebar-profile-menu {
  position: fixed;
  left: 0;
  top: 0;
  bottom: auto;
  width: min(320px, 80vw);
  min-width: 220px;
  padding: 0.75rem;
  border-radius: 16px;
  background: #0b1224;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 80;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

@media (max-width: 640px) {
  .sidebar-profile-menu {
    width: calc(100% - 2rem);
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    top: auto;
    border-radius: 16px;
  }
}

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

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

.sidebar-profile-menu__link,
.sidebar-profile-menu__logout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sidebar-profile-menu__link {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}

.sidebar-profile-menu__logout {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  cursor: pointer;
}

.sidebar-profile-menu__link:hover,
.sidebar-profile-menu__logout:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.35);
}

.sidebar-profile-menu__link:hover {
  background: rgba(148, 163, 184, 0.2);
}

.sidebar-profile-menu__logout:hover {
  background: rgba(239, 68, 68, 0.32);
}

.sidebar-profile-menu__form {
  width: 100%;
}

.sidebar-logout-form {
  width: 100%;
}

.sidebar-logout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 1.1rem;
  background: linear-gradient(135deg, #ef4444, #f97316);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #ffffff;
  font-weight: 600;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.sidebar-logout:hover {
  background: linear-gradient(135deg, #dc2626, #ea580c);
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.45);
  transform: translateY(-1px);
}

/* Chat widget */
.chat-launcher {
  position: fixed;
  top: 1rem;
  right: 4.5rem;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  width: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  padding: 0;
  background: #0ea5e9;
  color: #f8fafc;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(14, 165, 233, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.chat-launcher:hover {
  background: #0284c7;
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.55);
}

.chat-launcher:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.35);
  outline-offset: 2px;
}

.chat-launcher__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.chat-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.4rem;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.chat-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(420px, 92vw);
  max-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0b1220;
  border-radius: 20px 0 0 20px;
  border: 1px solid #1f2937;
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.65);
  overflow: hidden;
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.chat-panel.open {
  transform: translateX(0);
}

.chat-header {
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: linear-gradient(135deg, #111827, #1e1b4b);
  border-bottom: 1px solid #1f2937;
}

.chat-header__eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #94a3b8;
}

.chat-header__title {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 0.15rem;
}

.chat-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-header__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.chat-header__link:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(94, 234, 212, 0.45);
}

.chat-presence {
  font-size: 0.72rem;
  color: #4ade80;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}

.chat-presence.is-offline {
  color: #fda4af;
  background: rgba(251, 113, 133, 0.15);
  border-color: rgba(251, 113, 133, 0.35);
}

.chat-presence.is-connecting {
  color: #cbd5f5;
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.35);
}

.chat-close {
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chat-close:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #ffffff;
}

.chat-messages {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4), rgba(2, 6, 23, 0.9));
  flex: 1;
}

.chat-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, #312e81, #14b8a6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.2);
  text-decoration: none;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-bubble {
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  color: #e2e8f0;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.45);
  width: 100%;
}

.chat-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.chat-meta__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-delete {
  border: none;
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.chat-delete:hover {
  background: rgba(248, 113, 113, 0.28);
  color: #fff1f2;
  transform: translateY(-1px);
}

.chat-body {
  margin-top: 0.35rem;
  line-height: 1.5;
  color: #e2e8f0;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-entry.self {
  flex-direction: row-reverse;
}

.chat-entry.self .chat-bubble {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.4);
}

.chat-entry.self .chat-avatar {
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #ffffff;
}

.chat-entry.self .chat-meta {
  justify-content: flex-end;
  text-align: right;
}

.chat-form {
  padding: 0.9rem 1.1rem 1.1rem;
  border-top: 1px solid #1f2937;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-input__label {
  font-size: 0.75rem;
  color: #94a3b8;
}

.chat-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #111827;
  color: #e2e8f0;
  padding: 0.8rem 0.9rem;
  min-height: 72px;
  resize: vertical;
  font-size: 0.95rem;
}

.chat-input:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.7);
  outline-offset: 2px;
  border-color: rgba(94, 234, 212, 0.7);
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-tip {
  font-size: 0.78rem;
  color: #94a3b8;
}

.chat-tip__icon {
  color: #38bdf8;
  margin-right: 0.25rem;
}

.chat-send {
  background: linear-gradient(135deg, #14b8a6, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 0.65rem 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.32);
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.chat-status {
  font-size: 0.8rem;
  color: #64748b;
  min-height: 1.2rem;
}

.chat-status--muted {
  color: #64748b;
}

.chat-status--error {
  color: #fca5a5;
}

.chat-status--success {
  color: #4ade80;
}

.chat-empty {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .chat-launcher {
    right: 0.35rem;
  }

  .chat-panel {
    width: 100%;
    border-radius: 0;
  }
}
