:root {
  --glass-surface: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.35);
  --glass-highlight: rgba(255, 255, 255, 0.55);
  --glass-shadow: rgba(15, 23, 42, 0.16);
  --brand-teal: #10a37f;
  --brand-blue: #2563eb;
  --text-strong: #0f172a;
}

[data-theme="dark"] {
  --glass-surface: rgba(15, 23, 42, 0.45);
  --glass-border: rgba(148, 163, 184, 0.35);
  --glass-highlight: rgba(226, 232, 240, 0.22);
  --glass-shadow: rgba(0, 0, 0, 0.5);
  --text-strong: #f8fafc;
}

.is-hidden {
  display: none !important;
}

body.is-nav-open {
  overflow: hidden;
}

.menu-hamburguer {
  position: fixed;
  top: clamp(1rem, 4vw, 1.6rem);
  left: clamp(1rem, 4vw, 1.6rem);
  right: auto;
  z-index: 12000;
  display: none;
  width: clamp(2.75rem, 7vw, 3.35rem);
  height: clamp(2.75rem, 7vw, 3.35rem);
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.18);
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.menu-hamburguer .barra {
  width: 60%;
  height: 2px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.92);
  transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
}

[data-theme="dark"] .menu-hamburguer .barra {
  background-color: rgba(255, 255, 255, 0.85);
}

.menu-hamburguer:hover,
.menu-hamburguer:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 22px 36px rgba(255, 255, 255, 0.22);
}

.menu-hamburguer:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}

.menu-hamburguer.is-active .barra:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-hamburguer.is-active .barra:nth-child(2) {
  opacity: 0;
}

.menu-hamburguer.is-active .barra:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.sidenav.glass-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin: 0;
  padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1rem, 2.5vw, 1.5rem);
  padding-top: clamp(3.25rem, 6vw, 4.25rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.05));
  border-radius: 0 clamp(1.75rem, 3vw, 2.25rem) clamp(1.75rem, 3vw, 2.25rem) 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 48px var(--glass-shadow);
  box-sizing: border-box;
  padding-bottom: 0px;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
  mask: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
  pointer-events: none;
}

.sidebar-emblem {
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-emblem img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 0 rgba(0,0,0,0));
}
/* ~60% opaque (40% transparent) */
.sidebar-emblem img {
  opacity: 0.6;
}

.audit-mode-shell {
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: grid;
  gap: clamp(1rem, 3vw, 1.75rem);
  text-align: left;
}

.audit-mode-title {
  margin: 0;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
}

.audit-mode-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 1.8rem);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.mode-button {
  border-radius: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.28);
  color: var(--text-strong);
  display: flex;
  flex-direction: column;
  gap: clamp(0.55rem, 1.8vw, 1rem);
  padding: clamp(1.25rem, 3.2vw, 1.8rem);
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.mode-button:hover,
.mode-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 28px 52px rgba(15, 23, 42, 0.36);
  outline: none;
}

.mode-button.mode-active {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 30px 55px rgba(37, 99, 235, 0.28);
}

.mode-label {
  font-size: clamp(1.15rem, 2.8vw, 1.4rem);
  font-weight: 600;
}

.mode-subtitle {
  font-size: clamp(0.9rem, 2.2vw, 1rem);
  color: rgba(15, 23, 42, 0.7);
}

.mode-meta {
  font-size: clamp(0.75rem, 1.8vw, 0.9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(59, 130, 246, 0.75);
}

.hero-eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: clamp(0.75rem, 1.4vw, 0.9rem);
  color: rgba(15, 23, 42, 0.65);
}

.payment-description {
  margin: 0;
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  color: rgba(15, 23, 42, 0.68);
}

.audit-switcher {
  display: grid;
  gap: clamp(0.6rem, 2vw, 1rem);
}

.audit-switcher-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switcher-eyebrow {
  font-size: clamp(0.75rem, 1.6vw, 0.9rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.6);
}

.audit-switcher-actions {
  display: flex;
  gap: clamp(0.5rem, 1.6vw, 0.8rem);
}

.audit-switch-btn {
  flex: 1;
  border-radius: clamp(0.7rem, 2vw, 1rem);
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-strong);
  padding: clamp(0.55rem, 1.7vw, 0.8rem);
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.audit-switch-btn:hover,
.audit-switch-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 20px 34px rgba(15, 23, 42, 0.28);
  outline: none;
}

.audit-switch-btn.mode-active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.18);
  box-shadow: 0 24px 40px rgba(37, 99, 235, 0.3);
}

