@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-stretch: 100%;
  font-display: swap;
  src: url("../../about/assets/fonts/google-sans-flex-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #000;
  --sidebar: rgba(0, 0, 0, 0.555);
  --sidebar-border: rgba(255, 255, 255, 0.12);
  --hover: rgba(255, 255, 255, 0.1);
  --active: rgba(255, 255, 255, 0.16);
  --composer: #2b2b2b;
  --composer-border: #3a3a3a;
  --text: #f4f4f4;
  --muted: #b4b4b4;
  --subtle: #7f7f7f;
  --line: #242424;
  --user-bubble: #303030;
  --learny-bubble: rgba(20, 20, 22, 0.86);
  --error: #ff6b6b;
  --ready: #d8d8d8;
  --accent: #5865ff;
  --accent-2: #6e75ff;
  --accent-3: #3d8bff;
  --radius: 8px;
  --sidebar-width: 350.4px;
  --sidebar-gutter: 14px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

@keyframes captcha-spinner {
  100% {
    transform: rotate(1turn);
  }
}

body.contact-page {
  min-height: 100%;
  overflow: auto;
  background: #000;
}

body.sidebar-lock {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #d8d8d8;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
  transition: grid-template-columns 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.star-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
  pointer-events: none;
  contain: paint;
}

.star-field::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 0 42%, rgba(0, 0, 0, 0.42) 78%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.44), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.44));
}

.star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 255, 255, var(--opacity));
  box-shadow: 0 0 var(--glow) rgba(210, 224, 255, var(--glow-opacity));
  opacity: var(--opacity);
  transform: translate3d(0, 0, 0);
  animation: starDrift var(--duration) linear var(--delay) infinite alternate;
  backface-visibility: hidden;
  will-change: transform;
}

.contact-page-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 44px 18px;
  place-items: center;
  overflow: hidden;
  background: #000;
  isolation: isolate;
}

.contact-page-shell .star-field {
  position: fixed;
}

.contact-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  width: min(660px, 100%);
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0, rgba(72, 120, 255, 0.16), transparent 32%),
    rgba(18, 19, 25, 0.92);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 32px 100px rgba(0, 0, 0, 0.7);
}

.contact-card-header {
  display: grid;
  gap: 8px;
}

.contact-card-header a {
  width: max-content;
  color: rgba(229, 234, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.contact-card-header a:hover,
.contact-card-header a:focus-visible {
  color: #fff;
}

.contact-card-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.1rem, 8vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.contact-card-header p {
  margin: 0;
  max-width: 58ch;
  color: rgba(235, 238, 248, 0.72);
  font-size: 0.98rem;
  font-weight: 620;
  line-height: 1.55;
}

.contact-form {
  display: grid;
  gap: 15px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: rgba(240, 243, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 820;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  outline: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.24);
  font: inherit;
  font-size: 0.94rem;
}

.contact-form input {
  height: 48px;
  padding: 0 14px;
}

.contact-form input[readonly] {
  color: rgba(245, 247, 255, 0.74);
}

.contact-form textarea {
  min-height: 150px;
  max-height: 320px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.5;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(108, 159, 255, 0.56);
  box-shadow: 0 0 0 1px rgba(108, 159, 255, 0.16);
}

.contact-upload-label input {
  display: none;
}

.contact-upload-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 14px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  color: rgba(235, 238, 248, 0.72);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.contact-upload-control strong {
  color: #fff;
}

.contact-file-preview {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.contact-file-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.contact-file-pill span {
  overflow: hidden;
  color: rgba(245, 247, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-file-pill button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}

.contact-counter {
  color: rgba(222, 228, 248, 0.58);
  font-size: 0.74rem;
  font-weight: 720;
  text-align: right;
}

.contact-form-message {
  min-height: 20px;
  margin: 0;
  color: rgba(226, 234, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
}

.contact-form-message.error {
  color: #ffaaaa;
}

.contact-hold-submit {
  position: relative;
  min-height: 52px;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  background: #2378ff;
  font-size: 0.96rem;
  font-weight: 850;
}

.contact-hold-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.22);
  transform: scaleX(var(--hold-progress, 0));
  transform-origin: left center;
  transition: transform 80ms linear;
}

.contact-hold-submit span {
  position: relative;
  z-index: 1;
}

.contact-hold-submit:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.contact-required-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 196, 87, 0.18);
  border-radius: 18px;
  background: rgba(255, 196, 87, 0.08);
  color: rgba(255, 239, 210, 0.88);
}

.contact-required-card[hidden] {
  display: none;
}

.sidebar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) max-content max-content;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 12px var(--sidebar-gutter);
  border-right: 1px solid var(--sidebar-border);
  background:
    linear-gradient(180deg, rgba(2, 30, 83, 0.513), rgba(76, 46, 99, 0.499)),
    linear-gradient(115deg, rgba(6, 18, 52, 0.05), rgba(0, 0, 0, 0.02) 56%, rgba(0, 0, 0, 0.07)),
    var(--sidebar);
  box-shadow:
    inset -1px 0 rgb(24, 24, 24),
    inset 0 1px rgba(155, 155, 155, 0.08),
    18px 0 60px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  backdrop-filter: blur(2px) saturate(1.08);
  -webkit-backdrop-filter: blur(2px) saturate(1.08);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: -40% -26%;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(8, 24, 72, 0.06), transparent 0 22%, transparent 38%),
    radial-gradient(circle at 82% 72%, rgba(1, 7, 22, 0.1), transparent 0 42%),
    linear-gradient(145deg, rgba(2, 11, 34, 0.07), transparent 48%, rgba(0, 0, 0, 0.14));
  filter: none;
  opacity: 0.16;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: sidebarAura 13s ease-in-out infinite alternate;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-scrim {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 2px 2px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 70px;
  height: 70px;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  box-shadow: none;
}

.brand-name {
  color: rgba(255, 255, 255, 0.94);
  font-family: "Google Sans", Arial, sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.account-button {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  width: 100%;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(88, 101, 255, 0.18), rgba(255, 255, 255, 0.045) 52%, rgba(61, 139, 255, 0.13));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 14px 34px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.account-button::before {
  content: "";
  position: absolute;
  inset: -40% -55%;
  background: linear-gradient(110deg, transparent 16%, rgba(255, 255, 255, 0.16), transparent 48%);
  opacity: 0;
  transform: translateX(-72%);
  pointer-events: none;
  transition: opacity 220ms ease, transform 620ms ease;
}

.account-button:hover,
.account-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(88, 101, 255, 0.28), rgba(255, 255, 255, 0.06) 52%, rgba(61, 139, 255, 0.2));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.14),
    0 18px 40px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.account-button:hover::before,
.account-button:focus-visible::before {
  opacity: 1;
  transform: translateX(72%);
}

.account-button.signed-in {
  border-color: rgba(126, 220, 137, 0.2);
  background:
    radial-gradient(circle at 18% 12%, rgba(126, 220, 137, 0.17), transparent 34%),
    linear-gradient(135deg, rgba(88, 101, 255, 0.2), rgba(255, 255, 255, 0.045) 52%, rgba(126, 220, 137, 0.12));
}

.admin-nav-button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
  min-height: 46px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(118, 162, 255, 0.16);
  border-radius: 15px;
  background:
    radial-gradient(circle at 18% 18%, rgba(116, 171, 255, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(29, 49, 92, 0.64), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 14px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.admin-nav-button[hidden] {
  display: none;
}

.admin-nav-button::before {
  content: "";
  position: absolute;
  inset: -55% -70%;
  background: linear-gradient(105deg, transparent 24%, rgba(134, 180, 255, 0.22), transparent 58%);
  opacity: 0;
  transform: translateX(-62%);
  transition: opacity 220ms ease, transform 720ms ease;
  pointer-events: none;
}

.admin-nav-button:hover,
.admin-nav-button:focus-visible,
.admin-nav-button.active {
  border-color: rgba(142, 188, 255, 0.34);
  background:
    radial-gradient(circle at 18% 18%, rgba(116, 171, 255, 0.3), transparent 34%),
    linear-gradient(135deg, rgba(34, 59, 111, 0.82), rgba(255, 255, 255, 0.06));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.14),
    0 18px 38px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.admin-nav-button:hover::before,
.admin-nav-button:focus-visible::before,
.admin-nav-button.active::before {
  opacity: 1;
  transform: translateX(68%);
}

.admin-nav-button span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
  place-items: center;
  text-align: center;
}

.admin-nav-button strong {
  overflow: hidden;
  color: rgba(247, 250, 255, 0.96);
  font-size: 0.9rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-orb {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e9efff;
  box-shadow:
    0 10px 24px rgba(68, 90, 255, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.32);
  overflow: hidden;
}

.account-orb img,
.account-avatar-large img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.account-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.account-copy strong,
.account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 0.84rem;
  font-weight: 650;
}

.account-copy small {
  color: var(--subtle);
  font-size: 0.72rem;
}

.rate-limit-open {
  overflow: hidden;
}

.attachment-auth-open,
.change-password-open {
  overflow: hidden;
}

.guest-access-open {
  overflow: hidden;
}

.app-shell.account-mode {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.account-mode .sidebar,
.app-shell.account-mode .sidebar-scrim {
  display: none;
}

.main-area.account-mode {
  grid-template-rows: minmax(0, 1fr);
}

.main-area.account-mode .top-bar,
.main-area.account-mode .chat-panel,
.main-area.account-mode .admin-portal {
  display: none;
}

.account-modal {
  position: relative;
  z-index: 4;
  display: grid;
  grid-row: 1 / -1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
  place-items: stretch;
}

.account-modal[hidden],
.account-modal-view[hidden],
.account-danger-confirm[hidden],
.rate-limit-modal[hidden],
.guest-access-modal[hidden],
.attachment-limit-modal[hidden],
.attachment-auth-modal[hidden],
.admin-reply-modal[hidden],
.unsafe-user-modal[hidden],
.unsafe-warning-modal[hidden],
.contact-reply-modal[hidden] {
  display: none;
}

.account-interface-scroll {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-items: center;
  overflow: auto;
  padding: 80px 24px 40px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.account-interface-scroll::-webkit-scrollbar {
  display: none;
}

.account-back-button {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  z-index: 7;
  display: inline-grid;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  place-items: center;
  color: rgba(248, 250, 255, 0.94);
  background: rgba(17, 18, 24, 0.88);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 18px 42px rgba(0, 0, 0, 0.34);
  font-size: 0.86rem;
  font-weight: 760;
  transition:
    border-color 170ms ease,
    background 170ms ease,
    box-shadow 170ms ease,
    transform 170ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.account-back-button:hover,
.account-back-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(28, 30, 39, 0.94);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.14),
    0 22px 50px rgba(0, 0, 0, 0.42);
  transform: translateY(-1px);
}

.account-modal-panel {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(590px, 100%);
  max-height: min(780px, calc(100dvh - 124px));
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 0, rgba(120, 150, 255, 0.16), transparent 34%),
    radial-gradient(circle at 100% 28%, rgba(255, 255, 255, 0.08), transparent 38%),
    rgba(17, 18, 24, 0.88);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 28px 86px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  animation: accountViewIn 260ms ease both;
}

.account-modal[data-active-account-view="myaccount"] .account-modal-panel {
  width: min(760px, 100%);
}

.account-modal-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.account-modal-panel::before {
  content: "";
  position: absolute;
  inset: -40% -26%;
  background:
    radial-gradient(circle at 18% 18%, rgba(126, 170, 255, 0.12), transparent 24%),
    linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, 0.09), transparent 42%);
  opacity: 0.5;
  pointer-events: none;
  animation: accountModalSheen 9s ease-in-out infinite alternate;
}

.rate-limit-modal {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 22px;
}

.rate-limit-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.055), transparent 30%),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  animation: modalBackdropIn 220ms ease both;
}

.rate-limit-dialog {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(430px, 100%);
  padding: 26px 22px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.09), transparent 44%),
    linear-gradient(180deg, rgba(22, 22, 27, 0.96), rgba(7, 7, 10, 0.94));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 30px 110px rgba(0, 0, 0, 0.68);
  overflow: hidden;
  animation: modalPanelIn 340ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.rate-limit-dialog::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 32%, rgba(255, 255, 255, 0.055));
  pointer-events: none;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.rate-limit-dialog > * {
  position: relative;
  z-index: 1;
}

.rate-limit-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.075);
  transition: background 160ms ease, transform 160ms ease;
}

.rate-limit-close:hover,
.rate-limit-close:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.04);
}

.rate-limit-warning-icon {
  display: block;
  width: 54px;
  height: 54px;
  background: #c9cbd2;
  mask: url("../icon_library/warning.png") center / contain no-repeat;
  -webkit-mask: url("../icon_library/warning.png") center / contain no-repeat;
}

.guest-access-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 20px;
}

.guest-access-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(82, 111, 255, 0.12), transparent 34%),
    rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  animation: modalBackdropIn 220ms ease both;
}

.guest-access-dialog {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(520px, calc(100vw - 30px));
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 0, rgba(101, 128, 255, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(27, 28, 36, 0.98), rgba(11, 12, 17, 0.96));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 34px 110px rgba(0, 0, 0, 0.68);
  color: #fff;
  overflow: hidden;
  animation: modalPanelIn 340ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.guest-access-dialog::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 30%, rgba(102, 138, 255, 0.16));
  pointer-events: none;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.guest-access-dialog > * {
  position: relative;
  z-index: 1;
}

.guest-access-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  transition: background 160ms ease, transform 160ms ease;
}

.guest-access-close:hover,
.guest-access-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.04);
}

.guest-access-orb {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 18px 48px rgba(54, 92, 255, 0.18);
}

.guest-access-orb img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.guest-access-copy {
  display: grid;
  gap: 10px;
  padding-right: 22px;
}

.guest-access-copy h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.8rem, 5vw, 2.55rem);
  line-height: 1.02;
  font-weight: 820;
}

.guest-access-copy p {
  margin: 0;
  color: rgba(235, 237, 248, 0.78);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 600;
}

.guest-access-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
}

.guest-access-primary,
.guest-access-secondary {
  min-width: 0;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 760;
  transition:
    border-color 170ms ease,
    background 170ms ease,
    box-shadow 170ms ease,
    transform 170ms ease,
    filter 170ms ease;
}

.guest-access-primary {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(88, 101, 255, 0.98), rgba(60, 144, 255, 0.98)),
    var(--accent);
  color: #fff;
  box-shadow:
    0 18px 48px rgba(59, 103, 255, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.3);
}

.guest-access-secondary {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.075);
  color: rgba(244, 246, 255, 0.9);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.guest-access-primary:hover,
.guest-access-primary:focus-visible,
.guest-access-secondary:hover,
.guest-access-secondary:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.guest-access-primary:focus-visible,
.guest-access-secondary:focus-visible,
.guest-access-close:focus-visible {
  outline: 2px solid rgba(126, 156, 255, 0.9);
  outline-offset: 3px;
}

@media (max-width: 540px) {
  .guest-access-dialog {
    padding: 24px;
  }

  .guest-access-copy {
    padding-right: 0;
  }

  .guest-access-actions {
    grid-template-columns: 1fr;
  }
}

.attachment-limit-modal {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: grid;
  place-items: center;
  padding: 20px;
}

.attachment-limit-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(15px) saturate(1.08);
  -webkit-backdrop-filter: blur(15px) saturate(1.08);
  animation: modalBackdropIn 220ms ease both;
}

