:root {
  --bg-start: #6a11cb;
  --bg-end: #2575fc;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --soft: rgba(255, 255, 255, 0.12);
  --card: rgba(255, 255, 255, 0.15);
  --card-strong: rgba(255, 255, 255, 0.24);
  --border: rgba(255, 255, 255, 0.25);
  --button: #ffffff;
  --button-text: #2d49c4;
  --accent: #9be7ff;
  --danger: #ff5c7a;
  --success: #20d6a5;
  --warning: #ffd166;
  --ink: #172033;
  --ink-muted: #667085;
  --surface: rgba(255, 255, 255, 0.96);
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.28);
  --radius: 8px;
  --font: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  background-attachment: fixed;
}

body.staff-mode {
  --bg-start: #ff8a00;
  --bg-end: #b54708;
  --muted: rgba(255, 255, 255, 0.88);
  --button-text: #7a3a00;
  --accent: #fff6b3;
  --card: rgba(255, 255, 255, 0.2);
  --card-strong: rgba(255, 255, 255, 0.3);
  --border: rgba(255, 255, 255, 0.38);
}

body.admin-mode {
  --bg-start: #2f3437;
  --bg-end: #59616a;
  --muted: rgba(255, 255, 255, 0.86);
  --button-text: #2f3437;
  --accent: #f2f4f7;
  --card: rgba(17, 24, 39, 0.28);
  --card-strong: rgba(17, 24, 39, 0.38);
  --border: rgba(255, 255, 255, 0.34);
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #ffffff;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #6a11cb, #2575fc);
  transition: opacity 260ms ease, visibility 260ms ease;
}

body.app-ready .app-loader {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.app-loader-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(320px, 100%);
  padding: 28px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 55px rgba(16, 24, 40, 0.3);
  backdrop-filter: blur(18px);
}

.app-loader-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: var(--button-text);
  font-size: 1.45rem;
  font-weight: 950;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 16px 35px rgba(16, 24, 40, 0.28);
  animation: loaderJump 780ms cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.app-loader-copy {
  display: grid;
  gap: 5px;
}

.app-loader-copy strong {
  font-size: 1.12rem;
  font-weight: 950;
}

.app-loader-copy span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}

.app-loader-dots {
  display: inline-flex;
  gap: 7px;
  align-items: end;
  height: 16px;
}

.app-loader-dots span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffffff;
  animation: loaderDotJump 780ms ease-in-out infinite;
}

.app-loader-dots span:nth-child(2) {
  animation-delay: 120ms;
}

.app-loader-dots span:nth-child(3) {
  animation-delay: 240ms;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(260px, 560px) auto;
  gap: 18px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  padding: 0;
  color: #ffffff;
  background: transparent;
  border: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--button-text);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1;
  white-space: nowrap;
}

.brand-roman {
  font-family: inherit;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.brand-script {
  font-family: inherit;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  padding: 3px 6px;
  color: var(--button-text);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.search {
  display: flex;
  gap: 8px;
  width: 100%;
}

.search input,
.field input,
.field textarea,
.field select,
.chat-compose textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: none;
  background: rgba(255, 255, 255, 0.94);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

.search input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.chat-compose textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(155, 231, 255, 0.24);
}

.button,
.search button,
.icon-button,
.account-button,
.avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 850;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button.is-interaction-loading,
.search button.is-interaction-loading,
.icon-button.is-interaction-loading,
.account-button.is-interaction-loading,
.avatar-button.is-interaction-loading,
[role="button"].is-interaction-loading {
  position: relative;
  cursor: progress;
}

.button.is-interaction-loading::after,
.search button.is-interaction-loading::after,
.icon-button.is-interaction-loading::after,
.account-button.is-interaction-loading::after,
.avatar-button.is-interaction-loading::after,
[role="button"].is-interaction-loading::after {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: interactionSpin 680ms linear infinite;
}

.icon-button.square.is-interaction-loading::after,
.account-button.is-interaction-loading::after,
.avatar-button.is-interaction-loading::after {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  color: var(--button-text);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
}

.button:hover,
.search button:hover,
.icon-button:hover,
.account-button:hover,
.avatar-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.button-primary,
.search button,
.account-button {
  color: var(--button-text);
  background: var(--button);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
}

.button-ghost,
.button-subtle,
.icon-button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid var(--border);
}

.button-danger {
  color: #ffffff;
  background: var(--danger);
  box-shadow: 0 10px 24px rgba(255, 92, 122, 0.34);
}

.button-success {
  color: #063f32;
  background: var(--success);
}

.button-disabled {
  color: #667085;
  background: #e4e7ec;
  border: 1px solid #d0d5dd;
  box-shadow: none;
}

.button-full {
  width: 100%;
}

.button-small {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.92rem;
}

.unread-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 950;
  border-radius: 999px;
  background: var(--danger);
}

.mail-button {
  position: relative;
  z-index: 3;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  pointer-events: auto;
}

.mail-button > * {
  pointer-events: none;
}

.mail-unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  border: 2px solid #ffffff;
}

.top-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 172px;
}

.account-button,
.avatar-button,
.icon-button.square {
  flex: 0 0 auto;
  width: 44px;
  padding: 0;
  border-radius: 50%;
}

.avatar-button {
  color: var(--button-text);
  font-weight: 900;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.avatar-button img,
.profile-avatar img,
.avatar-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #ffffff;
}