.rainmaker-start-btn {
  border-radius: clamp(0.85rem, 2.4vw, 1.2rem);
  border: 1px solid #dae5f0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.1));
  color: var(--text-strong);
  padding: clamp(0.8rem, 2.4vw, 1rem) clamp(1.2rem, 3vw, 1.8rem);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rainmaker-start-btn:hover,
.rainmaker-start-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.32);
  outline: none;
}

.missing-days-summary {
  display: grid;
  gap: clamp(0.4rem, 1.5vw, 0.75rem);
}

.missing-days-title {
  font-weight: 600;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: rgba(15, 23, 42, 0.85);
}

.missing-days-pills {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.35rem, 1.2vw, 0.6rem);
}

.missing-day-pill {
  border-radius: 999px;
  border: 1px solid #dae5f0;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.9rem;
  font-size: clamp(0.8rem, 1.6vw, 0.9rem);
  color: rgba(15, 23, 42, 0.8);
}

.glass-item {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border-radius: clamp(0.75rem, 2vw, 1.25rem);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-item .dropdown-toggle,
.glass-item .log-out {
  width: 100%;
  background: transparent;
  border-radius: inherit;
  color: var(--text-strong);
}

.glass-item .dropdown-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}


.logout-top-button {
  position: absolute;
  top: clamp(1.1rem, 4vw, 1.9rem);
  right: clamp(1.1rem, 4vw, 1.9rem);
  display: inline-flex;
  align-items: center;
  gap: clamp(0.45rem, 2vw, 0.65rem);
  padding: clamp(0.55rem, 2vw, 0.85rem) clamp(1rem, 3vw, 1.5rem);
  border-radius: clamp(0.8rem, 2.2vw, 1.25rem);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.08));
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.2);
  color: var(--text-strong);
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  background-clip: padding-box;
}

.logout-top-button:hover,
.logout-top-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 24px 45px rgba(255, 255, 255, 0.25);
}

.logout-top-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.logout-top-button i {
  font-size: 1em;
}

.logout-top-button .logout-label {
  white-space: nowrap;
}

.glass-item:focus-within,
.glass-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 18px 32px rgba(255, 255, 255, 0.18);
}

.glass-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  min-height: 100%;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.05));
  border-radius: clamp(1.25rem, 3vw, 2.5rem);
  padding: clamp(1rem, 3vw, 2.5rem);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 60px rgba(255, 255, 255, 0.12);
  color: var(--text-strong);
  box-sizing: border-box;
}

.chat-with-bot-container.glass-shell {
  padding-top: clamp(4rem, 8vw, 5.5rem);
}

/* the shell must NOT scroll */
.chat-with-bot-container.glass-shell {
  display: flex;
  flex-direction: column;
  height: auto;          /* let it size by content */
  flex: 1 1 auto;
  min-height: 0;         /* critical for inner flex scroller */
  overflow: hidden !important;     /* stop scrolling here */
  /* keep your width/left rules if you need them, or use the calc() approach from earlier */
}

.glass-shell::after {
  content: "";
  position: absolute;
  inset: 12% 6% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
  opacity: 0.6;
  pointer-events: none;
}

#credits-container.glass-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06));
  border-radius: clamp(0.9rem, 2.2vw, 1.5rem);
  padding: clamp(0.75rem, 2vw, 1.25rem);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 18px 28px rgba(37, 99, 235, 0.12);
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(3.5rem, 7vw, 4.5rem);
}

#credits-container.glass-card #credit-count {
  color: var(--brand-blue);
}

#credits-container.glass-card #buy-credits-btn {
  background: rgba(37, 99, 235, 0.2);
  color: var(--brand-blue);
  border-radius: clamp(0.6rem, 1.8vw, 1rem);
  padding: clamp(0.45rem, 1.2vw, 0.65rem) clamp(0.9rem, 2vw, 1.4rem);
  border: 1px solid rgba(37, 99, 235, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

#credits-container.glass-card #buy-credits-btn:hover,
#credits-container.glass-card #buy-credits-btn:focus-visible {
  background: var(--brand-blue);
  color: #fff;
  transform: translateY(-1px);
}

.paychecks-empty {
  display: none;
  margin-top: clamp(0.6rem, 2vw, 1rem);
  padding-left: clamp(0.85rem, 4vw, 1.5rem);
  font-size: clamp(0.85rem, 1.6vw, 0.95rem);
  color: var(--text-strong);
  opacity: 0.72;
  text-align: left;
  align-self: flex-start;
}

[data-theme="dark"] .paychecks-empty {
  opacity: 0.86;
}