.attachment-limit-dialog {
  position: relative;
  display: grid;
  gap: 22px;
  width: min(500px, calc(100vw - 30px));
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 0, rgba(112, 142, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(30, 31, 39, 0.98), rgba(11, 12, 17, 0.97));
  color: #fff;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 34px 110px rgba(0, 0, 0, 0.68);
  overflow: hidden;
  animation: modalPanelIn 340ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.attachment-limit-dialog::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 30%, rgba(102, 138, 255, 0.16));
  pointer-events: none;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.attachment-limit-dialog > * {
  position: relative;
  z-index: 1;
}

.attachment-limit-copy {
  display: grid;
  gap: 11px;
}

.attachment-limit-kicker {
  margin: 0;
  color: rgba(180, 194, 255, 0.86);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.attachment-limit-copy h2 {
  max-width: 10ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 7vw, 3.1rem);
  font-weight: 850;
  line-height: 0.96;
}

.attachment-limit-copy p:not(.attachment-limit-kicker) {
  margin: 0;
  color: rgba(235, 237, 248, 0.78);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
}

.attachment-limit-ok {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(88, 101, 255, 0.98), rgba(60, 144, 255, 0.98)),
    var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  box-shadow:
    0 18px 48px rgba(59, 103, 255, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.3);
  transition:
    filter 170ms ease,
    transform 170ms ease;
}

.attachment-limit-ok:hover,
.attachment-limit-ok:focus-visible {
  filter: brightness(1.06);
  transform: translateY(-1px);
  outline: 2px solid rgba(126, 156, 255, 0.9);
  outline-offset: 3px;
}

.admin-reply-modal,
.unsafe-user-modal,
.unsafe-warning-modal,
.contact-reply-modal {
  position: fixed;
  inset: 0;
  z-index: 29;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-reply-backdrop,
.unsafe-user-backdrop,
.unsafe-warning-backdrop,
.contact-reply-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  animation: modalBackdropIn 220ms ease both;
}

.admin-reply-dialog,
.unsafe-user-dialog,
.unsafe-warning-dialog,
.contact-reply-dialog {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(560px, calc(100vw - 30px));
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 14% 0, rgba(71, 126, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(31, 32, 40, 0.98), rgba(12, 13, 18, 0.97));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 34px 110px rgba(0, 0, 0, 0.68);
  animation: modalPanelIn 320ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.unsafe-warning-dialog {
  width: min(520px, calc(100vw - 30px));
  border-color: rgba(255, 255, 255, 0.12);
  background: #050507;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 34px 120px rgba(0, 0, 0, 0.78);
}

.admin-reply-close,
.unsafe-user-close,
.contact-reply-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  transition: background 160ms ease, transform 160ms ease;
}

.admin-reply-close:hover,
.admin-reply-close:focus-visible,
.unsafe-user-close:hover,
.unsafe-user-close:focus-visible,
.contact-reply-close:hover,
.contact-reply-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.04);
}

.admin-reply-kicker,
.unsafe-user-kicker,
.unsafe-warning-kicker,
.contact-reply-kicker {
  margin: 0 0 6px;
  color: rgba(145, 174, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-reply-dialog h2,
.unsafe-user-dialog h2,
.unsafe-warning-dialog h2,
.contact-reply-dialog h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.75rem, 5vw, 2.45rem);
  line-height: 1.04;
}

#adminReplyMeta,
#unsafeWarningText,
.mobile-admin-message,
#contactReplyText {
  margin: 8px 0 0;
  color: rgba(235, 237, 248, 0.8);
  font-size: 0.96rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

#adminReplyInput {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  outline: 0;
  padding: 14px 15px;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
}

#adminReplyInput:focus {
  border-color: rgba(116, 164, 255, 0.56);
  box-shadow: 0 0 0 1px rgba(116, 164, 255, 0.15);
}

.admin-reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-reply-secondary,
.admin-reply-primary,
.unsafe-user-ok,
.unsafe-warning-ok,
.contact-reply-ok {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 820;
  transition:
    background 160ms ease,
    transform 160ms ease,
    filter 160ms ease;
}

.admin-reply-secondary {
  color: rgba(244, 246, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
}

.admin-reply-primary,
.unsafe-user-ok,
.unsafe-warning-ok,
.contact-reply-ok {
  color: #fff;
  background: #2378ff;
}

.admin-reply-secondary:hover,
.admin-reply-primary:hover,
.unsafe-user-ok:hover,
.unsafe-warning-ok:hover,
.contact-reply-ok:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.unsafe-user-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.unsafe-user-header img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: #dfe7ff;
}

.unsafe-user-header > div {
  min-width: 0;
}

.unsafe-user-header h2,
.unsafe-user-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unsafe-user-header span {
  display: block;
  margin-top: 5px;
  color: rgba(231, 236, 255, 0.68);
  font-size: 0.86rem;
  font-weight: 650;
}

.unsafe-user-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.unsafe-user-details > div {
  display: grid;
  grid-template-columns: minmax(96px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.unsafe-user-details dt,
.unsafe-user-details dd {
  margin: 0;
  min-width: 0;
}

.unsafe-user-details dt {
  color: rgba(215, 224, 255, 0.58);
  font-size: 0.74rem;
  font-weight: 800;
}

.unsafe-user-details dd {
  overflow: hidden;
  color: rgba(248, 250, 255, 0.94);
  font-size: 0.84rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-reply-admin {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-right: 44px;
}

.contact-reply-admin img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #dfe7ff;
}

.contact-reply-admin div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.contact-reply-admin span,
.contact-reply-admin small {
  color: rgba(222, 228, 248, 0.62);
  font-size: 0.74rem;
  font-weight: 700;
}

.contact-reply-admin strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-reply-original {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.contact-reply-original button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  color: rgba(242, 245, 255, 0.9);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 850;
}

.contact-reply-original img {
  width: 18px;
  height: 18px;
  opacity: 0.88;
}

.contact-reply-original p {
  margin: 0;
  color: rgba(232, 236, 255, 0.76);
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.attachment-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 18px;
}

.attachment-auth-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  cursor: default;
  animation: modalBackdropIn 220ms ease both;
}

.attachment-auth-dialog {
  position: relative;
  display: grid;
  gap: 20px;
  width: min(460px, calc(100vw - 28px));
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  background: #343438;
  color: #fff;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 28px 90px rgba(0, 0, 0, 0.58);
  overflow: hidden;
  animation: modalPanelIn 340ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.attachment-auth-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.11), transparent 26%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 52%);
  pointer-events: none;
}

.attachment-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  transition: background 160ms ease, transform 160ms ease;
}

.attachment-auth-close:hover,
.attachment-auth-close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.04);
}

.attachment-auth-close img {
  width: 13px;
  height: 13px;
  filter: brightness(0) invert(1);
}

.attachment-auth-copy,
.attachment-auth-form,
.attachment-auth-ok {
  position: relative;
  z-index: 1;
}

.attachment-auth-copy {
  display: grid;
  gap: 10px;
}

.attachment-auth-copy h2 {
  margin: 0;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1.08;
}

.attachment-auth-copy p {
  margin: 0;
  color: rgba(245, 245, 248, 0.82);
  font-size: 0.98rem;
  font-weight: 560;
  line-height: 1.5;
}

.attachment-auth-form {
  display: grid;
  gap: 14px;
}

.attachment-auth-form label {
  display: grid;
  gap: 8px;
}

.attachment-auth-form label.password-label,
.account-modal-form label.password-label {
  position: relative;
}

.attachment-auth-form label span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
  font-weight: 720;
}

.attachment-auth-form input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  outline: 0;
  padding: 0 14px;
  color: #fff;
  background: rgba(8, 8, 10, 0.34);
  font: inherit;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.attachment-auth-form input:focus {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(255, 255, 255, 0.08);
}

.attachment-auth-form label.password-label input,
.account-modal-form label.password-label input {
  padding-right: 54px;
}

.password-input {
  -webkit-text-security: disc;
}

.password-label.password-visible .password-input {
  -webkit-text-security: none;
}

.password-toggle-button {
  position: absolute;
  right: 7px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition:
    background 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.password-toggle-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.password-toggle-button:active {
  transform: scale(0.94);
}

.password-toggle-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

.password-toggle-button:disabled {
  cursor: default;
  opacity: 0.45;
  pointer-events: none;
}

.password-toggle-button img {
  display: block;
  width: 21px;
  height: 21px;
  object-fit: contain;
  opacity: 0.94;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.attachment-auth-message {
  min-height: 16px;
  margin: -3px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.attachment-auth-message.error {
  color: #ffd0d0;
}

.attachment-auth-ok {
  justify-self: end;
  min-width: 106px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 760;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.attachment-auth-ok:hover,
.attachment-auth-ok:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.attachment-auth-ok:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.captcha-slot {
  --captcha-edge-crop: 3px;
  --captcha-bottom-crop: 4px;
  position: relative;
  display: flex;
  width: calc(304px - (var(--captcha-edge-crop) * 2));
  max-width: 100%;
  height: calc(78px - var(--captcha-edge-crop) - var(--captcha-bottom-crop));
  min-height: calc(78px - var(--captcha-edge-crop) - var(--captcha-bottom-crop));
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #222;
  overflow: hidden;
  line-height: 0;
}

.captcha-slot[data-captcha-state="loading"],
.captcha-slot[data-captcha-state="error"] {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 78px;
  justify-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
  line-height: normal;
}

.captcha-widget-clip {
  flex: 0 0 auto;
  width: 304px;
  height: 78px;
  overflow: visible;
  transform: translate(calc(var(--captcha-edge-crop) * -1), calc(var(--captcha-edge-crop) * -1));
  transform-origin: top left;
}

.captcha-widget-clip > div,
.captcha-widget-clip iframe {
  display: block;
  border: 0 !important;
}

.captcha-slot[data-captcha-state="loading"] .captcha-widget-clip,
.captcha-slot[data-captcha-state="error"] .captcha-widget-clip {
  display: none;
}

.captcha-slot[data-captcha-state="loading"]::before,
.captcha-slot[data-captcha-state="error"]::before {
  content: attr(data-captcha-message);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
  font-weight: 720;
  text-align: center;
}

.captcha-slot[data-captcha-state="loading"]::after {
  content: "";
  width: 17px;
  height: 17px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  animation: captcha-spinner 820ms linear infinite;
}

.captcha-slot[data-captcha-state="error"] {
  border-color: rgba(255, 126, 126, 0.28);
  background: rgba(255, 70, 70, 0.1);
}

.captcha-slot.danger[data-captcha-state="loading"],
.captcha-slot.danger[data-captcha-state="error"] {
  border-color: rgba(255, 118, 118, 0.18);
  background: rgba(30, 0, 0, 0.14);
}

.captcha-slot[hidden],
.captcha-slot.captcha-disabled {
  display: none;
}

.rate-limit-dialog-copy {
  display: grid;
  gap: 8px;
  max-width: 330px;
  text-align: center;
}

.rate-limit-dialog h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.05;
}

.rate-limit-dialog-copy p:last-child {
  margin: 0;
  color: rgba(232, 232, 240, 0.72);
  line-height: 1.55;
  white-space: pre-line;
}

.rate-limit-countdown-card {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 150px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(0, 0, 0, 0.24);
}

.rate-limit-countdown-card span {
  color: #fff;
  font-size: 3.3rem;
  font-weight: 820;
  line-height: 0.96;
  letter-spacing: 0;
}

.rate-limit-countdown-card small {
  color: rgba(232, 232, 240, 0.58);
  font-size: 0.78rem;
  font-weight: 650;
}

.rate-limit-dialog-meter {
  width: min(290px, 100%);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.rate-limit-dialog-meter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.96));
  transform-origin: left center;
  transform: scaleX(var(--rate-popup-fill, 1));
  transition: transform 280ms linear;
}

.rate-limit-ok {
  min-width: 130px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  font-weight: 760;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
  transition: background 160ms ease, transform 160ms ease;
}

.rate-limit-ok:hover,
.rate-limit-ok:focus-visible {
  background: rgba(255, 255, 255, 0.17);
  transform: translateY(-1px);
}

.account-modal-panel > * {
  position: relative;
  z-index: 1;
}

.account-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.account-modal-kicker {
  margin: 0 0 6px;
  color: rgba(174, 184, 255, 0.86);
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-modal-header h2,
.account-profile-summary h3,
.account-settings-panel h3 {
  margin: 0;
  color: #fff;
  line-height: 1.12;
}

.account-modal-header h2 {
  font-size: 1.72rem;
}

.account-modal-header p,
.account-profile-summary p,
.account-settings-panel p,
.account-danger-confirm p,
.account-form-message {
  margin: 0;
  color: rgba(226, 226, 236, 0.72);
  line-height: 1.55;
}

.account-modal-view {
  display: grid;
  gap: 13px;
  animation: accountViewIn 260ms ease both;
}

.account-modal-form {
  display: grid;
  gap: 12px;
}

.account-modal-form label {
  display: grid;
  gap: 7px;
}

.account-modal-form label span {
  color: rgba(232, 232, 240, 0.78);
  font-size: 0.78rem;
  font-weight: 650;
}

.account-modal-form label span small {
  color: rgba(232, 232, 240, 0.48);
  font-size: 0.68rem;
  font-weight: 650;
}

.account-modal-form input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.24);
  color: #fff;
  outline: 0;
  padding: 0 13px;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.account-modal-form input:focus {
  border-color: rgba(174, 184, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(88, 101, 255, 0.12);
  transform: translateY(-1px);
}

.account-primary-action,
.account-secondary-action,
.account-danger-action,
.account-link-button {
  min-height: 42px;
  border-radius: 999px;
  font-weight: 760;
  transition:
    border-color 170ms ease,
    background 170ms ease,
    box-shadow 170ms ease,
    color 170ms ease,
    transform 170ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 170ms ease;
}

.account-primary-action {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, #5865ff, #3d8bff);
  color: #fff;
  box-shadow: 0 16px 34px rgba(61, 139, 255, 0.24);
}

.account-primary-action:hover,
.account-primary-action:focus-visible {
  box-shadow: 0 20px 46px rgba(61, 139, 255, 0.32);
  transform: translateY(-2px);
}

.account-secondary-action,
.account-link-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: #f3f3f3;
}

.account-link-button {
  justify-self: center;
  min-height: 34px;
  padding: 0 12px;
  color: rgba(217, 222, 255, 0.9);
  font-size: 0.82rem;
}

.account-secondary-action:hover,
.account-secondary-action:focus-visible,
.account-link-button:hover,
.account-link-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.account-profile-picture-actions {
  display: flex;
  gap: 8px;
}

.account-profile-picture-actions > button {
  flex: 1 1 0;
  min-width: 0;
}

.account-profile-picture-message {
  min-height: 18px;
  margin: -3px 2px 0 !important;
  color: rgba(218, 222, 236, 0.58) !important;
  font-size: 0.73rem;
  font-weight: 680;
}

.account-profile-picture-message.error {
  color: #ffb0b0 !important;
}

.account-danger-action {
  border: 1px solid rgba(255, 107, 107, 0.24);
  background: rgba(255, 107, 107, 0.08);
  color: #ffb0b0;
}

.account-danger-action:hover,
.account-danger-action:focus-visible,
.account-danger-action.solid {
  background: rgba(255, 107, 107, 0.18);
  color: #fff;
  transform: translateY(-2px);
}

.account-form-message {
  min-height: 20px;
  font-size: 0.82rem;
}

.account-form-message.error {
  color: #ff9b9b;
}

.account-profile-summary {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
}

.account-avatar-large {
  display: block;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #e9efff;
  box-shadow:
    0 18px 46px rgba(61, 139, 255, 0.24),
    inset 0 1px rgba(255, 255, 255, 0.32);
  overflow: hidden;
}

.account-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.account-stat-grid article {
  display: grid;
  gap: 6px;
  min-height: 92px;
  align-content: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.042);
}