.user-name {
  max-width: 140px;
  overflow: hidden;
  color: #ffffff;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name-button {
  padding: 0;
  border: 0;
  background: transparent;
}

.user-name-button:hover {
  text-decoration: underline;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 42px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel.promo-slot {
  min-height: clamp(165px, 22.5vw, 270px);
  padding: 0;
  overflow: hidden;
}

.home-promo-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.hero-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 900;
}

.hero-panel h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
  min-width: 300px;
}

.stat {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
}

.stat strong {
  display: block;
  color: #ffffff;
  font-size: 1.28rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.84rem;
}

.home-catalog {
  display: grid;
  gap: 18px;
}

.home-stats {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  margin: 18px 2px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb button {
  padding: 0;
  color: #ffffff;
  background: transparent;
  border: 0;
  font-weight: 850;
}

.content-zone {
  min-height: 360px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* AI: admin edit controls need WCAG-ish contrast; previous white/soft-blue text was unreadable. */
.admin-edit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.18);
  animation: fadeSlide 260ms ease both;
}

.admin-edit-toolbar strong,
.admin-edit-toolbar span {
  display: block;
}

.admin-edit-toolbar strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.admin-edit-toolbar span {
  color: #667085;
  font-size: 0.9rem;
}

.admin-edit-toolbar .row-actions {
  justify-content: flex-end;
}

.admin-edit-toolbar .button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #3347c7, #185abc);
  border: 1px solid rgba(24, 90, 188, 0.34);
  box-shadow: 0 10px 22px rgba(24, 90, 188, 0.22);
}

.admin-edit-toolbar .button-ghost {
  color: #1d2939;
  background: #ffffff;
  border-color: #98a2b3;
  box-shadow: none;
}

.admin-edit-toolbar .button-ghost:hover {
  background: #eef4ff;
  border-color: #667085;
}

.admin-edit-toolbar .button-danger {
  color: #ffffff;
  border-color: rgba(192, 16, 72, 0.42);
  background: #c01048;
}

.batch-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: #344054;
  font-weight: 850;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.card,
.panel,
.product-row,
.order-row {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: fadeSlide 340ms ease both;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 238px;
  padding: 24px;
  text-align: left;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.card[role="button"] {
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  background: var(--card-strong);
}

.admin-selectable {
  cursor: pointer;
}

.admin-selectable.selected {
  border-color: #9be7ff;
  box-shadow: 0 0 0 4px rgba(155, 231, 255, 0.18), var(--shadow);
}

.batch-check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.admin-selectable.selected .batch-check {
  color: var(--button-text);
  background: #ffffff;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  color: var(--button-text);
  font-size: 1.55rem;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

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

.card h2,
.card h3,
.panel h2,
.panel h3 {
  margin: 0 0 10px;
  color: #ffffff;
  line-height: 1.24;
}

.card h2,
.panel h2 {
  font-size: 1.24rem;
}

.card h3,
.panel h3 {
  font-size: 1.05rem;
}

.card p,
.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
}

.game-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  min-height: 214px;
}

.game-card.admin-selectable {
  grid-template-columns: auto auto 1fr;
}

.game-card .card-icon {
  margin-bottom: 0;
}

.game-card .card-image {
  width: 124px;
  height: 88px;
  aspect-ratio: auto;
  margin-bottom: 0;
}

.game-card .card-footer {
  grid-column: 1 / -1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 850;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.status-pending {
  color: #5b3b00;
  background: #ffd166;
}

.status-processing {
  color: #063f32;
  background: #20d6a5;
}

.status-completed {
  color: #17324d;
  background: #b7e3ff;
}

.status-cancelled {
  color: #ffffff;
  background: #8b1e3f;
}

.product-list,
.order-list {
  display: grid;
  gap: 12px;
}

.product-row,
.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.18);
}

.product-row.admin-selectable {
  grid-template-columns: auto minmax(0, 1fr) minmax(110px, auto) auto;
}

.order-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.row-title {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 900;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.price {
  color: var(--accent);
  font-size: 1.07rem;
  font-weight: 950;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.panel {
  padding: 24px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.65fr);
  gap: 18px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
}

.metric strong {
  display: block;
  color: #ffffff;
  font-size: 1.45rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.88rem;
}

.ledger-strip .metric i {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  color: var(--button-text);
  border-radius: 50%;
  background: #ffffff;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.admin-stack {
  display: grid;
  gap: 16px;
}

.gate-panel {
  width: min(620px, 100%);
}

.admin-table {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.admin-table-head,
.admin-table-row {
  display: grid;
  gap: 12px;
  align-items: center;
  min-width: 760px;
}

.admin-table-head {
  padding: 0 14px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 900;
}

.admin-table-row {
  width: 100%;
  padding: 14px;
  color: #ffffff;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
}

button.admin-table-row {
  cursor: pointer;
}

button.admin-table-row:hover {
  background: rgba(255, 255, 255, 0.2);
}

.user-grid {
  grid-template-columns: minmax(220px, 1.5fr) minmax(140px, 1fr) minmax(110px, 0.7fr) minmax(150px, 1fr);
}

.simple-table .admin-table-head,
.simple-table .admin-table-row {
  width: max-content;
}

.admin-empty-row {
  min-width: 360px;
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 36px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.empty-state p {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.7;
}

.modal-root:empty {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 32, 0.6);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 28px;
  color: var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.modal-wide {
  width: min(720px, 100%);
}

.modal-card h2 {
  margin: 0 0 18px;
  color: var(--ink);
}

.modal-card p {
  color: #4b5565;
  line-height: 1.7;
}

.modal-card .button-ghost,
.modal-card .button-subtle {
  color: #344054;
  background: #eef2ff;
  border-color: #d0d5dd;
}

.modal-card .icon-button {
  color: var(--ink);
  background: rgba(17, 24, 39, 0.08);
  border: 0;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: var(--radius);
  background: #eef2ff;
}

.tab {
  min-height: 42px;
  color: #475467;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  font-weight: 850;
}

.tab.active {
  color: var(--button-text);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.1);
}

.form-stack {
  display: grid;
  gap: 14px;
}

.auth-card {
  width: min(560px, 100%);
}

.auth-subtitle {
  margin-top: -8px;
}

.auth-email-help {
  margin: -4px 0 2px;
  padding: 10px 12px;
  color: #344054;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.6;
}

.auth-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.auth-intro strong,
.auth-intro span {
  display: block;
}

.auth-intro span {
  margin-top: 3px;
  color: #667085;
  font-size: 0.9rem;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--button-text);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.12);
}