.glass-stream {
width: 100%;
margin: 0;
padding: clamp(1rem, 3vw, 2rem);
border-radius: clamp(1rem, 3vw, 1.75rem);
background: none;
border: none;
box-shadow: none;
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
display: flex;
flex-direction: column;
gap: none;
box-sizing: none;
  /* width: 100%;
  margin: 0;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: clamp(1rem, 3vw, 1.75rem);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  box-sizing: border-box; */
}

.glass-shell .bot-message,
.glass-shell .user-message {
  position: relative;
  padding: clamp(0.85rem, 2vw, 1.35rem);
  border-radius: clamp(0.9rem, 2.4vw, 1.5rem);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.14);
  color: var(--text-strong);
  line-height: 1.6;
}

.glass-shell .bot-message {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 34px rgba(255, 255, 255, 0.2);
}

.glass-shell .bot-message::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  mask: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 55%);
  pointer-events: none;
}

.glass-shell .user-message {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.22);
}

.glass-shell .user-message::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.25);
  mask: linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 60%);
}

.glass-shell .bot-message-content pre,
.glass-shell .bot-message-content code {
  background: rgba(15, 23, 42, 0.35);
  color: #f8fafc;
  border-radius: clamp(0.6rem, 1.8vw, 1rem);
}

.glass-input {
  position: sticky;
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  width: 100%;
  margin: 0;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  border-radius: clamp(1rem, 3vw, 1.75rem);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  box-sizing: border-box;
}

.glass-input textarea {
  background: rgba(255, 255, 255, 0.28);
  border-radius: clamp(0.75rem, 2vw, 1.1rem);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: clamp(0.6rem, 2vw, 1rem) clamp(0.75rem, 2.4vw, 1.15rem);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: var(--text-strong);
}

.glass-input textarea:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.glass-input .input-icons label,
.glass-input .icon-button,
.glass-input #send-icon {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  width: clamp(2.2rem, 6vw, 2.75rem);
  height: clamp(2.2rem, 6vw, 2.75rem);
  display: grid;
  place-items: center;
  color: var(--text-strong);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.glass-input .input-icons label:hover,
.glass-input .icon-button:hover,
.glass-input #send-icon:hover,
.glass-input .input-icons label:focus-visible,
.glass-input .icon-button:focus-visible,
.glass-input #send-icon:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 20px rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.95);
}

@media (max-width: 768px) {
  .sidenav.glass-panel {
    border-radius: clamp(0.75rem, 4vw, 1.25rem);
    padding: clamp(1rem, 4vw, 1.5rem);
  }

  .glass-shell {
    padding: clamp(1rem, 5vw, 1.75rem);
  }

  .glass-stream {
    margin-top: clamp(0.5rem, 5vw, 1.25rem);
  }

  .glass-input {
    position: sticky;
    width: 100%;
  }

  .audit-mode-shell {
    margin: clamp(1rem, 6vw, 1.5rem) auto;
  }

  .audit-switcher-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  #credits-container.glass-card {
    flex-direction: column;
    align-items: flex-start;
  }

  #credits-container.glass-card #buy-credits-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 1250px) {
  .menu-hamburguer {
    display: inline-flex;
  }

  .sidenav.glass-panel {
    position: fixed;
    top: 0;
    bottom: auto;
    height: 100vh;
    display: flex;
    width: min(85vw, 360px);
    max-width: none;
    left: 0;
    transform: translateX(-120%);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    pointer-events: none;
    padding-top: clamp(4rem, 10vw, 5.5rem);
  }

  #mySidenav.open {
    transform: translateX(0);
    pointer-events: auto;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  }

  .sidebar-emblem {
    padding: 0;
  }
  .sidebar-emblem img {
    width: auto;
  }
}

@media (min-width: 1250px) {
  .menu-hamburguer {
    display: none !important;
  }
}

/* ===== SCROLL NORMALIZATION (FINAL OVERRIDES) ===== */

/* Shell must NOT scroll */
.chat-with-bot-container.glass-shell {
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* The stream container must NOT create side scroll; only the list scrolls vertically */
.glass-stream {
  width: 100% !important;
  margin: 0;
  box-sizing: border-box;
  overflow-x: hidden; /* belt-and-suspenders */
}

/* Ensure the message list is the only scroller and fills available space */
#full-conversation,
.glass-stream#full-conversation {
  height: auto !important;
  width: 100% !important;
  left: 0 !important;

  display: flex;
  flex-direction: column;

  flex: 1 1 auto;
  min-height: 0;

  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-gutter: stable both-edges;
}

/* No horizontal scroll globally (in case this file loads after others) */
html, body { overflow-x: hidden !important; }