.account-stat-grid span {
  color: var(--muted);
  font-size: 0.74rem;
}

.account-stat-grid strong {
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.account-settings-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.038);
}

.response-format-setting,
.input-style-setting {
  display: grid;
  gap: 7px;
}

.response-format-label,
.input-style-label {
  color: rgba(214, 216, 226, 0.58) !important;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.response-format-slider,
.input-style-slider {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 46px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 999px;
  background: rgba(10, 11, 16, 0.72);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.07),
    0 12px 26px rgba(0, 0, 0, 0.22);
}

.response-format-slider-fill,
.input-style-slider-fill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, #5865ff, #3d8bff);
  box-shadow: 0 10px 24px rgba(61, 139, 255, 0.24);
  transition:
    transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 180ms ease;
}

.response-format-setting[data-response-format="detailed"] .response-format-slider-fill,
.input-style-setting[data-input-style="newline"] .input-style-slider-fill {
  transform: translateX(100%);
}

.response-format-option,
.input-style-option {
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: rgba(229, 231, 240, 0.68);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 820;
  transition:
    color 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.response-format-option.active,
.input-style-option.active {
  color: #fff;
}

.response-format-option:hover,
.response-format-option:focus-visible,
.input-style-option:hover,
.input-style-option:focus-visible {
  color: #fff;
  transform: translateY(-1px);
}

.response-format-option:disabled,
.input-style-option:disabled {
  cursor: wait;
  opacity: 0.72;
}

.response-format-message,
.input-style-message {
  min-height: 18px;
  color: rgba(218, 222, 236, 0.58) !important;
  font-size: 0.73rem;
  font-weight: 680;
}

.response-format-message.error,
.input-style-message.error {
  color: #ffb0b0 !important;
}

.account-danger-confirm {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 107, 107, 0.18);
  border-radius: 18px;
  background: rgba(255, 107, 107, 0.075);
  animation: accountViewIn 180ms ease both;
}

.account-danger-confirm > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-primary-action:disabled,
.account-secondary-action:disabled,
.account-danger-action:disabled,
.account-modal-form input:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.sidebar-toggle,
.add-chat-button,
.attach-button,
.send-button,
.mobile-sidebar-button,
.message-copy-button {
  display: inline-grid;
  place-items: center;
}

.ui-icon {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: brightness(0) invert(1);
}

.collapse-icon {
  width: 17px;
  height: 17px;
  opacity: 0.82;
}

.new-chat-icon {
  width: 14px;
  height: 14px;
}

.attach-icon {
  width: 14px;
  height: 14px;
}

.send-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1) !important;
}

.file-input {
  display: none;
}

.x-icon {
  width: 12px;
  height: 12px;
  opacity: 1;
  filter: brightness(0) invert(1) !important;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.sidebar-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.06);
  cursor:col-resize
}

.sidebar-toggle:hover .collapse-icon {
  opacity: 1;
  cursor:col-resize
}

.chats-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  margin-top: 8px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 2px 2px;
}

.panel-heading p {
  margin: 0;
  color: rgba(217, 220, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
}

.add-chat-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  gap: 0;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(88, 101, 255, 0.95), rgba(61, 139, 255, 0.95)),
    var(--accent);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  box-shadow:
    0 9px 22px rgba(68, 90, 255, 0.24),
    inset 0 1px rgba(255, 255, 255, 0.28);
  overflow: hidden;
  transition:
    box-shadow 400ms ease,
    transform 400ms ease,
    filter 400ms ease;
}

.add-chat-button::after {
  content: none;
}

.add-chat-button:hover {
  filter: brightness(1.08);
  box-shadow:
    0 13px 30px rgba(68, 90, 255, 0.34),
    inset 0 1px rgba(255, 255, 255, 0.34);
  transform: translateY(-1px) scale(1.02);
}