.auth-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  color: #475467;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
  font-weight: 850;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.auth-method:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.1);
}

.auth-method.active {
  color: var(--button-text);
  border-color: rgba(37, 117, 252, 0.42);
  background: var(--card-gradient);
  box-shadow: 0 14px 28px rgba(37, 117, 252, 0.16);
}

.verify-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.auth-code-hint {
  min-height: 22px;
  margin: 0;
  color: #475467;
  font-size: 0.9rem;
  line-height: 1.5;
}

.settings-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.settings-action {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 116px;
  padding: 18px;
  color: #344054;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
  font-weight: 900;
  text-align: center;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.settings-action i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--button-text);
  border-radius: 50%;
  background: #ffffff;
}

.settings-action:hover {
  transform: translateY(-2px);
  background: #eef2ff;
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.2);
}

.settings-action.destructive {
  color: #b42318;
  border-color: #fecdca;
  background: #fff1f3;
}

.profile-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  color: var(--button-text);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.22);
  font-size: 1.3rem;
  font-weight: 950;
  overflow: hidden;
}

.profile-avatar-small {
  width: 54px;
  height: 54px;
  margin-top: 6px;
  font-size: 1rem;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.16);
}

.avatar-upload-preview {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin: 4px auto 10px;
  color: var(--button-text);
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #eef2ff;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.18);
  overflow: hidden;
  font-size: 1.6rem;
  font-weight: 950;
}

.avatar-upload-preview-small {
  width: 96px;
  height: 96px;
  margin: 0 auto 8px;
  font-size: 1.15rem;
}

.image-upload-field {
  display: grid;
  gap: 10px;
}

.content-image-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 176px;
  overflow: hidden;
  color: var(--button-text);
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.1);
}

.content-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 176px;
  object-fit: cover;
}

.content-image-preview i {
  font-size: 2rem;
}

.content-image-preview span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  color: #ffffff;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.68);
  font-size: 0.78rem;
  font-weight: 900;
}

.image-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-upload-button {
  position: relative;
  overflow: hidden;
}

.image-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.image-upload-field small {
  color: #667085;
  font-weight: 750;
}

.settings-list,
.notice-list {
  display: grid;
  gap: 10px;
}