.chat-search {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  width: 100%;
  margin: 0;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.18);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.chat-search:focus-within {
  border-color: rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 12px 34px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.chat-search-icon {
  width: 14px;
  height: 14px;
  opacity: 0.68;
  transition: opacity 160ms ease, transform 160ms ease;
}

.chat-search:focus-within .chat-search-icon {
  opacity: 1;
  transform: scale(1.06);
}

.chat-search input {
  min-width: 0;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
}

.chat-search input::placeholder {
  color: rgba(180, 180, 180, 0.68);
}

.chat-search input::-webkit-search-cancel-button {
  appearance: none;
}

.chat-list {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.chat-list,
.chat-log {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.chat-list::-webkit-scrollbar,
.chat-log::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.rate-limit-panel {
  position: relative;
  display: grid;
  align-self: end;
  grid-template-rows: auto auto auto;
  gap: 10px;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 14px;
  border: 2px solid #0095ff;
  border-radius: 16px;
  background: #2d4883;
  box-shadow: none;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.rate-limit-refresh {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.rate-limit-refresh:hover,
.rate-limit-refresh:focus-visible {
  background: rgba(255, 255, 255, 0.055);
}

.rate-limit-refresh:active {
  transform: scale(0.92);
}

.rate-limit-refresh:disabled {
  cursor: default;
}

.rate-limit-refresh img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  filter: grayscale(1) brightness(0) invert(1);
  opacity: 0.48;
  transition: opacity 180ms ease, filter 180ms ease;
}

.rate-limit-refresh:hover img,
.rate-limit-refresh:focus-visible img {
  opacity: 0.68;
}

.rate-limit-refresh.refreshing img {
  animation: rate-limit-refresh-spin 760ms cubic-bezier(0.32, 0.72, 0.18, 1) both;
}

@keyframes rate-limit-refresh-spin {
  0% { transform: rotate(0deg) scale(1); }
  16% { transform: rotate(38deg) scale(0.88); }
  48% { transform: rotate(205deg) scale(1.09); }
  74% { transform: rotate(318deg) scale(0.96); }
  90% { transform: rotate(354deg) scale(1.025); }
  100% { transform: rotate(360deg) scale(1); }
}

.rate-limit-panel.limited {
  border-color: rgba(255, 88, 88, 0.42);
  background: #241013;
}

.rate-limit-copy {
  display: grid;
  gap: 4px;
  min-height: 0;
  padding-right: 34px;
}

.rate-limit-copy span,
.rate-limit-panel p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
}

.rate-limit-copy span {
  color: rgba(236, 236, 242, 0.64);
}

.rate-limit-panel p {
  color: #fff;
  font-size: 0.84rem;
  line-height: 1.25;
}

.rate-limit-copy strong {
  color: #f7f7ff;
  font-size: 1.72rem;
  line-height: 1;
  white-space: nowrap;
}

.rate-limit-track {
  position: relative;
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.rate-limit-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(235, 235, 245, 0.82), rgba(255, 255, 255, 0.96));
  box-shadow: none;
  transform-origin: left center;
  transform: scaleX(var(--rate-fill, 1));
  transition:
    transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1),
    background 180ms ease;
}

.rate-limit-panel.limited .rate-limit-track span {
  background: linear-gradient(90deg, #ff6b6b, #ffb36b);
}

.rate-limit-panel.limited .rate-limit-track {
  background: rgba(255, 118, 118, 0.22);
}

.sidebar-footer {
  align-self: end;
  display: grid;
  gap: 9px;
  width: 100%;
}

.contact-us-button {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  color: #fff;
  background: #2378ff;
  box-shadow: none;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  transition:
    background 160ms ease,
    transform 160ms ease,
    filter 160ms ease;
}

.contact-us-button:hover,
.contact-us-button:focus-visible {
  background: #3287ff;
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.contact-us-button[hidden] {
  display: none;
}

.sidebar-legal-links {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  color: #62a2ff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.sidebar-legal-links div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.sidebar-legal-links a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.sidebar-legal-links a:hover,
.sidebar-legal-links a:focus-visible {
  color: #9bc5ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px 26px;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  padding: 5px 4px 5px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  transition:
    border-color 170ms ease,
    background 170ms ease,
    box-shadow 170ms ease,
    transform 170ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.chat-item.empty-chat {
  grid-template-columns: minmax(0, 1fr) 26px;
}

.chat-item.empty-chat.renaming {
  grid-template-columns: minmax(0, 1fr) 26px 26px;
}

.chat-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0 50%, rgba(88, 101, 255, 0.2), transparent 46%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 170ms ease, transform 170ms ease;
  pointer-events: none;
}

.chat-item:hover,
.chat-item.active {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.08);
  transform: none;
}

.chat-item:hover::before,
.chat-item.active::before {
  opacity: 1;
  transform: translateX(0);
}

.chat-open-button {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  z-index: 1;
}

.chat-title {
  overflow: hidden;
  color: #e7e7e7;
  font-size: 0.79rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-meta {
  overflow: hidden;
  color: var(--subtle);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rename-chat-button,
.delete-chat-button,
.rename-chat-cancel-button,
.rename-chat-save-button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  z-index: 1;
  border-radius: 50%;
  background: transparent;
  color: var(--subtle);
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease, color 150ms ease;
}

.rename-chat-button img,
.rename-chat-cancel-button img,
.rename-chat-save-button img {
  width: 13px;
  height: 13px;
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.chat-item:hover .delete-chat-button,
.chat-item:hover .rename-chat-button,
.chat-item:hover .rename-chat-cancel-button,
.chat-item:hover .rename-chat-save-button,
.chat-item.renaming .delete-chat-button,
.chat-item.renaming .rename-chat-button,
.chat-item.renaming .rename-chat-cancel-button,
.chat-item.renaming .rename-chat-save-button,
.rename-chat-button:focus-visible,
.delete-chat-button:focus-visible,
.rename-chat-cancel-button:focus-visible,
.rename-chat-save-button:focus-visible {
  opacity: 1;
  transform: translateX(0);
}

.rename-chat-button:hover {
  background: rgba(126, 156, 255, 0.14);
  color: #dfe6ff;
}

.delete-chat-button:hover {
  background: rgba(255, 107, 107, 0.12);
  color: #ff8f8f;
}

.rename-chat-cancel-button:hover {
  background: rgba(255, 107, 107, 0.12);
  color: #ff8f8f;
}

.rename-chat-save-button:hover {
  background: rgba(115, 235, 177, 0.14);
  color: #baf8d9;
}

.chat-rename-form {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.chat-rename-input {
  width: 100%;
  height: 30px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  outline: 0;
  padding: 0 9px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font: inherit;
  font-size: 0.79rem;
  font-weight: 650;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(88, 101, 255, 0.12);
}

.chat-rename-input:focus {
  border-color: rgba(170, 188, 255, 0.72);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 3px rgba(88, 101, 255, 0.18);
}

.empty-chat-list {
  padding: 8px;
  color: var(--subtle);
  font-size: 0.78rem;
}

.main-area {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
}

.top-bar,
.chat-panel {
  position: relative;
  z-index: 2;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
}

.mobile-sidebar-button {
  display: none;
}

.message-search {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(340px, 38vw);
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 10px 28px rgba(0, 0, 0, 0.18);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.message-search:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.035),
    0 12px 30px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.message-search-icon {
  width: 14px;
  height: 14px;
  opacity: 0.72;
  transition: opacity 160ms ease, transform 160ms ease;
}

.message-search:focus-within .message-search-icon {
  opacity: 1;
  transform: scale(1.06);
}

.message-search input {
  min-width: 0;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
}

.message-search input::placeholder {
  color: rgba(180, 180, 180, 0.68);
}

.message-search input::-webkit-search-cancel-button {
  appearance: none;
}

.message-search-count {
  min-width: 24px;
  color: var(--subtle);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.main-area.admin-mode .chat-panel,
.main-area.admin-mode .message-search {
  display: none;
}

.admin-portal {
  position: relative;
  z-index: 2;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.admin-portal[hidden] {
  display: none;
}

.admin-portal-scroll {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 16px;
  width: min(1080px, calc(100vw - 320px));
  height: 100%;
  margin: 0 auto;
  padding: 28px 0 52px;
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.admin-portal-scroll::-webkit-scrollbar {
  display: none;
}

.admin-panel,
.admin-action-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(17, 18, 24, 0.82);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.07),
    0 18px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.admin-panel h2 {
  margin: 4px 0 0;
  color: #f7f9ff;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.admin-action-card button,
.admin-mini-action {
  display: inline-grid;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: rgba(245, 248, 255, 0.92);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 750;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.admin-action-card button:hover,
.admin-mini-action:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.admin-mini-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.admin-mini-action:disabled:hover {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.07);
  transform: none;
}

.admin-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border-radius: 18px;
}

.admin-availability-panel,
.admin-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-panel-heading > span {
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  place-items: center;
  color: rgba(245, 248, 255, 0.9);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-heading-actions > span {
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  place-items: center;
  color: rgba(245, 248, 255, 0.9);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-heading-icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  place-items: center;
  background: rgba(255, 255, 255, 0.065);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.admin-heading-icon-button img,
.admin-account-search img {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.admin-heading-icon-button:hover,
.admin-heading-icon-button:focus-visible,
.admin-heading-icon-button.active {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.admin-account-search {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.admin-account-search[hidden] {
  display: none;
}

.admin-account-search:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.065);
}

.admin-account-search input {
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 650;
}

.admin-account-search input::placeholder {
  color: rgba(232, 236, 255, 0.48);
}

.admin-availability-panel > div > span {
  display: inline-block;
  margin-top: 6px;
  color: rgba(225, 231, 255, 0.64);
  font-size: 0.82rem;
}

.admin-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.admin-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-switch span {
  position: relative;
  width: 58px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 87, 87, 0.16);
  transition: background 180ms ease, border-color 180ms ease;
}

.admin-switch span::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  transition: transform 180ms ease;
}

.admin-switch input:checked + span {
  border-color: rgba(94, 230, 132, 0.38);
  background: rgba(81, 211, 116, 0.22);
}

.admin-switch input:checked + span::before {
  transform: translateX(26px);
}

.admin-switch strong {
  min-width: 84px;
  color: #fff;
  font-size: 0.84rem;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 16px;
  min-width: 0;
}

.admin-list,
.admin-ban-list,
.admin-contact-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.admin-account-row,
.admin-ban-row,
.admin-contact-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.admin-account-row {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.admin-list.compact .admin-account-row {
  grid-template-columns: 36px minmax(0, 1fr);
}

.admin-contact-row {
  align-items: stretch;
  padding: 14px;
  gap: 12px;
}

.admin-contact-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.admin-contact-row-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-contact-row-header strong {
  color: #fff;
  font-size: 0.92rem;
}

.admin-contact-row-header span,
.admin-contact-message,
.admin-contact-file span,
.admin-contact-reply-preview {
  color: rgba(218, 225, 255, 0.66);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-contact-status {
  flex: 0 0 auto;
  display: inline-grid;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  place-items: center;
  color: rgba(245, 248, 255, 0.92) !important;
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.68rem !important;
  font-weight: 850;
}

.admin-contact-row[data-status="replied"] .admin-contact-status {
  color: #d9ffea !important;
  background: rgba(72, 216, 123, 0.15);
}

.admin-contact-row[data-status="ignored"] .admin-contact-status {
  color: rgba(235, 236, 242, 0.74) !important;
  background: rgba(255, 255, 255, 0.055);
}

.admin-contact-message {
  margin: 0;
  color: rgba(244, 246, 255, 0.88);
  white-space: pre-wrap;
}

.admin-contact-file {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.admin-contact-file strong {
  color: #fff;
  font-size: 0.82rem;
}

.admin-contact-file img {
  display: block;
  width: min(320px, 100%);
  max-height: 220px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
}

.admin-contact-file pre {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: rgba(241, 244, 255, 0.86);
  font: 700 0.74rem/1.48 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.admin-contact-file pre::-webkit-scrollbar {
  display: none;
}

.admin-contact-reply-preview {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid rgba(117, 165, 255, 0.52);
  color: rgba(224, 232, 255, 0.74);
}

.admin-avatar {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #dfe7ff;
}

.admin-account-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-account-copy strong,
.admin-account-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-account-copy strong {
  color: #fff;
  font-size: 0.88rem;
}

.admin-account-copy span,
.admin-ban-row span {
  color: rgba(218, 225, 255, 0.62);
  font-size: 0.73rem;
}

.admin-badges,
.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-badge {
  display: inline-grid;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  place-items: center;
  color: rgba(241, 246, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.66rem;
  font-weight: 800;
}

.admin-badge.admin {
  color: #deecff;
  background: rgba(83, 144, 255, 0.18);
}

.admin-badge.rate-limit {
  color: #f3f6ff;
  background: rgba(255, 255, 255, 0.11);
}

.admin-badge.banned {
  color: #ffd8e2;
  background: rgba(255, 82, 112, 0.17);
}

.admin-mini-action {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.7rem;
}

.admin-mini-action.danger,
.admin-action-card.danger button {
  border-color: rgba(255, 108, 108, 0.26);
  color: #ffd9d9;
  background: rgba(255, 70, 70, 0.11);
}

.admin-actions-shell {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-action-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
}

.admin-action-card button {
  align-self: end;
  min-height: 38px;
  height: 38px;
}

.admin-action-card h3 {
  margin: 0;
  color: #fff;
  font-size: 0.92rem;
}

.admin-action-card input,
.admin-action-card textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  outline: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.24);
  font: inherit;
  font-size: 0.82rem;
}

.admin-action-card input {
  height: 38px;
  padding: 0 11px;
}

.admin-action-card textarea {
  resize: vertical;
  min-height: 76px;
  padding: 10px 11px;
}

.admin-action-card input:focus,
.admin-action-card textarea:focus {
  border-color: rgba(132, 183, 255, 0.46);
  box-shadow: 0 0 0 1px rgba(132, 183, 255, 0.14);
}

.admin-status-message {
  min-height: 18px;
  margin: 0;
  color: rgba(222, 230, 255, 0.72);
  font-size: 0.8rem;
}

.admin-status-message.error {
  color: #ffaaaa;
}

.empty-admin-list {
  margin: 0;
  padding: 8px 2px;
  color: rgba(218, 225, 255, 0.54);
  font-size: 0.8rem;
}

.chat-log {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(820px, calc(100vw - 320px));
  min-height: 0;
  max-height: 100%;
  margin: 0 auto;
  padding: 42px 0 96px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-padding-bottom: 96px;
  scroll-behavior: smooth;
}

.empty-state {
  position: absolute;
  left: 50%;
  top: 40%;
  display: grid;
  width: min(680px, 100%);
  opacity: 1;
  transform: translate(-50%, -50%);
  place-items: center;
  pointer-events: none;
}

.empty-state.hidden {
  opacity: 0;
}

.empty-state h1 {
  margin: 0;
  color: #f1f1f1;
  font-size: 3.22rem;
  font-weight: 500;
  line-height: 1.2;
  opacity: 1;
  text-align: center;
  transform: translateY(0);
}

.welcome-word {
  display: inline-block;
  opacity: 1;
}

.message {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  animation: messageIn 160ms ease both;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 16px;
  color: var(--subtle);
  font-size: 0.68rem;
}

.source {
  display: none;
}

.message.user .message-meta {
  justify-content: flex-end;
  padding-right: 4px;
}

.message.learny .message-meta {
  padding-left: 4px;
}

.bubble {
  position: relative;
  width: fit-content;
  min-width: 0;
  max-width: min(680px, 76%);
  margin: 0;
  color: #f4f4f4;
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.bubble-text,
.thought-time {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.message-footer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--subtle);
}

.message.user .message-footer {
  justify-content: flex-end;
  width: 100%;
}

.message.user .user-message-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.user-message-footer-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.user-message-sent-time {
  display: block;
  align-self: flex-start;
  width: 100%;
  margin-top: 1px;
  color: rgba(232, 232, 240, 0.48);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
  text-align: left;
}

.message-text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(236, 236, 236, 0.78);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.message-text-action:hover,
.message-text-action:focus-visible,
.message-text-action.copied {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.message-text-action:disabled {
  cursor: default;
  opacity: 0.36;
  pointer-events: none;
  transform: none;
}

.message-action-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  opacity: 1;
  filter: brightness(0) invert(1);
}

.message-delete-button:hover,
.message-delete-button:focus-visible {
  border-color: rgba(255, 116, 116, 0.38);
  color: #ffd9d9;
  background: rgba(255, 84, 84, 0.12);
}

.message-edit-form {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: min(480px, 68vw);
  padding: 4px;
  border-radius: 18px;
  isolation: isolate;
  animation: editSurfaceIn 260ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.message-edit-form::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 20px;
  background:
    linear-gradient(120deg, rgba(115, 234, 255, 0.72), rgba(107, 105, 255, 0.4), rgba(255, 255, 255, 0.18)),
    rgba(255, 255, 255, 0.04);
  opacity: 0.62;
  filter: blur(0.5px);
  animation: editGlowDrift 2.8s ease-in-out infinite alternate;
}

.message-edit-input {
  width: 100%;
  min-height: 96px;
  max-height: 260px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  outline: 0;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.045)),
    rgba(16, 17, 22, 0.94);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 18px 44px rgba(0, 0, 0, 0.34);
  font: inherit;
  line-height: 1.45;
}

.message-edit-input:focus {
  border-color: rgba(130, 235, 255, 0.58);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(130, 235, 255, 0.16),
    0 22px 52px rgba(0, 0, 0, 0.38);
}

.message-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.message-edit-actions button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  place-items: center;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.message-edit-action-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.message-edit-cancel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(245, 245, 245, 0.82);
  background: rgba(255, 255, 255, 0.06);
}

.message-edit-save {
  border: 1px solid rgba(135, 234, 255, 0.38);
  color: #fff;
  background: linear-gradient(135deg, rgba(74, 153, 255, 0.9), rgba(108, 101, 255, 0.86));
  box-shadow: 0 12px 26px rgba(58, 118, 255, 0.28);
}

.message-edit-actions button:hover,
.message-edit-actions button:focus-visible {
  transform: translateY(-1px);
}

.markdown-body {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p {
  min-width: 0;
  max-width: 100%;
  margin: 0 0 0.76em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 0.08em 0 0.42em;
  color: #fff;
  font-weight: 720;
  line-height: 1.18;
}

.markdown-body h1 {
  font-size: 1.32rem;
}

.markdown-body h2 {
  font-size: 1.18rem;
}

.markdown-body h3 {
  font-size: 1.06rem;
}

.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-size: 0.98rem;
}

.markdown-body ul,
.markdown-body ol {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0.42em 0 0.78em;
  padding-left: 1.24rem;
}

.markdown-body li {
  min-width: 0;
  max-width: 100%;
  margin: 0.22em 0;
  padding-left: 0.08rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body a,
.markdown-body strong,
.markdown-body em {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body strong.local-greeting-username {
  color: #69a7ff;
  font-family: "Google Sans", Arial, sans-serif;
  font-weight: 700;
}

.markdown-body li > ul,
.markdown-body li > ol {
  margin: 0.28em 0 0.28em;
}

.markdown-body blockquote {
  margin: 0.62em 0 0.78em;
  padding: 0.18em 0 0.18em 0.82rem;
  border-left: 3px solid rgba(118, 132, 255, 0.66);
  color: rgba(242, 242, 255, 0.8);
}

.markdown-body blockquote p {
  margin-bottom: 0.48em;
}

.markdown-body a {
  color: #62a8ff;
  font-weight: 750;
  text-decoration: none;
}

.markdown-body a:hover,
.markdown-body a:focus-visible {
  color: #91c5ff;
  text-decoration: none;
}

.markdown-body a:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(98, 168, 255, 0.72);
  outline-offset: 2px;
}

.markdown-body code {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.075);
  color: #f4f5ff;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
  padding: 0.12em 0.34em;
}

.markdown-body pre {
  max-width: 100%;
  margin: 0.58em 0 0.84em;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.42);
  overflow-x: auto;
}

.markdown-body pre code {
  display: block;
  border: 0;
  background: transparent;
  color: #f5f5f5;
  font-size: 0.82rem;
  line-height: 1.52;
  overflow-wrap: normal;
  padding: 0;
  white-space: pre;
}

.markdown-body .markdown-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0.64em 0 0.84em;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: auto;
  scrollbar-width: thin;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.markdown-body .markdown-table-wrap:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(98, 168, 255, 0.72);
  outline-offset: 2px;
}

.markdown-body table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: collapse;
  table-layout: auto;
  color: #f4f4f4;
  font-size: 0.88rem;
}

.markdown-body th,
.markdown-body td {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  vertical-align: top;
  min-width: 10rem;
  max-width: min(24rem, 72vw);
  overflow-wrap: anywhere;
  word-break: normal;
}

.markdown-body table.compact-first-column th:first-child,
.markdown-body table.compact-first-column td:first-child {
  width: 1%;
  min-width: 2.4rem;
  max-width: 4rem;
  white-space: nowrap;
}

.markdown-body th {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 720;
}

.markdown-body tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.035);
}

.markdown-body hr {
  height: 1px;
  margin: 0.84em 0;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
}

.markdown-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.58em 0;
  border-radius: 10px;
}

.task-list-item {
  display: inline-grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.task-list-entry {
  margin-left: -1.08rem;
  list-style: none;
}

.task-list-item input {
  width: 14px;
  height: 14px;
  margin: 0.34em 0 0;
  accent-color: var(--accent-2);
}

.message.user .bubble {
  justify-self: end;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--user-bubble);
}

.message.learny .bubble {
  justify-self: start;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: var(--learny-bubble);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(12px);
}

.message.learny .thought-time {
  max-height: none;
  margin-top: 0;
  color: var(--subtle);
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 1;
  overflow: visible;
  transform: translateY(0);
}

.message.learny button.thought-time {
  position: relative;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  font-family: inherit;
  font-size: 0.72rem;
  font-style: inherit;
  font-variant: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: 1.35;
  text-align: left;
  text-transform: inherit;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  caret-color: transparent;
  cursor: pointer;
}

.message.learny .thought-time.tool-assisted {
  color: #d8d8dd;
  background: transparent;
  -webkit-text-fill-color: currentColor;
  filter: none;
  opacity: 1;
  text-shadow: none;
  animation: none;
  transition: none;
  white-space: nowrap;
}

.message.learny .thought-time.tool-assisted .thought-glow-character {
  display: inline-block;
  color: #d8d8dd;
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
  animation-name: toolAssistedThoughtCharacterShine;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-fill-mode: both;
  animation-delay: calc(var(--thought-glow-delay, 650ms) + var(--shine-index, 0) * 34ms);
  will-change: color, text-shadow;
}

.message.learny .thought-time.tool-assisted .thought-glow-character.is-space {
  width: 0.28em;
  overflow: hidden;
}

.message.learny .thought-time.tool-assisted:hover,
.message.learny .thought-time.tool-assisted:active {
  color: #d8d8dd;
  background: transparent;
  border: 0;
  box-shadow: none;
  opacity: 1;
  transform: none;
  filter: none;
}

.message.learny .thought-time.tool-assisted::selection {
  color: inherit;
  background: transparent;
}

.message.learny .thought-time.tool-assisted .thought-glow-character::selection {
  color: inherit;
  background: transparent;
}

.message.learny .thought-time.tool-assisted:focus-visible {
  outline: 2px solid rgba(126, 174, 255, 0.8);
  outline-offset: 4px;
  border-radius: 3px;
}

.thinking-process-shell {
  position: fixed;
  inset: 0;
  z-index: 24000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 260ms;
}

.thinking-process-shell.is-open {
  pointer-events: none;
  visibility: visible;
  transition-delay: 0s;
}

.thinking-process-panel {
  position: absolute;
  top: 8dvh;
  right: 48px;
  bottom: 8dvh;
  display: flex;
  flex-direction: column;
  width: min(516px, calc(100% - 96px));
  height: auto;
  pointer-events: auto;
  overflow: hidden;
  border: 1px solid rgba(132, 156, 210, 0.26);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 8%, rgba(69, 112, 213, 0.16), transparent 31%),
    linear-gradient(180deg, #12141b 0%, #0d0f15 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  transform: translateX(calc(100% + 36px));
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.thinking-process-shell.is-open .thinking-process-panel {
  transform: translateX(0);
}

.thinking-process-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: max(28px, env(safe-area-inset-top)) 26px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.thinking-process-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #91b5ff;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.thinking-process-header h2 {
  margin: 0;
  color: #f8f9ff;
  font-family: "Google Sans", "Google Sans Text", Arial, sans-serif;
  font-size: clamp(1.25rem, 2.1vw, 1.55rem);
  line-height: 1.15;
}

.thinking-process-eyebrow,
.thinking-process-header h2,
.thinking-process-copy {
  cursor: text;
}

.thinking-process-close {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.055);
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.thinking-process-close:hover,
.thinking-process-close:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
}

.thinking-process-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 26px max(28px, env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
}

.thinking-process-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 58px;
  color: rgba(239, 242, 250, 0.86);
  font-size: 0.91rem;
  font-weight: 610;
  line-height: 1.45;
  opacity: 0;
  transform: translateX(10px);
}

.thinking-process-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.thinking-process-search-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding-left: 0;
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
}

.thinking-process-search-detail {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.thinking-process-search-query {
  color: rgba(186, 190, 201, 0.72);
}

.thinking-process-row.has-search-details {
  min-height: 78px;
}

.thinking-process-row.has-search-details:not(:last-child)::after {
  top: 66px;
}

.thinking-process-shell.is-open .thinking-process-row {
  animation: thinkingProcessRowIn 360ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(90ms + var(--process-row-index) * 65ms);
}

.thinking-process-row:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 48px;
  bottom: -10px;
  left: 18px;
  width: 1px;
  background: linear-gradient(180deg, rgba(132, 178, 255, 0.32), rgba(255, 255, 255, 0.05));
}

.thinking-process-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(132, 178, 255, 0.22);
  border-radius: 12px;
  color: #a9ccff;
  background: rgba(74, 107, 178, 0.12);
}

.thinking-process-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thinking-process-finished {
  margin-top: 9px;
  color: #ffffff;
  font-weight: 740;
}

.thinking-process-finished .thinking-process-icon {
  color: #d9e9ff;
  border-color: rgba(137, 184, 255, 0.4);
  background: linear-gradient(145deg, rgba(81, 123, 233, 0.34), rgba(112, 87, 221, 0.22));
  box-shadow: 0 0 24px rgba(93, 137, 255, 0.12);
}

.message-copy-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  opacity: 0.72;
  transition:
    background 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
}