.settings-row,
.notice-toggle {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.settings-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-row span,
.notice-toggle small {
  display: block;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.settings-row strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.settings-row .tag {
  color: #344054;
  border-color: #d0d5dd;
  background: #ffffff;
}

.release-hero {
  margin-bottom: 18px;
  padding: 22px;
  color: #ffffff;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  background-color: #2d49c4;
  box-shadow: 0 18px 38px rgba(16, 24, 40, 0.18);
}

.release-hero h2 {
  margin: 10px 0;
  color: #ffffff;
}

.release-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

.release-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  color: var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.8rem;
  font-weight: 950;
}

.release-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.release-meta {
  padding: 13px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.release-meta span,
.release-date {
  color: var(--ink-muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.release-meta strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.release-section {
  margin-top: 18px;
}

.release-detail-stack {
  display: grid;
  gap: 14px;
}

.release-section h3,
.release-card h3 {
  margin: 0 0 8px;
  color: var(--ink);
}

.release-section p,
.release-card p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.65;
}

.release-bullets {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.55;
}

.release-list {
  display: grid;
  gap: 12px;
  max-height: min(62vh, 680px);
  overflow: auto;
  padding-right: 4px;
}

.release-card {
  padding: 16px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.release-card-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.release-card-button:hover,
.release-card-button:focus-visible {
  border-color: rgba(37, 117, 252, 0.55);
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.14);
  transform: translateY(-1px);
}

.release-card.current {
  border-color: rgba(37, 117, 252, 0.35);
  background: #eef4ff;
}

.release-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.release-card-head strong {
  color: var(--button-text);
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--button);
}

.notice-toggle {
  grid-template-columns: auto minmax(0, 0.8fr) minmax(0, 1fr);
  color: var(--ink);
  font-weight: 850;
}

.notice-toggle input {
  width: 18px;
  height: 18px;
}

.field {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 850;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-weight: 850;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.language-option {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 12px 42px 12px 14px;
  color: var(--ink);
  text-align: left;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.language-option:hover,
.language-option.active {
  transform: translateY(-2px);
  border-color: var(--button-text);
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.14);
}

.language-control-note,
.policy-control-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  color: #17324d;
  font-size: 0.92rem;
  line-height: 1.55;
  border: 1px solid #b7e3ff;
  border-radius: var(--radius);
  background: #edf8ff;
}

.language-helper-note {
  margin: 10px 0 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.policy-document {
  color: var(--ink);
  background: var(--surface);
}

.policy-document h2 {
  margin: 10px 0 12px;
  color: var(--ink);
}

.policy-intro {
  max-width: 780px;
  color: #344054;
  line-height: 1.7;
}

.policy-sections {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.policy-section {
  padding: 16px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
}

.policy-section h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1rem;
}

.policy-section p {
  margin: 0;
  color: #475467;
  line-height: 1.7;
}

.balance-note {
  padding: 10px 12px;
  border: 1px solid #fedf89;
  border-radius: var(--radius);
  background: #fffaeb;
}

.recharge-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.recharge-option {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px 10px;
  color: var(--ink);
  text-align: center;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.recharge-option:hover {
  transform: translateY(-2px);
  border-color: var(--button-text);
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.14);
}

.recharge-option strong {
  color: var(--button-text);
  font-size: 1.12rem;
}

.recharge-option span {
  color: #667085;
  font-size: 0.86rem;
  font-weight: 800;
}

.chat-modal {
  width: min(1240px, calc(100vw - 44px));
  position: relative;
  padding: 24px;
}

.chat-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
  padding-right: 58px;
}

.chat-titlebar h2 {
  margin: 8px 0 4px;
}

.chat-titlebar.compact {
  align-items: center;
  margin-bottom: 12px;
}

.chat-title-left {
  min-width: 150px;
}

.chat-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.chat-top-participants {
  display: grid;
  grid-template-columns: repeat(2, minmax(148px, 190px));
  gap: 8px;
  min-width: 0;
}

.chat-top-participants .chat-participant {
  min-height: 48px;
  padding: 8px 10px;
}

.chat-top-participants .chat-participant small {
  font-size: 0.72rem;
}

.chat-info-trigger {
  min-height: 42px;
  white-space: nowrap;
}

.chat-info-popover {
  position: absolute;
  top: 84px;
  right: 76px;
  z-index: 30;
  width: min(360px, calc(100% - 48px));
}

.chat-info-popover[hidden] {
  display: none !important;
}

.chat-info-popover-card {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.chat-brand-copy {
  margin: 0;
  color: #475467;
  font-weight: 850;
}

.chat-unread-card {
  display: grid;
  place-items: center;
  min-width: 90px;
  padding: 12px 16px;
  color: #ffffff;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  box-shadow: 0 16px 36px rgba(37, 117, 252, 0.2);
}

.chat-unread-card strong {
  font-size: 1.75rem;
  line-height: 1;
}

.chat-unread-card span {
  font-size: 0.78rem;
  font-weight: 850;
}

.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.chat-header p {
  margin: 0 0 4px;
}

.chat-header small {
  color: #667085;
}

.chat-presence {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.chat-participant {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.chat-participant strong,
.chat-participant small {
  display: block;
}

.presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #98a2b3;
  box-shadow: 0 0 0 4px rgba(152, 162, 179, 0.16);
}

.presence-dot.online {
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.16);
}

.presence-dot.offline {
  background: #98a2b3;
}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(680px, 960px);
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.chat-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.chat-sidebar h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 0.98rem;
}

.chat-tool {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  text-align: left;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
  font-weight: 850;
}

.chat-tool.disabled {
  color: #98a2b3;
  background: #eef2f6;
}

.chat-panel {
  display: block;
  min-width: 0;
}

.chat-context {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.chat-context-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
}

.chat-context-card.compact {
  color: #475467;
  background: #f8fafc;
}

.chat-context-card h3 {
  margin: 0 0 2px;
  font-size: 0.98rem;
}

.chat-context-card p {
  margin: 0;
}

.chat-info-row {
  display: grid;
  gap: 3px;
}

.chat-info-row span {
  color: #667085;
  font-size: 0.78rem;
  font-weight: 850;
}

.chat-info-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.embedded-support-chat {
  display: grid;
  grid-template-rows: auto minmax(390px, 56vh);
  min-height: 500px;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.embedded-support-chat.direct {
  grid-template-rows: auto minmax(390px, 56vh);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.9)),
    radial-gradient(circle at 22px 22px, rgba(37, 117, 252, 0.08) 1px, transparent 1.5px);
  background-size: auto, 26px 26px;
}

.embedded-support-chat.unavailable {
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 34px;
  color: #667085;
  text-align: center;
  background: #f8fafc;
}

.embedded-support-chat.unavailable i {
  color: #98a2b3;
  font-size: 2.3rem;
}

.embedded-support-chat.unavailable strong {
  color: var(--ink);
}

.embedded-support-chat.waiting {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(239, 246, 255, 0.9));
}

.embedded-support-chat.loading .loading-dot {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(37, 117, 252, 0.22);
  border-top-color: #2575fc;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.embedded-support-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #d0d5dd;
  background: #f8fafc;
}