.message-copy-button:hover,
.message-copy-button:focus-visible,
.message-copy-button.copied {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
  transform: scale(1.06);
}

.message-resend-button:hover,
.message-resend-button:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

.message-copy-button:active {
  transform: scale(0.94);
}

.message-copy-button:disabled {
  cursor: default;
}

.message-copy-icon {
  width: 15px;
  height: 15px;
}

.message.learny.word-revealing .message-footer {
  display: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
}

.message.learny.reveal-complete .message-footer {
  display: inline-flex;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.message.learny.reveal-complete .message-footer > .thought-time,
.message.learny.reveal-complete .message-footer > .workspace-run-count {
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  animation: footerRevealLeftToRight 650ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.message.learny.reveal-complete .message-footer > .thought-time.tool-assisted {
  animation: footerRevealLeftToRight 650ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.message.learny.reveal-complete .message-footer > .footer-control {
  opacity: 0;
  clip-path: none;
  animation: footerControlFadeIn 300ms ease forwards;
  animation-delay: var(--footer-control-delay, 700ms);
}

.message.learny.reveal-complete .message-footer.late-footer-reveal {
  opacity: 1;
  clip-path: none;
}

.message.learny.reveal-complete .message-footer.late-footer-reveal > .thought-time,
.message.learny.reveal-complete .message-footer.late-footer-reveal > .workspace-run-count,
.message.learny.reveal-complete .message-footer.late-footer-reveal > .footer-control {
  opacity: 0;
  animation: none;
}

.message.learny.reveal-complete .message-footer.late-footer-reveal.is-revealing > .thought-time,
.message.learny.reveal-complete .message-footer.late-footer-reveal.is-revealing > .workspace-run-count {
  clip-path: inset(0 100% 0 0);
  animation: footerRevealLeftToRight 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.message.learny.reveal-complete .message-footer.late-footer-reveal.is-revealing > .thought-time.tool-assisted {
  animation: footerRevealLeftToRight 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.message.learny.reveal-complete .message-footer.late-footer-reveal.is-revealing > .footer-control {
  clip-path: none;
  animation: footerControlFadeIn 300ms ease forwards;
  animation-delay: var(--footer-control-delay, 950ms);
}

.message.learny.word-revealing .markdown-body li::marker {
  color: transparent;
  transition: color 220ms ease;
}

.message.learny.word-revealing .markdown-body li.reveal-content-visible::marker {
  color: rgba(242, 242, 255, 0.84);
}

.message.learny.word-revealing .markdown-body .task-list-item input {
  opacity: 0;
  transition: opacity 220ms ease;
}

.message.learny.word-revealing .markdown-body .task-list-item.reveal-content-visible input {
  opacity: 1;
}

.message.learny.word-revealing .markdown-body code,
.message.learny.word-revealing .markdown-body pre,
.message.learny.word-revealing .markdown-body blockquote,
.message.learny.word-revealing .markdown-body .markdown-table-wrap {
  transition:
    opacity 260ms ease,
    border-color 260ms ease,
    background-color 260ms ease;
}

.message.learny.word-revealing .markdown-body code:not(.reveal-content-visible),
.message.learny.word-revealing .markdown-body pre:not(.reveal-content-visible),
.message.learny.word-revealing .markdown-body blockquote:not(.reveal-content-visible),
.message.learny.word-revealing .markdown-body .markdown-table-wrap:not(.reveal-content-visible) {
  opacity: 0;
}

.word-fade {
  display: none;
  opacity: 0;
}

.word-fade.word-visible {
  display: inline;
  animation-name: wordFadeIn;
  animation-timing-function: ease;
  animation-fill-mode: forwards;
}

.stream-text {
  white-space: normal;
}

.stream-chunk-fade {
  display: inline-block;
  animation: streamChunkFade 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  will-change: opacity, filter, transform;
}

.message-search-match .bubble {
  box-shadow:
    0 0 0 1px rgba(174, 184, 255, 0.44),
    0 10px 28px rgba(0, 0, 0, 0.26);
}

.message-search-current .bubble {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.66),
    0 0 24px rgba(88, 101, 255, 0.22),
    0 10px 28px rgba(0, 0, 0, 0.26);
}

.message-search-dim {
  opacity: 0.38;
}

.message.is-deleting {
  pointer-events: none;
  z-index: 3;
  animation: messageGlitchDelete 850ms steps(2, end) forwards;
}

.message.is-deleting .bubble {
  overflow: hidden;
  background-color: #1c1c1f;
  animation: bubbleGlitchDelete 850ms steps(8, end) forwards;
}

.message.is-deleting .bubble-text,
.message.is-deleting .message-footer {
  animation: glitchContentDelete 850ms steps(2, end) forwards;
}

.message.is-deleting .bubble::before,
.message.is-deleting .bubble::after {
  content: attr(data-glitch);
  position: absolute;
  inset: 10px 14px auto 14px;
  max-height: calc(100% - 20px);
  border-radius: inherit;
  color: #fff;
  background-color: #1c1c1f;
  font: inherit;
  font-weight: 760;
  line-height: 1.55;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.is-deleting .bubble::before {
  left: 11px;
  text-shadow: -2px 0 #00ffff, -6px 0 rgba(0, 255, 255, 0.22);
  animation: noiseBeforeDelete 520ms infinite linear alternate-reverse;
}

.message.is-deleting .bubble::after {
  left: 17px;
  text-shadow: 2px 0 #ff00ff, 7px 0 rgba(255, 0, 255, 0.22);
  animation: noiseAfterDelete 430ms infinite linear alternate-reverse;
}

.message.typing,
.message.streaming-response {
  align-content: start;
}

.message.typing .bubble {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 28px;
}

.message.typing.searching-web .bubble {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: start;
  gap: 10px;
  max-width: min(680px, 76%);
  overflow: hidden;
}

.message.typing.searching-web .workspace-agent-phase-stage {
  max-width: 100%;
}

.message.typing.queued .bubble {
  position: relative;
  gap: 2px;
  overflow: hidden;
  color: #d5d7dc;
}

.message.typing.queued .bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-140%);
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.22) 50%, transparent 75%);
  animation: queuedShine 3s ease-in-out infinite;
  pointer-events: none;
}

.queued-estimate {
  color: #d5d7dc;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

@keyframes queuedShine {
  0%, 58% {
    transform: translateX(-140%);
  }
  100% {
    transform: translateX(140%);
  }
}

.workspace-agent-phase-stage {
  position: relative;
  display: inline-grid;
  width: max-content;
  height: 1.55em;
  overflow: hidden;
}

.workspace-agent-phase {
  position: relative;
  grid-area: 1 / 1;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: baseline;
  width: max-content;
  color: transparent;
  background: linear-gradient(
    90deg,
    #8f8f96 0%,
    #8f8f96 39%,
    #c3c3ca 45%,
    #ffffff 50%,
    #bdbdc5 56%,
    #8f8f96 63%,
    #8f8f96 100%
  );
  background-position: 100% 0;
  background-size: 250% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  font-size: 0.92rem;
  font-weight: 760;
  letter-spacing: 0.01em;
  text-shadow: 0 0 12px rgba(225, 225, 235, 0.12);
  will-change: opacity, filter, transform, background-position;
  animation: workspace-agent-shine 3s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.workspace-agent-phase.is-entering {
  animation:
    workspace-agent-phase-enter 560ms cubic-bezier(0.2, 0.72, 0.2, 1) both,
    workspace-agent-shine 3s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.workspace-agent-dots {
  display: inline-flex;
  min-width: 1.05em;
  color: #e7e7eb;
  -webkit-text-fill-color: #e7e7eb;
}

.workspace-agent-dots span {
  opacity: 0.22;
  animation: workspace-agent-dot 1.15s ease-in-out infinite;
}

.workspace-agent-dots span:nth-child(2) { animation-delay: 160ms; }
.workspace-agent-dots span:nth-child(3) { animation-delay: 320ms; }

@keyframes workspace-agent-shine {
  0%, 18% { background-position: 100% 0; }
  58%, 100% { background-position: 0 0; }
}

@keyframes workspace-agent-phase-enter {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(10px);
  }
  68% {
    opacity: 1;
    filter: blur(0.2px);
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes workspace-agent-dot {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  45% { opacity: 1; transform: translateY(-1px); }
}

.composer-zone {
  position: relative;
  width: min(760px, calc(100vw - 332px));
  margin: 0 auto 36px;
  flex: 0 0 auto;
}

.chat-scroll-jump {
  position: absolute;
  left: 50%;
  top: -52px;
  z-index: 6;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 50%;
  color: #fff;
  background: rgba(35, 35, 38, 0.97);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.46);
  cursor: pointer;
  place-items: center;
  transform: translateX(-50%);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
  animation: chatScrollJumpIn 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chat-scroll-jump[hidden] {
  display: none;
}

.chat-scroll-jump:hover,
.chat-scroll-jump:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  outline: none;
  background: rgba(47, 47, 51, 0.99);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.13),
    0 10px 28px rgba(0, 0, 0, 0.52);
  transform: translate(-50%, -2px);
}

.chat-scroll-jump:focus-visible {
  outline: 2px solid rgba(157, 176, 255, 0.82);
  outline-offset: 3px;
}

.chat-scroll-jump:active {
  transform: translate(-50%, 0) scale(0.95);
}

.chat-scroll-jump-icon {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
  opacity: 0.94;
  filter: brightness(0) invert(1) !important;
  transform: rotate(180deg);
}

.chat-scroll-jump-dots {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.chat-scroll-jump.is-typing .chat-scroll-jump-icon {
  display: none;
}

.chat-scroll-jump.is-typing .chat-scroll-jump-dots {
  display: flex;
}

.chat-scroll-jump-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f4f4f5;
  opacity: 0.28;
  animation: chatScrollJumpDot 980ms ease-in-out infinite;
}

.chat-scroll-jump-dots span:nth-child(2) {
  animation-delay: 150ms;
}

.chat-scroll-jump-dots span:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes chatScrollJumpIn {
  from {
    opacity: 0;
    transform: translate(-50%, 7px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes chatScrollJumpDot {
  0%,
  70%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
  min-height: 0;
  margin: 0 0 8px;
  max-height: min(214px, 32vh);
  padding: 0 2px 2px;
  overflow-y: auto;
  scrollbar-width: none;
  animation: attachmentTrayIn 220ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.attachment-tray::-webkit-scrollbar {
  display: none;
}

.attachment-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  flex: 1 1 min(344px, 100%);
  width: min(420px, 100%);
  max-width: 100%;
  padding: 9px 9px 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: rgba(246, 246, 246, 0.94);
  background: rgba(25, 25, 27, 0.94);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 16px 42px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.attachment-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.1), transparent 28%),
    linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  opacity: 0.68;
  pointer-events: none;
}

.attachment-file-icon {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.attachment-info {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attachment-name {
  overflow: hidden;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  color: rgba(213, 213, 213, 0.68);
  font-size: 0.72rem;
  line-height: 1.25;
}

.attachment-remove {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.attachment-remove:hover,
.attachment-remove:focus-visible {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.04);
}

.attachment-remove img {
  width: 11px;
  height: 11px;
}

.composer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 6px;
  min-height: 54px;
  padding: 6px;
  border: 1px solid var(--composer-border);
  border-radius: 28px;
  background: var(--composer);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.composer-disclaimer {
  margin: 9px 0 0;
  color: rgba(232, 232, 238, 0.72);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}

.composer.unavailable {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: #252525;
  opacity: 0.78;
}

.composer.unavailable *,
.composer.unavailable textarea::placeholder {
  cursor: not-allowed;
}

.attach-button,
.send-button {
  align-self: start;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  margin-top: 4px;
  padding: 0;
  border-radius: 50%;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}

.attach-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  transition:
    border-color 300ms ease,
    background 300ms ease,
    color 300ms ease,
    transform 300ms ease;
}

.attach-button:hover,
.attach-button:focus-visible,
.composer.has-attachment .attach-button {
  border-color: #00245e;
  background: #3381ff;
  color: #000;
  transform: scale(1.1);
}

.composer textarea {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  max-height: min(240px, 34vh);
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.35;
  outline: none;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  resize: none;
  scrollbar-width: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.composer textarea::-webkit-scrollbar {
  display: none;
}

.composer textarea:disabled {
  cursor: not-allowed;
}

.composer textarea::placeholder {
  color: #a7a7a7;
}

.send-button {
  background: #676767;
  font-weight: 850;
  transition: background-color 260ms ease, transform 120ms ease;
}

.attachment-image-preview {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  object-fit: cover;
  background: #09090b;
}

.image-attachment-card {
  grid-template-columns: 42px minmax(0, 1fr) 30px;
}

.composer.attachment-drag-active {
  border-color: rgba(92, 151, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(51, 129, 255, 0.2), 0 18px 52px rgba(0, 0, 0, 0.42);
}

.send-button.has-message:not(.pause-mode) {
  background: #3381ff;
}

.send-button.pause-mode {
  background: rgba(255, 255, 255, 0.16);
}

.send-button:hover {
  background: #7a7a7a;
}

.send-button.has-message:not(.pause-mode):hover {
  background: #5596ff;
}

.send-button.pause-mode:hover {
  background: rgba(255, 255, 255, 0.24);
}

.send-button:active {
  transform: scale(0.96);
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.message-attachment {
  display: inline-grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: min(260px, 100%);
  max-width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.052);
}

.message-attachment-icon {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.56rem;
  font-weight: 800;
  text-transform: uppercase;
}

.message-attachment-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.message-attachment-name {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment-meta {
  color: rgba(220, 220, 220, 0.58);
  font-size: 0.68rem;
  line-height: 1.2;
}

.ban-lock {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgb(0, 3, 7), transparent 0 34%),
    #000;
  cursor: not-allowed;
}

.ban-lock[hidden] {
  display: none;
}

body.ban-lock-active {
  overflow: hidden;
  cursor: not-allowed;
}

body.ban-lock-active .app-shell {
  display: none !important;
}

.message-image-attachment {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(360px, 100%);
  padding: 6px;
  overflow: hidden;
}

.message-image-preview-button {
  display: grid;
  width: 100%;
  min-height: 92px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  background: #09090b;
  cursor: zoom-in;
}

.message-image-preview {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.message-image-expired {
  padding: 30px 16px;
  font-size: 0.8rem;
  font-weight: 700;
}

.message-image-caption {
  overflow: hidden;
  padding: 6px 5px 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 18000;
  display: grid;
  place-items: center;
  padding: 72px 24px 96px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.94);
  animation: imageViewerIn 260ms ease both;
}

.image-viewer-image {
  display: block;
  max-width: min(94vw, 1800px);
  max-height: 82vh;
  border-radius: 16px;
  object-fit: contain;
  transform-origin: center;
  transition: transform 180ms ease;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.72);
}

.image-viewer-controls {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.92);
}

.image-viewer-controls button {
  min-width: 42px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@keyframes imageViewerIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ban-lock-card {
  width: min(560px, 100%);
  padding: 32px;
  border-radius: 26px;
  color: #f5f8ff;
  background:
    radial-gradient(circle at 22% 0%, hsl(221, 100%, 3%), transparent 38%),
    linear-gradient(145deg, rgb(0, 0, 0), rgb(0, 9, 29));
  cursor: not-allowed;
}

.ban-lock-card * {
  cursor: not-allowed;
}

.ban-lock-card h1 {
  margin: 0;
  max-width: 440px;
  color: #fff;
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.ban-lock-admin {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.ban-lock-admin img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: rgba(255, 255, 255, 0.12);
}

.ban-lock-admin div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ban-lock-admin span {
  color: rgba(180, 202, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ban-lock-admin strong {
  overflow: hidden;
  color: rgba(250, 252, 255, 0.96);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ban-lock-card dl {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
}

.ban-lock-card dl > div {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.ban-lock-card dt {
  color: rgba(180, 202, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ban-lock-card dd {
  margin: 0;
  color: rgba(250, 252, 255, 0.94);
  font-size: 0.9rem;
  line-height: 1.45;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes attachmentTrayIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sidebarAura {
  0% {
    opacity: 0.48;
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  50% {
    opacity: 0.74;
    transform: translate3d(3%, 2%, 0) scale(1.04);
  }
  100% {
    opacity: 0.56;
    transform: translate3d(-1%, 3%, 0) scale(1.02);
  }
}

@keyframes typingDot {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes editSurfaceIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes editGlowDrift {
  from {
    opacity: 0.44;
    transform: translate3d(-2px, 0, 0);
  }
  to {
    opacity: 0.82;
    transform: translate3d(2px, 0, 0);
  }
}

@keyframes messageGlitchDelete {
  0%, 18% {
    opacity: 1;
    filter: contrast(1.1) saturate(1.4);
    transform: translate3d(0, 0, 0) skewX(0deg);
  }
  20% {
    opacity: 1;
    filter: contrast(2.1) saturate(2.4) hue-rotate(18deg);
    transform: translate3d(-9px, 2px, 0) skewX(18deg);
  }
  24% {
    transform: translate3d(10px, -2px, 0) skewX(-20deg);
  }
  39% {
    opacity: 0.88;
    filter: contrast(2.8) saturate(3) hue-rotate(-24deg);
    transform: translate3d(-14px, 5px, 0) skewX(36deg) skewY(8deg);
  }
  43% {
    transform: translate3d(16px, -4px, 0) skewX(-42deg) skewY(-8deg);
  }
  62% {
    opacity: 0.56;
    filter: blur(0.8px) contrast(3.2) saturate(3.5);
    transform: translate3d(-7px, 8px, 0) scale(1.025);
  }
  78% {
    opacity: 0.24;
    filter: blur(1.6px) contrast(4);
    transform: translate3d(6px, 16px, 0) scale(0.96);
  }
  100% {
    opacity: 0;
    filter: blur(5px) contrast(4.4);
    transform: translate3d(0, 30px, 0) scale(0.9);
  }
}

@keyframes bubbleGlitchDelete {
  0%, 8% {
    clip-path: inset(0 0 0 0);
  }
  10% {
    clip-path: inset(4% 0 72% 0);
  }
  14% {
    clip-path: inset(0 0 0 0);
  }
  19% {
    clip-path: inset(42% 0 18% 0);
  }
  25% {
    clip-path: inset(0 0 0 0);
  }
  35% {
    clip-path: inset(70% 0 3% 0);
  }
  43% {
    clip-path: inset(0 0 64% 0);
  }
  52% {
    clip-path: inset(18% 0 35% 0);
  }
  65% {
    clip-path: inset(58% 0 12% 0);
  }
  79%, 100% {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes glitchContentDelete {
  0%, 24% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  26% {
    opacity: 0.24;
    transform: translate3d(8px, -2px, 0);
  }
  31% {
    opacity: 1;
    transform: translate3d(-8px, 2px, 0);
  }
  57% {
    opacity: 0.18;
    transform: translate3d(13px, 0, 0);
  }
  72%, 100% {
    opacity: 0;
    transform: translate3d(-6px, 8px, 0);
  }
}

@keyframes noiseBeforeDelete {
  0% {
    clip-path: inset(62% 0 28% 0);
    opacity: 0.9;
  }
  8% {
    clip-path: inset(12% 0 76% 0);
    transform: translate3d(-10px, 0, 0);
  }
  16% {
    clip-path: inset(80% 0 4% 0);
    transform: translate3d(7px, -1px, 0);
  }
  28% {
    clip-path: inset(30% 0 48% 0);
    transform: translate3d(-16px, 2px, 0);
  }
  41% {
    clip-path: inset(4% 0 82% 0);
    transform: translate3d(14px, -2px, 0);
  }
  55% {
    clip-path: inset(52% 0 20% 0);
    transform: translate3d(-8px, 1px, 0);
  }
  72% {
    clip-path: inset(22% 0 62% 0);
    opacity: 0.98;
    transform: translate3d(18px, 0, 0);
  }
  100% {
    clip-path: inset(74% 0 10% 0);
    opacity: 0;
    transform: translate3d(-20px, 4px, 0);
  }
}

@keyframes noiseAfterDelete {
  0% {
    clip-path: inset(20% 0 66% 0);
    opacity: 0.86;
  }
  9% {
    clip-path: inset(76% 0 6% 0);
    transform: translate3d(14px, 1px, 0);
  }
  18% {
    clip-path: inset(6% 0 84% 0);
    transform: translate3d(-12px, -1px, 0);
  }
  31% {
    clip-path: inset(44% 0 30% 0);
    transform: translate3d(20px, 2px, 0);
  }
  47% {
    clip-path: inset(12% 0 70% 0);
    transform: translate3d(-18px, -2px, 0);
  }
  63% {
    clip-path: inset(68% 0 16% 0);
    opacity: 1;
    transform: translate3d(10px, 3px, 0);
  }
  81% {
    clip-path: inset(28% 0 46% 0);
    transform: translate3d(-22px, 0, 0);
  }
  100% {
    clip-path: inset(86% 0 0 0);
    opacity: 0;
    transform: translate3d(24px, -4px, 0);
  }
}

@keyframes modalBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPanelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.965);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes accountModalSheen {
  from {
    opacity: 0.42;
    transform: translate3d(-4%, -2%, 0) rotate(-2deg);
  }
  to {
    opacity: 0.74;
    transform: translate3d(4%, 2%, 0) rotate(2deg);
  }
}

@keyframes accountViewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wordFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes streamChunkFade {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(5px) scale(0.992);
  }
  55% {
    opacity: 0.72;
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes footerRevealLeftToRight {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes footerControlFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toolAssistedThoughtCharacterShine {
  0%, 39%, 61%, 100% {
    color: #d8d8dd;
    text-shadow: none;
  }
  46%, 54% {
    color: #49aaff;
    text-shadow:
      0 0 5px rgba(73, 170, 255, 0.95),
      0 0 11px rgba(41, 156, 255, 0.84),
      0 0 19px rgba(41, 156, 255, 0.58);
  }
  50% {
    color: #ffffff;
    text-shadow:
      0 0 4px rgba(255, 255, 255, 0.98),
      0 0 9px rgba(197, 228, 255, 0.94),
      0 0 16px rgba(41, 156, 255, 0.72);
  }
}

@keyframes thinkingProcessRowIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 560px) {
  .thinking-process-panel {
    top: 8dvh;
    right: 24px;
    bottom: 8dvh;
    width: calc(100% - 48px);
    border-radius: 22px;
  }

  .thinking-process-header {
    padding-right: 18px;
    padding-left: 20px;
  }

  .thinking-process-list {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message.learny .thought-time.tool-assisted .thought-glow-character {
    animation: none;
    color: #d8d8dd;
    text-shadow: none;
  }

  .thinking-process-panel,
  .thinking-process-row {
    transition: none;
    animation: none !important;
  }

  .thinking-process-shell.is-open .thinking-process-row {
    opacity: 1;
    transform: none;
  }
}

@keyframes starDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(var(--travel-x), var(--travel-y), 0);
  }
}

@media (min-width: 861px) {
  .app-shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: 0;
    min-width: 0;
    max-width: 0;
    padding: 0;
    border-right: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    pointer-events: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .app-shell.sidebar-collapsed .sidebar::before {
    display: none;
  }

  .app-shell.sidebar-collapsed .brand-lockup,
  .app-shell.sidebar-collapsed .account-button,
  .app-shell.sidebar-collapsed .admin-nav-button,
  .app-shell.sidebar-collapsed .chats-panel,
  .app-shell.sidebar-collapsed .rate-limit-panel,
  .app-shell.sidebar-collapsed .sidebar-footer {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar-header {
    display: block;
    width: 0;
    height: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    animation: none;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle {
    position: fixed;
    top: 4px;
    left: 12px;
    z-index: 8;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: auto;
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.1),
      0 12px 28px rgba(0, 0, 0, 0.3);
    transform: none;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.06);
  }

  .app-shell.sidebar-collapsed .top-bar {
    padding-left: 60px;
  }

  .app-shell.sidebar-collapsed .chat-log {
    width: min(820px, calc(100vw - 76px));
  }

  .app-shell.sidebar-collapsed .composer-zone {
    width: min(760px, calc(100vw - 76px));
  }

  .app-shell.sidebar-collapsed .admin-portal-scroll {
    width: min(1080px, calc(100vw - 76px));
  }
}

@media (max-width: 860px) {
  html,
  body:not(.contact-page) {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body:not(.contact-page) {
    position: fixed;
    inset: 0;
  }

  .app-shell {
    position: fixed;
    inset: 0;
    grid-template-columns: 1fr;
    height: var(--app-viewport-height, 100dvh);
    max-height: none;
  }

  .app-shell.mobile-composer-focused {
    transform: translate3d(0, var(--mobile-viewport-offset, 0px), 0);
  }

  .app-shell.mobile-composer-focused .composer-zone {
    position: relative;
    z-index: 4;
    pointer-events: auto;
    transform: translate3d(0, calc(-1 * var(--mobile-keyboard-inset, 0px)), 0);
    will-change: transform;
  }

  .app-shell.mobile-composer-focused .attach-button,
  .app-shell.mobile-composer-focused .send-button,
  .app-shell.mobile-composer-focused .attachment-remove {
    pointer-events: auto;
    touch-action: manipulation;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 6;
    display: grid;
    width: min(336px, 90vw);
    background: #01040f;
    transform: translateX(calc(-100% - 18px));
    visibility: hidden;
    transition:
      transform 300ms cubic-bezier(0.2, 0.9, 0.2, 1),
      visibility 0s linear 300ms;
    box-shadow:
      24px 0 70px rgba(0, 0, 0, 0.52),
      inset -1px 0 rgba(255, 255, 255, 0.1),
      inset 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .sidebar::before {
    display: none;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    transition:
      transform 300ms cubic-bezier(0.2, 0.9, 0.2, 1),
      visibility 0s linear 0s;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: block;
    background: rgba(0, 0, 0, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms ease;
  }

  .app-shell.sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-sidebar-button {
    display: inline-grid;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.08),
      0 10px 24px rgba(0, 0, 0, 0.24);
    transition:
      background 160ms ease,
      transform 160ms ease,
      box-shadow 160ms ease;
  }

  .mobile-sidebar-button:hover,
  .mobile-sidebar-button:focus-visible {
    background: rgba(255, 255, 255, 0.13);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.1),
      0 12px 28px rgba(0, 0, 0, 0.3);
    transform: scale(1.04);
  }

  .mobile-sidebar-icon {
    width: 18px;
    height: 18px;
  }

  .chat-log,
  .composer-zone {
    width: min(
      760px,
      calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right))
    );
    min-width: 0;
    max-width: 100%;
  }

  .rename-chat-button,
  .delete-chat-button,
  .rename-chat-cancel-button,
  .rename-chat-save-button {
    opacity: 1;
    transform: translateX(0);
  }

  .top-bar {
    align-items: center;
    gap: 10px;
    padding: 0 14px;
  }

  .message-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 44px;
  }

}

@media (max-width: 560px) {
  .main-area {
    grid-template-rows: 52px minmax(0, 1fr);
  }

  .empty-state {
    top: 36%;
  }

  .empty-state h1 {
    max-width: calc(100vw - 36px);
    font-size: clamp(2.04rem, 10vw, 3.05rem);
  }

  .composer-zone {
    margin-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .composer {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    min-height: 58px;
    align-items: start;
  }

  .attach-button,
  .send-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    margin-top: 4px;
  }

  .bubble {
    width: fit-content;
    min-width: 0;
    max-width: 92%;
  }

  .message-edit-form {
    min-width: min(330px, 78vw);
  }

  .message-text-action {
    width: 34px;
    height: 34px;
  }

  .message-copy-button {
    width: 34px;
    height: 34px;
  }

  .top-bar {
    align-items: center;
    gap: 8px;
    padding: 0 10px;
  }

  .message-search input {
    height: 40px;
  }

  .sidebar {
    width: min(330px, 92vw);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sidebar-toggle {
    width: 44px;
    height: 44px;
  }

  .add-chat-button {
    width: 42px;
    height: 42px;
  }

  .chat-search {
    min-height: 44px;
  }

  .chat-search input {
    height: 38px;
  }

  .account-interface-scroll {
    padding: 76px 10px 22px;
  }

  .account-modal-panel {
    max-height: calc(100dvh - 104px);
    padding: 16px;
    border-radius: 22px;
  }

  .account-back-button {
    left: max(10px, env(safe-area-inset-left));
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.78rem;
  }

  .account-modal-header {
    gap: 10px;
  }

  .account-profile-summary {
    grid-template-columns: 1fr;
  }

  .account-stat-grid {
    grid-template-columns: 1fr;
  }

  .message-search {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 7px;
    min-height: 44px;
    padding: 0 9px;
  }

  .message-search-count {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
.site-update-banner {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  z-index: 12000;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(520px, calc(100vw - 32px));
  padding: 13px 14px 13px 17px;
  color: #f5f7ff;
  background: #15171c;
  border: 1px solid #363b46;
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.46);
  opacity: 0;
  transform: translate(-50%, -14px);
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-update-banner[hidden] {
  display: none;
}

.site-update-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.site-update-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.site-update-copy strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.site-update-copy span {
  color: #aeb3bf;
  font-size: 0.79rem;
  line-height: 1.35;
}

.site-update-banner button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 15px;
  color: #0b0c0f;
  background: #f2f4f8;
  border: 0;
  border-radius: 11px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.site-update-banner button:hover,
.site-update-banner button:focus-visible {
  background: #ffffff;
  transform: translateY(-1px);
}

.site-update-banner button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

@media (max-width: 560px) {
  .site-update-banner {
    align-items: stretch;
    gap: 11px;
    padding: 14px;
  }

  .site-update-banner button {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-update-banner {
    transition: none;
  }
}

/* Desktop settings */
body.settings-open {
  overflow: hidden;
}

.app-shell {
  transition: filter 560ms ease;
}

body.settings-open .app-shell {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

/* Keep every fixed popup inside the actually visible viewport. On mobile this
   excludes the on-screen keyboard instead of centering against the hidden
   layout viewport behind it. */
.rate-limit-modal,
.guest-access-modal,
.attachment-limit-modal,
.attachment-auth-modal,
.admin-reply-modal,
.unsafe-user-modal,
.unsafe-warning-modal,
.contact-reply-modal {
  top: var(--overlay-viewport-top, 0px);
  right: auto;
  bottom: auto;
  left: var(--overlay-viewport-left, 0px);
  width: var(--overlay-viewport-width, 100%);
  height: var(--overlay-viewport-height, 100dvh);
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.settings-modal {
  position: fixed;
  top: var(--overlay-viewport-top, 0px);
  right: auto;
  bottom: auto;
  left: var(--overlay-viewport-left, 0px);
  z-index: 70;
  display: grid;
  place-items: center;
  width: var(--overlay-viewport-width, 100%);
  height: var(--overlay-viewport-height, 100dvh);
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 20px;
}

.settings-modal[hidden],
.settings-panel[hidden],
.settings-select-menu[hidden] {
  display: none;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 600ms ease;
}

.settings-dialog {
  position: relative;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  width: min(760px, calc(100vw - 40px));
  height: min(600px, calc(100dvh - 40px));
  min-height: 460px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  color: #f5f5f5;
  background: #2d2d2d;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 34px 110px rgba(0, 0, 0, 0.62);
  opacity: 0;
  filter: blur(24px);
  transition:
    opacity 650ms ease,
    filter 700ms ease;
}

.settings-modal.is-open .settings-backdrop {
  opacity: 1;
}

.settings-modal.is-open .settings-dialog {
  opacity: 1;
  filter: blur(0);
}

.settings-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  transition: background 150ms ease, transform 150ms ease;
}

.settings-close:hover,
.settings-close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.04);
}

.settings-close::before,
.settings-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 1.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.settings-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.settings-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.settings-mobile-nav-toggle,
.settings-mobile-nav-scrim {
  display: none;
}

.settings-sidebar {
  min-width: 0;
  padding: 16px 8px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.17);
  background: #303030;
}

.settings-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  margin: 0 2px 12px;
  color: rgba(255, 255, 255, 0.94);
  font-family: "Google Sans", Arial, sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.settings-brand img {
  display: block;
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.settings-nav {
  display: grid;
  gap: 4px;
}

.settings-nav-button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: left;
  transition: color 130ms ease, background 130ms ease;
}

.settings-nav-button:hover,
.settings-nav-button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.settings-nav-button.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.settings-nav-icon,
.settings-nav-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.settings-nav-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-tool-glyph {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  color: #fff;
  transform: rotate(-45deg);
}

.settings-tool-glyph::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 4px;
  height: 13px;
  border-radius: 999px;
  background: currentColor;
}

.settings-tool-glyph::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 8px;
  height: 7px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  box-sizing: border-box;
}

.settings-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 24px;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
  scrollbar-width: thin;
}

.settings-panel {
  opacity: 0;
  filter: blur(12px);
  transition:
    opacity 216ms ease,
    filter 252ms ease;
}

.settings-panel.is-active {
  opacity: 1;
  filter: blur(0);
}

.settings-panel-header {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 0 52px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.settings-panel-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.04rem;
  font-weight: 650;
  line-height: 1.2;
}

.settings-control-list {
  display: grid;
}

.settings-control-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 90px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.settings-control-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.settings-control-copy strong {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.82rem;
  font-weight: 650;
}

.settings-control-copy span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  line-height: 1.4;
}

.settings-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.settings-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.settings-switch > span {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #696969;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: background 150ms ease, box-shadow 150ms ease;
}

.settings-switch > span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.36);
  transition: transform 170ms cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-switch input:checked + span {
  background: #4d8dff;
}

.settings-switch input:checked + span::after {
  transform: translateX(14px);
}

.settings-switch input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(91, 148, 255, 0.28);
}

.settings-switch input:disabled + span {
  cursor: wait;
  opacity: 0.62;
}

.settings-tool-row.is-required .settings-switch {
  cursor: default;
}

.settings-tool-row.is-required .settings-switch input:checked + span {
  background: #5b5d64;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.13),
    0 1px 5px rgba(0, 0, 0, 0.16);
}

.settings-tool-row.is-required .settings-switch input:disabled + span {
  cursor: default;
  opacity: 0.72;
}

.settings-tool-row.is-required .settings-switch > span::after {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.settings-select {
  position: relative;
  justify-self: end;
  min-width: 0;
}

.settings-select.is-open {
  z-index: 10;
}

.settings-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  width: auto;
  min-height: 32px;
  padding: 0 5px 0 9px;
  border: 0;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.92);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 610;
  transition: background 140ms ease;
}

.settings-select-trigger:hover,
.settings-select-trigger:focus-visible,
.settings-select.is-open .settings-select-trigger {
  background: rgba(255, 255, 255, 0.08);
}

.settings-select-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 150ms ease;
}

.settings-select.is-open .settings-select-trigger svg {
  transform: rotate(180deg);
}

.settings-select-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 12;
  display: grid;
  width: 220px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: #383838;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  animation: settingsMenuIn 150ms ease both;
}

.settings-select-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  font-size: 0.8rem;
  text-align: left;
}

.settings-select-menu button:hover,
.settings-select-menu button:focus-visible,
.settings-select-menu button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.12);
}

.settings-option-check {
  opacity: 0;
}

.settings-select-menu button[aria-selected="true"] .settings-option-check {
  opacity: 1;
}

.settings-action-button {
  min-width: 0;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 650;
  transition: background 140ms ease, border-color 140ms ease;
}

.settings-action-button:hover,
.settings-action-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.settings-current-value {
  display: block;
  margin-top: 1px;
  color: rgba(132, 176, 255, 0.92) !important;
  font-size: 0.72rem !important;
  font-weight: 600;
}

.settings-control-row.is-danger .settings-control-copy strong {
  color: #ff8d8d;
}

.settings-action-button.is-danger {
  border-color: rgba(255, 107, 107, 0.36);
  color: #ff9b9b;
}

.settings-action-button.is-danger:hover,
.settings-action-button.is-danger:focus-visible {
  border-color: rgba(255, 107, 107, 0.58);
  background: rgba(255, 82, 82, 0.1);
}

body.settings-submodal-open .settings-dialog {
  filter: blur(14px) saturate(0.75);
  opacity: 0.58;
}

.settings-layer-modal {
  position: fixed;
  top: var(--overlay-viewport-top, 0px);
  right: auto;
  bottom: auto;
  left: var(--overlay-viewport-left, 0px);
  z-index: 90;
  display: grid;
  place-items: center;
  width: var(--overlay-viewport-width, 100%);
  height: var(--overlay-viewport-height, 100dvh);
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 20px;
}

.settings-layer-modal[hidden],
.settings-action-section[hidden] {
  display: none;
}

.settings-layer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  backdrop-filter: blur(0);
  transition: opacity 280ms ease, backdrop-filter 320ms ease;
}

.settings-layer-card {
  position: relative;
  width: min(500px, calc(100vw - 40px));
  max-height: min(720px, calc(var(--overlay-viewport-height, 100dvh) - 40px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: #f5f5f5;
  background: linear-gradient(155deg, #242529 0%, #18191d 100%);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.68), inset 0 1px rgba(255, 255, 255, 0.06);
  opacity: 0;
  filter: blur(18px);
  transform: scale(0.975);
  transition: opacity 300ms ease, filter 340ms ease, transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: thin;
}

.settings-layer-modal.is-open .settings-layer-backdrop {
  opacity: 1;
  backdrop-filter: blur(16px);
}

.settings-layer-modal.is-open .settings-layer-card {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.settings-layer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 150ms ease;
}

.settings-layer-close:hover,
.settings-layer-close:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

.settings-layer-close::before,
.settings-layer-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.settings-layer-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.settings-layer-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.settings-layer-header {
  padding: 25px 58px 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-layer-header > span {
  display: block;
  margin-bottom: 7px;
  color: #87a9ff;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.settings-layer-header h2 {
  margin: 0;
  color: #fff;
  font-family: "Google Sans", Arial, sans-serif;
  font-size: 1.38rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.settings-layer-header p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.82rem;
  line-height: 1.5;
}

.settings-layer-form {
  display: grid;
  gap: 18px;
  padding: 22px 24px 24px;
}

.settings-action-section {
  display: grid;
  gap: 10px;
}

.settings-field-label,
.settings-layer-form .password-label > span {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 650;
}

.settings-text-input,
.settings-layer-form .password-input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  outline: none;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.settings-text-input:focus,
.settings-layer-form .password-input:focus {
  border-color: rgba(112, 154, 255, 0.8);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 3px rgba(82, 126, 255, 0.15);
}

.settings-layer-form .password-label {
  position: relative;
  display: grid;
  gap: 8px;
}

.settings-layer-form .password-input {
  padding-right: 52px;
}

.settings-layer-form .password-toggle-button {
  top: 28px;
  right: 5px;
}

#settingsSecurityCaptcha {
  justify-self: center;
}

.settings-password-fields {
  gap: 14px;
}

.settings-field-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  line-height: 1.45;
}

.settings-confirm-copy {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.settings-confirm-copy strong,
.settings-confirm-copy p {
  margin: 0;
}

.settings-confirm-copy strong {
  color: #fff;
  font-size: 0.9rem;
}

.settings-confirm-copy p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  line-height: 1.5;
}

.settings-confirm-copy.is-danger {
  border-color: rgba(255, 94, 94, 0.2);
  background: rgba(255, 70, 70, 0.055);
}

.settings-confirm-copy.is-danger strong {
  color: #ff9a9a;
}

.settings-layer-message {
  min-height: 18px;
  margin: 0;
  color: #a7c1ff;
  font-size: 0.75rem;
  line-height: 1.4;
}

.settings-layer-message.error {
  color: #ff9494;
}

.settings-layer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.settings-layer-actions.is-single {
  justify-content: stretch;
}

.settings-layer-actions button {
  min-height: 38px;
  padding: 0 17px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-layer-actions.is-single button {
  width: 100%;
}

.settings-layer-secondary {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
}

.settings-layer-secondary:hover,
.settings-layer-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.07);
}

.settings-layer-primary {
  border: 1px solid rgba(130, 161, 255, 0.55);
  color: #fff;
  background: linear-gradient(135deg, #526ff4, #6e5cf0);
  box-shadow: 0 8px 24px rgba(73, 86, 224, 0.24);
}

.settings-layer-primary:hover,
.settings-layer-primary:focus-visible {
  filter: brightness(1.08);
}

.settings-layer-primary.is-danger {
  border-color: rgba(255, 112, 112, 0.55);
  background: linear-gradient(135deg, #c23f4a, #9f2e3c);
  box-shadow: 0 8px 24px rgba(180, 45, 58, 0.25);
}

.settings-layer-form :disabled {
  cursor: default;
  opacity: 0.58;
}

.settings-profile-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-profile-comparison figure {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
}

.settings-profile-comparison figure > span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-profile-comparison img {
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  object-fit: cover;
  background: #111319;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

.settings-upload-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  border: 1px dashed rgba(145, 170, 255, 0.45);
  border-radius: 12px;
  color: #dce5ff;
  background: rgba(91, 119, 235, 0.08);
}

.settings-upload-button:hover,
.settings-upload-button:focus-visible {
  border-color: rgba(145, 170, 255, 0.75);
  background: rgba(91, 119, 235, 0.14);
}

.settings-upload-button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.settings-security-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.settings-security-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.032);
}

.settings-security-device-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #7a7f8d;
  box-shadow: 0 0 0 3px rgba(122, 127, 141, 0.12);
}

.settings-security-device-dot.is-current {
  background: #63d7a0;
  box-shadow: 0 0 0 3px rgba(99, 215, 160, 0.13);
}

.settings-security-item > div {
  display: grid;
  gap: 3px;
}

.settings-security-item strong {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.79rem;
}

.settings-security-item span,
.settings-security-item small,
.settings-security-empty {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.71rem;
}

.settings-security-empty {
  padding: 28px 12px;
  text-align: center;
}

.settings-security-empty.is-error {
  color: #ff9898;
}

.settings-layer-modal.is-deleted-chats .settings-layer-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, calc(100vw - 40px));
  height: min(720px, calc(var(--overlay-viewport-height, 100dvh) - 40px));
  overflow: hidden;
}

.settings-layer-modal.is-deleted-chats .settings-layer-form {
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
  min-height: 0;
}

.settings-deleted-messages-modal {
  z-index: 100;
}

.settings-deleted-messages-card {
  width: min(680px, calc(100vw - 40px));
  overflow: hidden;
}

.settings-deleted-messages-card .settings-layer-header {
  padding-right: 64px;
}

.settings-deleted-messages-card .settings-layer-header h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-deleted-messages-content {
  max-height: min(600px, calc(var(--overlay-viewport-height, 100dvh) - 180px));
  overflow: auto;
  padding: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.settings-deleted-messages-content .settings-deleted-chat-messages {
  max-height: none;
  padding: 0;
  border-top: 0;
  background: transparent;
}

.settings-deleted-chats-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 10px;
  max-height: min(470px, calc(var(--overlay-viewport-height, 100dvh) - 270px));
  min-height: 190px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1px 4px 1px 1px;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.settings-deleted-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 3px 4px 3px 10px;
}

.settings-deleted-toolbar > span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.7rem;
  font-weight: 650;
}

.settings-deleted-chat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 134, 255, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.032);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.settings-deleted-chat-card:hover,
.settings-deleted-chat-card.is-expanded {
  border-color: rgba(142, 163, 255, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 134, 255, 0.12), transparent 46%),
    rgba(255, 255, 255, 0.044);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 12px 30px rgba(0, 0, 0, 0.16);
}