.embedded-support-head strong,
.embedded-support-head span {
  display: block;
}

.embedded-support-head strong {
  color: var(--ink);
}

.embedded-support-head span {
  color: #667085;
  font-size: 0.8rem;
  font-weight: 800;
}

.embedded-support-provider {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #344054 !important;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #ffffff;
}

.embedded-support-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 390px;
  border: 0;
  background: #ffffff;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.chat-day-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 850;
}

.chat-day-separator::before,
.chat-day-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d0d5dd;
}

.chat-day-separator span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
}

.chat-message {
  width: min(78%, 520px);
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
}

.chat-message.compact {
  margin-top: -2px;
}

.chat-message.compact p:first-child {
  margin-top: 0;
}

.chat-message.own {
  justify-self: end;
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
}

.chat-message.system {
  justify-self: center;
  width: auto;
  max-width: 90%;
  color: #475467;
  text-align: center;
  background: #eef2ff;
}

.chat-message p {
  margin: 8px 0 0;
}

.chat-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #667085;
  font-size: 0.78rem;
}

.chat-message.own .chat-message-meta {
  color: rgba(255, 255, 255, 0.78);
}

.read-state {
  margin-top: 8px;
  text-align: right;
  font-size: 0.76rem;
  font-weight: 850;
}

.read-state.read {
  color: rgba(255, 255, 255, 0.82);
}

.read-state.unread {
  color: #ffd166;
}

.chat-image {
  display: block;
  max-width: min(100%, 320px);
  max-height: 260px;
  margin-top: 0;
  border-radius: var(--radius);
  object-fit: contain;
}

.chat-image-button {
  display: block;
  padding: 0;
  margin-top: 8px;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.chat-image-large {
  display: block;
  width: min(100%, 880px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.chat-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: #667085;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.chat-compose textarea {
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
}

.image-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: #344054;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #eef2ff;
  font-weight: 850;
  cursor: pointer;
}

.image-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.chat-attachment-preview {
  display: none;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #ffffff;
}

.chat-attachment-preview.is-visible {
  display: flex;
}

.chat-attachment-preview.visible {
  display: flex;
}

.chat-attachment-preview img {
  width: 88px;
  height: 64px;
  border-radius: var(--radius);
  object-fit: cover;
}

.quick-chat-stack {
  min-height: 0;
  height: min(820px, calc(100vh - 156px));
  display: grid;
  grid-template-rows: minmax(210px, 0.42fr) minmax(320px, 0.58fr);
  gap: 12px;
}

.order-chat-room {
  min-height: 420px;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 16% 12%, rgba(37, 117, 252, 0.2), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(106, 17, 203, 0.22), transparent 32%),
    linear-gradient(180deg, #07111f 0%, #0b1424 100%);
  color: #e5ecff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.order-chat-room.quick-chat {
  min-height: 0;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.quick-chat-stack .order-chat-room {
  min-height: 0;
}

.order-chat-room.disabled {
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 34px;
  color: #9aa8c7;
  text-align: center;
}

.order-chat-room.disabled i {
  color: #8ea4d8;
  font-size: 2.5rem;
}

.order-chat-room.disabled strong {
  color: #f8fbff;
}

.order-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(6, 13, 27, 0.78);
  backdrop-filter: blur(12px);
}

.order-chat-head strong,
.order-chat-head span {
  display: block;
}

.order-chat-head strong {
  color: #ffffff;
  font-size: 1rem;
}

.order-chat-head span {
  margin-top: 3px;
  color: #9fb1d3;
  font-size: 0.78rem;
  font-weight: 800;
}

.order-chat-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: #cfe3ff !important;
  border: 1px solid rgba(125, 160, 255, 0.42);
  border-radius: 999px;
  background: rgba(37, 117, 252, 0.16);
  font-size: 0.78rem;
  font-weight: 900;
}

.order-chat-room .chat-thread {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 18px;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

.order-chat-room .quick-chat-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.quick-chat-actions {
  position: relative;
  z-index: 2;
  min-height: 320px;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: auto;
  color: #e5ecff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.order-chat-room .chat-empty-state {
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #9fb1d3;
  text-align: center;
}

.order-chat-room .chat-empty-state i {
  color: #8ea4d8;
  font-size: 2.4rem;
}

.order-chat-room .chat-empty-state strong {
  color: #ffffff;
  font-size: 1.05rem;
}

.order-chat-room .chat-message {
  width: min(72%, 500px);
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  color: #dbe7ff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px 14px 14px 4px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.order-chat-room .chat-message.own {
  justify-self: end;
  color: #ffffff;
  border-color: rgba(115, 151, 255, 0.42);
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

.order-chat-room .chat-message.system {
  justify-self: center;
  width: min(90%, 620px);
  color: #bfdbfe;
  text-align: center;
  border-color: rgba(96, 165, 250, 0.38);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  box-shadow: none;
}

.order-chat-room .chat-message.action-card {
  border-color: rgba(250, 204, 21, 0.42);
  background:
    linear-gradient(180deg, rgba(250, 204, 21, 0.12), rgba(15, 23, 42, 0.9)),
    rgba(15, 23, 42, 0.92);
}

.order-chat-room .chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: #9fb1d3;
  font-size: 0.76rem;
  font-weight: 850;
}

.order-chat-room .chat-message.own .chat-message-meta {
  color: rgba(255, 255, 255, 0.82);
}

.order-chat-room .chat-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.order-chat-room .chat-read-state {
  color: rgba(255, 255, 255, 0.72);
}

.order-chat-room .chat-image {
  max-width: min(100%, 360px);
  max-height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.38);
}

.quick-chat-actions .chat-typing {
  min-height: 24px;
  padding: 0 18px;
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 850;
}

.order-chat-room .chat-compose {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(6, 13, 27, 0.88);
}

.order-chat-room .chat-compose textarea {
  min-height: 48px;
  max-height: 132px;
  color: #f8fbff;
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.72);
}

.order-chat-room .chat-compose textarea::placeholder {
  color: #8090ad;
}

.order-chat-room .chat-readonly-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: #fde68a;
  border-top: 1px solid rgba(250, 204, 21, 0.28);
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.13), rgba(15, 23, 42, 0.9)),
    rgba(6, 13, 27, 0.9);
  font-weight: 900;
  text-align: center;
}

.order-chat-room .chat-readonly-notice i {
  color: #facc15;
}

.order-chat-room .chat-attachment-preview {
  color: #dbe7ff;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.86);
}

.quick-chat-actions .chat-quick-panel {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(170px, 1fr);
  align-content: stretch;
  gap: 8px;
  overflow: visible;
  padding: 14px;
  background: transparent;
}

.quick-chat-actions .chat-quick-panel.locked {
  background: rgba(15, 23, 42, 0.88);
}

.quick-chat-actions .chat-quick-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.quick-chat-actions .chat-quick-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  color: #cfe3ff;
  border: 1px solid rgba(125, 160, 255, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: none;
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
}

.quick-chat-actions .chat-quick-tab.active {
  color: #ffffff;
  border-color: rgba(147, 197, 253, 0.8);
  background: linear-gradient(135deg, rgba(106, 17, 203, 0.8), rgba(37, 117, 252, 0.8));
}

.quick-chat-actions .chat-quick-grid {
  min-height: 170px;
  height: 100%;
  max-height: none;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  align-content: start;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.32);
}

.quick-chat-actions .chat-quick-empty {
  min-height: 170px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: rgba(203, 213, 225, 0.84);
  background: rgba(2, 6, 23, 0.28);
  text-align: center;
}

.quick-chat-actions .chat-quick-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  color: #eaf2ff;
  line-height: 1.25;
  text-align: left;
  border: 1px solid rgba(125, 160, 255, 0.35);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: none;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.quick-chat-actions .chat-quick-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, 0.8);
  background: rgba(37, 117, 252, 0.22);
}

.quick-chat-actions .chat-quick-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: rgba(30, 41, 59, 0.72);
}

.quick-chat-actions .chat-quick-btn.system-locked {
  opacity: 0.58;
  cursor: not-allowed;
  border-style: dashed;
}

.quick-chat-actions .chat-guided-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(250, 204, 21, 0.38);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.14), rgba(37, 117, 252, 0.1)),
    rgba(15, 23, 42, 0.92);
}

.quick-chat-actions .chat-guided-panel strong {
  color: #ffffff;
  font-size: 0.95rem;
}

.quick-chat-actions .chat-guided-panel p {
  margin: 0;
  color: #fef3c7;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.5;
}

.quick-chat-actions .chat-guided-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.quick-chat-actions .chat-flow-note,
.quick-chat-actions .chat-status,
.quick-chat-actions .chat-unavailable-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a9b9d8;
  font-size: 0.82rem;
  font-weight: 850;
}

.quick-chat-actions .chat-status {
  min-height: 24px;
  padding: 0 14px 12px;
  color: #93c5fd;
}

.quick-chat-actions .chat-unavailable-note {
  justify-content: center;
  color: #fde68a;
}

.mailbox-modal {
  width: min(1120px, calc(100vw - 28px));
  height: min(86vh, 780px);
  max-height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.mailbox-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding-right: 58px;
}

.mailbox-heading .release-badge {
  width: max-content;
  margin: 0;
}

.mailbox-counter {
  display: grid;
  place-items: center;
  min-width: 96px;
  padding: 14px 18px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  box-shadow: 0 18px 40px rgba(37, 117, 252, 0.2);
}

.mailbox-counter-button {
  appearance: none;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.mailbox-counter-button:hover:not(:disabled),
.mailbox-counter-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 22px 48px rgba(37, 117, 252, 0.28);
}

.mailbox-counter-button:disabled {
  cursor: default;
  opacity: 0.92;
}

.mailbox-counter strong {
  font-size: 1.7rem;
  line-height: 1;
}

.mailbox-counter span {
  font-size: 0.82rem;
  font-weight: 850;
  opacity: 0.86;
}

.mailbox-shell {
  display: grid;
  grid-template-columns: 185px minmax(270px, 0.78fr) minmax(0, 1.35fr);
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.12);
}

body.staff-mode .mailbox-shell {
  background: rgba(255, 251, 235, 0.76);
}

body.admin-mode .mailbox-shell {
  background: rgba(248, 250, 252, 0.78);
}

.mailbox-nav,
.mailbox-list,
.mailbox-detail {
  min-width: 0;
  overflow: auto;
}

.mailbox-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(239, 246, 255, 0.9));
  border-right: 1px solid rgba(17, 24, 39, 0.1);
}