.settings-deleted-chat-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
}

.settings-deleted-chat-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-deleted-chat-copy strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-deleted-chat-copy > span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.7rem;
}

.settings-deleted-chat-copy small {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9cb5ff;
  font-size: 0.69rem;
  font-weight: 650;
}

.settings-deleted-chat-copy small i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.settings-deleted-chat-actions,
.settings-deleted-delete-confirm > div:last-child,
.settings-deleted-delete-all-confirm > div:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.settings-deleted-chat-actions button,
.settings-deleted-delete-confirm button,
.settings-deleted-toolbar button,
.settings-deleted-delete-all-confirm button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.7rem;
  font-weight: 690;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease, transform 150ms ease;
}

.settings-deleted-chat-actions button:hover,
.settings-deleted-chat-actions button:focus-visible,
.settings-deleted-delete-confirm button:hover,
.settings-deleted-delete-confirm button:focus-visible,
.settings-deleted-toolbar button:hover,
.settings-deleted-toolbar button:focus-visible,
.settings-deleted-delete-all-confirm button:hover,
.settings-deleted-delete-all-confirm button:focus-visible {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.settings-deleted-chat-actions .is-restore {
  border-color: rgba(111, 143, 255, 0.48);
  color: #dce5ff;
  background: rgba(85, 111, 235, 0.13);
}

.settings-deleted-chat-actions .is-restore:hover,
.settings-deleted-chat-actions .is-restore:focus-visible {
  border-color: rgba(129, 158, 255, 0.72);
  background: rgba(85, 111, 235, 0.22);
}

.settings-deleted-chat-actions .is-danger,
.settings-deleted-delete-confirm .is-danger,
.settings-deleted-toolbar .is-danger,
.settings-deleted-delete-all-confirm .is-danger {
  color: #ffa1a1;
}

.settings-deleted-chat-actions .is-danger:hover,
.settings-deleted-chat-actions .is-danger:focus-visible,
.settings-deleted-delete-confirm .is-danger:hover,
.settings-deleted-delete-confirm .is-danger:focus-visible,
.settings-deleted-toolbar .is-danger:hover,
.settings-deleted-toolbar .is-danger:focus-visible,
.settings-deleted-delete-all-confirm .is-danger:hover,
.settings-deleted-delete-all-confirm .is-danger:focus-visible {
  border-color: rgba(255, 112, 112, 0.45);
  background: rgba(255, 82, 82, 0.1);
}

.settings-deleted-chat-messages {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.085);
  background: rgba(5, 6, 9, 0.28);
  scrollbar-width: thin;
}