body.staff-mode .mailbox-nav {
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 237, 213, 0.88));
}

body.admin-mode .mailbox-nav {
  background: linear-gradient(180deg, rgba(249, 250, 251, 0.98), rgba(229, 231, 235, 0.82));
}

.mailbox-category {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 0 12px;
  color: #475467;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  font-weight: 850;
  text-align: left;
}

.mailbox-category span {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.16;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.mailbox-category small {
  color: #667085;
  font-weight: 900;
  white-space: nowrap;
}

.mailbox-category:hover,
.mailbox-category.active {
  color: var(--ink);
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(255, 255, 255, 0.78);
}

.mailbox-category.active {
  box-shadow: inset 3px 0 0 var(--bg-start), 0 10px 24px rgba(16, 24, 40, 0.08);
}

.mailbox-category.favorite {
  margin-top: auto;
}

.mailbox-nav-spacer {
  flex: 1 1 auto;
  min-height: 12px;
}

.mailbox-sync-button,
.mailbox-admin-send {
  margin-top: 12px;
}

.mailbox-sync-button {
  margin-right: 8px;
}

.mailbox-list {
  position: relative;
  min-height: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.64);
  border-right: 1px solid rgba(17, 24, 39, 0.1);
  overflow: hidden;
}

.mailbox-list-scroll {
  height: 100%;
  min-height: 0;
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px 12px 92px;
  overflow: auto;
}

.mailbox-list-actions {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

.mailbox-action {
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.mailbox-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.mail-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 78px;
  padding: 10px 12px;
  color: #344054;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
}

.mail-row:hover,
.mail-row.active {
  color: var(--ink);
  border-color: rgba(37, 117, 252, 0.42);
  background: rgba(239, 246, 255, 0.96);
}

body.staff-mode .mail-row:hover,
body.staff-mode .mail-row.active {
  border-color: rgba(255, 138, 0, 0.46);
  background: rgba(255, 247, 237, 0.98);
}

body.admin-mode .mail-row:hover,
body.admin-mode .mail-row.active {
  border-color: rgba(89, 97, 106, 0.38);
  background: rgba(243, 244, 246, 0.98);
}

.mail-row.read {
  opacity: 0.78;
}

.mail-row-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--button-text);
  border: 1px solid rgba(37, 117, 252, 0.16);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(239, 246, 255, 0.9);
}

body.staff-mode .mail-row-icon {
  border-color: rgba(255, 138, 0, 0.22);
  background: rgba(255, 247, 237, 0.94);
}

body.admin-mode .mail-row-icon {
  border-color: rgba(89, 97, 106, 0.2);
  background: rgba(243, 244, 246, 0.96);
}

.mail-row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.mail-row-main strong,
.mail-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-row-main small,
.mail-row time {
  color: #667085;
  font-size: 0.78rem;
}

.mail-row-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 72px;
}

.mail-expiry {
  color: #7c3aed;
  font-size: 0.72rem;
  font-weight: 900;
}

body.staff-mode .mail-expiry {
  color: #c2410c;
}

body.admin-mode .mail-expiry {
  color: #4b5563;
}

.mail-unread-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff5c7a;
  box-shadow: 0 0 0 4px rgba(255, 92, 122, 0.14);
}

.mailbox-detail {
  position: relative;
  padding: 24px;
  color: #344054;
  background:
    linear-gradient(rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
  padding-bottom: 104px;
}

.mail-detail-header {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.1);
}

.mail-detail-titlebar {
  display: block;
  padding-right: 124px;
}

.mail-detail-toolbar {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(10px);
}

.mail-detail-toolbar .icon-button.active {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
}

.mail-detail-toolbar .icon-button.danger {
  color: var(--danger);
  background: rgba(255, 92, 122, 0.12);
}

.mail-detail-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
}

.mail-detail-header p {
  color: #667085;
}

.mail-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}

.mail-detail-meta div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.84);
}

.mail-detail-meta dt {
  color: #667085;
  font-size: 0.78rem;
  font-weight: 850;
}

.mail-detail-meta dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 850;
}

.mail-detail-body {
  min-height: 220px;
  padding: 18px;
  color: #344054;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
  white-space: pre-wrap;
}

.mail-detail-actions {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 9;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(248, 250, 252, 0.94);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

.mailbox-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 180px;
  padding: 24px;
  color: #667085;
  text-align: center;
}

.mailbox-empty i {
  color: #98a2b3;
  font-size: 2rem;
}

.backup-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius);
  background: #f8fafc;
}

.backup-settings strong,
.backup-settings span,
.backup-settings small {
  display: block;
}

.backup-settings small {
  color: #667085;
}

.language-option span {
  font-weight: 900;
}

.language-option small {
  color: var(--ink-muted);
}

.language-option i {
  position: absolute;
  top: 15px;
  right: 14px;
  color: var(--button-text);
}

.translate-engine,
.goog-te-banner-frame,
.goog-te-balloon-frame,
body > .skiptranslate {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

body {
  top: 0 !important;
}

.product-art {
  display: grid;
  place-items: center;
  height: 220px;
  margin-bottom: 22px;
  color: #ffffff;
  font-size: 4rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #6a11cb, #2575fc);
}

.product-art.has-image {
  overflow: hidden;
  background: #101828;
}

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

.detail-price {
  display: block;
  margin: 20px 0 4px;
  color: var(--button-text);
  font-size: 1.55rem;
}

.context-menu {
  position: fixed;
  z-index: 80;
  min-width: 210px;
  max-width: min(360px, calc(100vw - 24px));
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.3);
}