.settings-deleted-chat-messages.is-loading {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 62px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.73rem;
}

.settings-deleted-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #829fff;
  box-shadow: 0 0 0 5px rgba(105, 135, 255, 0.11);
  animation: settingsDeletedPulse 1.25s ease-in-out infinite;
}

.settings-deleted-message {
  display: grid;
  gap: 6px;
  max-width: 88%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.038);
}

.settings-deleted-message.is-user {
  justify-self: end;
  background: rgba(108, 129, 221, 0.13);
}

.settings-deleted-message header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-deleted-message header strong {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.68rem;
}

.settings-deleted-message header span,
.settings-deleted-message small {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.61rem;
}

.settings-deleted-message p,
.settings-deleted-chat-empty-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.settings-deleted-chat-empty-copy {
  padding: 12px;
  text-align: center;
}

.settings-deleted-delete-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border-top: 1px solid rgba(255, 105, 105, 0.14);
  background: rgba(255, 66, 66, 0.055);
}

.settings-deleted-delete-all-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 105, 105, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 66, 66, 0.09), rgba(255, 66, 66, 0.035));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.settings-deleted-delete-all-confirm > div:first-child {
  display: grid;
  gap: 4px;
}

.settings-deleted-delete-all-confirm strong {
  color: #fff0f0;
  font-size: 0.78rem;
}

.settings-deleted-delete-all-confirm span {
  color: rgba(255, 218, 218, 0.62);
  font-size: 0.67rem;
  line-height: 1.4;
}

.settings-deleted-delete-confirm > div:first-child {
  display: grid;
  gap: 3px;
}

.settings-deleted-delete-confirm strong {
  color: #ffaaaa;
  font-size: 0.76rem;
}

.settings-deleted-delete-confirm span {
  color: rgba(255, 255, 255, 0.53);
  font-size: 0.68rem;
}

.settings-deleted-chat-card.is-busy {
  pointer-events: none;
}

.settings-deleted-card-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(126, 151, 255, 0.12);
}

.settings-deleted-card-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, #89a4ff, transparent);
  animation: settingsDeletedProgress 1.1s ease-in-out infinite;
}

.settings-deleted-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 230px;
  padding: 28px;
  text-align: center;
}

.settings-deleted-empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
  border: 1px solid rgba(139, 163, 255, 0.24);
  border-radius: 15px;
  place-items: center;
  color: #a9bbff;
  background: rgba(104, 128, 231, 0.09);
}

.settings-deleted-empty-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-deleted-empty strong {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
}

.settings-deleted-empty p {
  max-width: 340px;
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  line-height: 1.5;
}

.settings-deleted-load-warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 185, 100, 0.18);
  border-radius: 11px;
  color: #eec38f;
  background: rgba(255, 164, 61, 0.055);
  font-size: 0.69rem;
  line-height: 1.4;
}

.settings-deleted-skeleton {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 7px 12px;
  min-height: 82px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.settings-deleted-skeleton i,
.settings-deleted-skeleton span {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
}

.settings-deleted-skeleton i {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
}

.settings-deleted-skeleton span {
  position: relative;
  width: 56%;
  height: 9px;
}

.settings-deleted-skeleton span:last-child {
  width: 36%;
}

.settings-deleted-skeleton span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  animation: settingsDeletedShimmer 1.5s ease-in-out infinite;
}

@keyframes settingsDeletedPulse {
  50% { opacity: 0.4; transform: scale(0.75); }
}

@keyframes settingsDeletedProgress {
  from { transform: translateX(-110%); }
  to { transform: translateX(340%); }
}

@keyframes settingsDeletedShimmer {
  from { transform: translateX(-110%); }
  to { transform: translateX(170%); }
}

@keyframes settingsMenuIn {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 860px) {
  .settings-modal {
    display: grid;
    place-items: stretch;
    padding: 0;
  }

  .settings-backdrop {
    background: #111216;
  }

  .settings-dialog {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(circle at 12% -8%, rgba(89, 112, 255, 0.11), transparent 32%),
      #28292d;
  }

  .settings-mobile-nav-toggle {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    z-index: 12;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.08),
      0 12px 30px rgba(0, 0, 0, 0.2);
    transition: background 170ms ease, border-color 170ms ease, transform 170ms ease;
  }

  .settings-mobile-nav-toggle:hover,
  .settings-mobile-nav-toggle:focus-visible {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.14);
  }

  .settings-mobile-nav-toggle:active {
    transform: scale(0.96);
  }

  .settings-mobile-nav-toggle img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: transform 240ms ease;
  }

  .settings-dialog.mobile-nav-open .settings-mobile-nav-toggle img {
    transform: rotate(180deg);
  }

  .settings-close {
    top: max(15px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 12;
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .settings-mobile-nav-scrim {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.56);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 240ms ease, visibility 0s linear 240ms;
  }

  .settings-dialog.mobile-nav-open .settings-mobile-nav-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 240ms ease, visibility 0s linear 0s;
  }

  .settings-sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 10;
    width: min(300px, 84vw);
    min-height: 0;
    padding:
      calc(max(12px, env(safe-area-inset-top)) + 52px)
      10px
      max(14px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right-color: rgba(255, 255, 255, 0.14);
    background:
      radial-gradient(circle at 15% 0, rgba(81, 110, 255, 0.12), transparent 30%),
      #2c2d31;
    box-shadow: 24px 0 64px rgba(0, 0, 0, 0.42);
    transform: translateX(calc(-100% - 20px));
    visibility: hidden;
    transition:
      transform 280ms cubic-bezier(0.2, 0.9, 0.2, 1),
      visibility 0s linear 280ms;
    -webkit-overflow-scrolling: touch;
  }

  .settings-dialog.mobile-nav-open .settings-sidebar {
    transform: translateX(0);
    visibility: visible;
    transition:
      transform 280ms cubic-bezier(0.2, 0.9, 0.2, 1),
      visibility 0s linear 0s;
  }

  .settings-brand {
    min-height: 70px;
    margin-bottom: 16px;
  }

  .settings-nav {
    gap: 6px;
  }

  .settings-nav-button {
    min-height: 46px;
    padding: 0 12px;
    border-radius: 13px;
    font-size: 0.88rem;
  }

  .settings-content {
    width: 100%;
    height: 100%;
    padding: 0 max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .settings-panel-header {
    position: sticky;
    top: 0;
    z-index: 4;
    justify-content: center;
    min-height: calc(66px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 54px 0;
    background: linear-gradient(180deg, #292a2e 74%, rgba(41, 42, 46, 0.94));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .settings-panel-header h2 {
    overflow: hidden;
    font-size: 1.02rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .settings-control-row {
    min-height: 86px;
    gap: 16px;
  }

  .settings-layer-modal {
    align-items: center;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .settings-layer-modal.is-deleted-chats {
    align-items: end;
  }

  .settings-layer-card {
    width: 100%;
    max-height: min(760px, calc(var(--overlay-viewport-height, 100dvh) - 24px));
    border-radius: 24px;
    -webkit-overflow-scrolling: touch;
  }

  .settings-layer-header {
    padding: 24px 56px 18px 20px;
  }

  .settings-layer-form {
    padding: 20px;
  }

  /* Keep the primary mobile sidebar useful even on short phones. */
  .sidebar {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
    gap: 8px;
    width: min(320px, 88vw);
    height: var(--app-viewport-height, 100dvh);
    max-height: var(--app-viewport-height, 100dvh);
    padding:
      max(8px, env(safe-area-inset-top))
      10px
      max(8px, env(safe-area-inset-bottom));
  }

  .sidebar-header {
    min-height: 46px;
    padding-bottom: 0;
  }

  .brand-lockup {
    gap: 7px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .brand-name {
    font-size: 1.08rem;
  }

  .sidebar-toggle {
    width: 38px;
    height: 38px;
  }

  .account-button {
    min-height: 44px;
    padding: 6px 9px;
    border-radius: 14px;
  }

  .chats-panel {
    gap: 6px;
    min-height: 0;
    margin-top: 0;
    overflow: hidden;
  }

  .panel-heading {
    min-height: 34px;
    padding: 0 2px;
  }

  .add-chat-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  .chat-search {
    min-height: 38px;
  }

  .chat-search input {
    height: 36px;
  }

  .chat-list {
    min-height: 0;
    max-height: 100%;
    padding-right: 2px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    -webkit-overflow-scrolling: touch;
  }

  .chat-list::-webkit-scrollbar {
    display: block;
    width: 3px;
  }

  .chat-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
  }

  .chat-item {
    min-height: 40px;
  }

  .rate-limit-panel {
    gap: 6px;
    padding: 10px 12px;
    border-width: 1.5px;
    border-radius: 14px;
  }

  .rate-limit-copy {
    gap: 2px;
  }

  .rate-limit-copy span,
  .rate-limit-panel p {
    font-size: 0.72rem;
  }

  .rate-limit-copy strong {
    font-size: 1.35rem;
  }

  .rate-limit-track {
    height: 7px;
  }

  .rate-limit-refresh {
    top: 7px;
    right: 7px;
    width: 28px;
    height: 28px;
  }

  .sidebar-footer {
    gap: 5px;
  }

  .contact-us-button {
    min-height: 36px;
    border-radius: 12px;
    font-size: 0.78rem;
  }

  .sidebar-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px 8px;
    font-size: 0.68rem;
  }
}

@media (max-width: 540px) {
  .settings-deleted-messages-modal {
    padding-inline: 8px;
  }

  .settings-deleted-messages-card {
    width: 100%;
    max-height: calc(var(--overlay-viewport-height, 100dvh) - 16px);
    border-radius: 22px;
  }

  .settings-deleted-messages-card .settings-layer-header {
    padding: 22px 54px 18px 20px;
  }

  .settings-deleted-messages-content {
    max-height: calc(var(--overlay-viewport-height, 100dvh) - 112px);
    padding: 14px;
  }

  .settings-layer-modal.is-deleted-chats {
    padding-inline: 8px;
  }

  .settings-layer-modal.is-deleted-chats .settings-layer-card {
    width: 100%;
    height: min(720px, calc(var(--overlay-viewport-height, 100dvh) - 24px));
    border-radius: 22px;
  }

  .settings-layer-modal.is-deleted-chats .settings-layer-header {
    padding: 22px 54px 18px 20px;
  }

  .settings-layer-modal.is-deleted-chats .settings-layer-form {
    gap: 16px;
    padding: 16px 14px 18px;
  }

  .settings-deleted-chats-list {
    gap: 12px;
    max-height: calc(var(--overlay-viewport-height, 100dvh) - 260px);
    padding-right: 2px;
  }

  .settings-deleted-chat-summary {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }

  .settings-deleted-chat-copy {
    gap: 5px;
  }

  .settings-deleted-chat-copy strong {
    font-size: 0.94rem;
  }

  .settings-deleted-chat-copy > span {
    line-height: 1.35;
  }

  .settings-deleted-chat-copy small {
    flex-wrap: wrap;
    gap: 6px;
  }

  .settings-deleted-chat-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .settings-deleted-chat-actions button {
    width: 100%;
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.69rem;
  }

  .settings-deleted-chat-actions button:first-child {
    grid-column: 1 / -1;
  }

  .settings-deleted-toolbar {
    padding-inline: 4px;
  }

  .settings-deleted-toolbar button {
    min-height: 38px;
    padding-inline: 14px;
  }

  .settings-deleted-delete-all-confirm {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .settings-deleted-delete-all-confirm > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-deleted-delete-all-confirm button {
    width: 100%;
    min-height: 40px;
    padding-inline: 9px;
  }

  .settings-deleted-delete-confirm {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .settings-deleted-delete-confirm > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-deleted-delete-confirm button {
    width: 100%;
  }

  .settings-control-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    min-height: 0;
    padding: 18px 0;
  }

  .settings-action-button,
  .settings-select {
    justify-self: start;
  }

  .settings-select-trigger {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
  }

  .settings-select-menu {
    right: auto;
    left: 0;
    width: min(220px, calc(100vw - 40px));
  }

  .settings-layer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-layer-actions button {
    width: 100%;
    padding-inline: 12px;
  }

  .settings-layer-actions.is-single {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 680px) and (max-width: 860px) {
  .sidebar {
    gap: 5px;
  }

  .sidebar-header {
    min-height: 38px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand-name {
    font-size: 0.98rem;
  }

  .account-button {
    min-height: 40px;
    padding-block: 4px;
  }

  .panel-heading {
    min-height: 30px;
  }

  .chat-search {
    min-height: 34px;
  }

  .chat-search input {
    height: 32px;
  }

  .rate-limit-panel {
    gap: 4px;
    padding: 8px 10px;
  }

  .rate-limit-copy strong {
    font-size: 1.18rem;
  }

  .contact-us-button {
    min-height: 32px;
  }

  .sidebar-legal-links {
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-backdrop,
  .settings-dialog,
  .settings-panel,
  .settings-select-menu,
  .settings-layer-backdrop,
  .settings-layer-dialog,
  .app-shell {
    animation: none !important;
    transition: none !important;
  }
}
.stream-large-plain {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Recoverable conversation actions and live request detail. */
.conversation-notice-stack {
  position: fixed;
  z-index: 1400;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.conversation-notice {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px 48px 14px 17px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: #17181d;
  color: #f7f7fa;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.52);
  opacity: 0;
  filter: blur(8px);
  transform: translateY(8px);
  transition: opacity 280ms ease, filter 320ms ease, transform 320ms ease;
  pointer-events: auto;
}

.conversation-notice.is-visible { opacity: 1; filter: none; transform: none; }
.conversation-notice-copy { display: grid; gap: 3px; min-width: 0; }
.conversation-notice strong { font: 700 0.92rem/1.25 "Google Sans", sans-serif; }
.conversation-notice span { color: #aaaeb9; font-size: 0.78rem; line-height: 1.35; }
.conversation-notice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.conversation-notice button {
  flex: 0 1 auto;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.conversation-notice button:hover { border-color: rgba(255, 255, 255, 0.48); background: rgba(255, 255, 255, 0.06); }
.conversation-notice .conversation-notice-primary {
  border-color: rgba(138, 168, 255, 0.44);
  background: rgba(104, 128, 238, 0.14);
}
.conversation-notice .conversation-notice-dismiss {
  color: rgba(235, 236, 242, 0.72);
  font-size: 0.72rem;
}
.conversation-notice .conversation-notice-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  opacity: 0.7;
  transition: opacity 180ms ease, filter 180ms ease;
}
.conversation-notice .conversation-notice-close img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.conversation-notice .conversation-notice-close:hover {
  border: 0;
  background: transparent;
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.35));
}

.attachment-progress { position: relative; display: block; width: min(180px, 100%); height: 14px; margin-top: 4px; overflow: hidden; }
.attachment-progress::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.12); }
.attachment-progress i { position: absolute; left: 0; top: 6px; height: 2px; border-radius: 2px; background: #8aa8ff; transition: width 220ms ease; }
.attachment-progress em { position: absolute; right: 0; top: 0; padding-left: 7px; background: #17181d; color: #9da2ad; font-size: 0.64rem; font-style: normal; line-height: 14px; }

@media (max-width: 700px) {
  .conversation-notice-stack { right: 16px; bottom: 112px; }
  .conversation-notice-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .conversation-notice button { width: 100%; white-space: normal; }
  .conversation-notice .conversation-notice-close { width: 28px; }
  .message.typing.searching-web .bubble { max-width: 92%; }
}