.menu-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 10px 12px;
}

.menu-summary strong {
  display: block;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-summary span {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 0.82rem;
  font-weight: 800;
}

.menu-summary-icon,
.menu-avatar {
  width: 42px;
  height: 42px;
  margin: 0;
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.16);
}

.menu-summary-icon {
  display: grid;
  place-items: center;
  color: var(--button-text);
  border-radius: 50%;
  background: var(--button);
}

.menu-separator {
  height: 1px;
  margin: 5px 6px;
  background: #eaecf0;
}

.context-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  color: var(--ink);
  text-align: left;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.context-menu button:hover {
  background: #eef2ff;
}

.context-menu .destructive {
  color: #c01048;
}

.hidden {
  display: none !important;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100% - 36px));
  pointer-events: none;
}

.toast {
  padding: 14px 16px;
  color: var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.26);
  animation: slideUp 220ms ease both;
}

.toast strong {
  display: block;
  margin-bottom: 3px;
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 24px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 850;
}

.fade-in {
  animation: fadeIn 360ms ease both;
}

.slide-up {
  animation: slideUp 260ms ease both;
}

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

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loaderJump {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-14px);
  }
}

@keyframes loaderDotJump {
  0%,
  100% {
    opacity: 0.46;
    transform: translateY(0);
  }
  45% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

@keyframes interactionSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader-icon,
  .app-loader-dots span,
  .is-interaction-loading::after {
    animation: none;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto auto;
  }

  .search {
    grid-column: 1 / -1;
    order: 3;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .hero-panel,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .detail-heading {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-edit-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-edit-toolbar .row-actions {
    justify-content: flex-start;
  }

  .hero-stats {
    min-width: 0;
  }

  .grid,
  .grid-two,
  .grid-three,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .release-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recharge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-row,
  .order-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .product-row.admin-selectable {
    grid-template-columns: 1fr;
  }

  .chat-shell,
  .chat-compose,
  .chat-header,
  .chat-titlebar,
  .mailbox-shell {
    grid-template-columns: 1fr;
  }

  .mailbox-modal {
    height: auto;
    display: block;
    max-height: calc(100vh - 44px);
    overflow: auto;
  }

  .mailbox-heading {
    grid-template-columns: 1fr;
  }

  .mailbox-shell {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .mailbox-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.1);
  }

  .mailbox-category.favorite {
    margin-top: 0;
  }

  .mailbox-nav-spacer {
    display: none;
  }

  .mailbox-list {
    height: 360px;
    max-height: 46vh;
    border-right: 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.1);
  }

  .mailbox-detail {
    min-height: 520px;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
  }

  .chat-presence {
    min-width: 0;
  }

  .chat-titlebar.compact {
    padding-right: 0;
  }

  .chat-topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .chat-top-participants {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .chat-info-popover {
    position: static;
    width: 100%;
    margin-bottom: 12px;
  }

  .quick-chat-stack {
    height: auto;
    grid-template-rows: minmax(300px, 42vh) minmax(360px, auto);
  }

  .quick-chat-stack .order-chat-room {
    min-height: 300px;
  }

  .order-chat-room .quick-chat-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  .quick-chat-actions {
    min-height: 360px;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  .quick-chat-actions .chat-quick-panel {
    max-height: none;
    grid-template-rows: auto minmax(220px, 1fr);
  }

  .quick-chat-actions .chat-quick-grid {
    min-height: 220px;
    max-height: none;
  }

  .embedded-support-chat {
    grid-template-rows: auto minmax(360px, 54vh);
    min-height: 460px;
  }

  .embedded-support-frame {
    min-height: 360px;
  }

  .backup-settings {
    flex-direction: column;
    align-items: stretch;
  }

  .row-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar,
  .shell,
  .footer {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    gap: 12px;
    padding: 12px;
  }

  .search {
    flex-direction: column;
  }

  .search button,
  .button {
    width: 100%;
  }

  .top-actions .button {
    width: auto;
  }

  .brand > .brand-wordmark {
    display: none;
  }

  .user-name {
    display: none;
  }

  .hero-panel,
  .card,
  .panel {
    padding: 20px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .game-card {
    grid-template-columns: 1fr;
  }

  .game-card.admin-selectable {
    grid-template-columns: 1fr;
  }

  .game-card .card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .modal {
    padding: 12px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .language-grid {
    grid-template-columns: 1fr;
  }

  .auth-methods {
    grid-template-columns: 1fr;
  }

  .settings-row,
  .notice-toggle,
  .profile-summary,
  .release-meta-grid {
    grid-template-columns: 1fr;
  }

  .recharge-grid {
    grid-template-columns: 1fr;
  }

  .verify-row {
    grid-template-columns: 1fr;
  }

  .mailbox-nav {
    grid-template-columns: 1fr;
  }

  .mail-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .mail-row time {
    grid-column: auto;
  }

  .mail-row-side {
    grid-column: 2;
    justify-items: start;
  }

  .mail-detail-meta {
    grid-template-columns: 1fr;
  }
}
