/* Chrome */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) auto;
  align-items: center;
  min-height: calc(var(--topbar-height) + var(--safe-top));
  padding: var(--safe-top) max(20px, var(--safe-right)) 0 max(20px, var(--safe-left));
  border-bottom: 1px solid rgba(199, 215, 236, .75);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 18px rgba(10, 33, 71, .035);
  backdrop-filter: blur(18px);
}

.brand-button {
  position: relative;
  width: 178px;
  height: 50px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: var(--white);
}

.brand-crop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.brand-crop img {
  position: absolute;
  top: -29px;
  left: 0;
  width: 178px;
  max-width: none;
}

.desktop-shortcuts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.desktop-shortcuts button {
  min-height: 40px;
  padding: 0 14px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-shortcuts button:hover,
.desktop-shortcuts button.is-active {
  background: var(--surface-soft);
  color: var(--blue-700);
}

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

.compact-control,
.balance-chip,
.icon-button,
.profile-trigger {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 3px 12px rgba(10, 45, 90, .035);
}

.compact-control {
  display: flex;
  align-items: center;
  width: auto;
  min-width: 82px;
  padding: 0 9px;
  border-radius: 13px;
  color: var(--navy-700);
}

.compact-control .icon {
  width: 17px;
  height: 17px;
}

.compact-control select {
  width: 48px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 145px;
  padding: 0 13px;
  border-radius: 13px;
  color: var(--navy-900);
  font-weight: 800;
  white-space: nowrap;
}

.balance-chip:hover,
.compact-control:hover,
.icon-button:hover,
.profile-trigger:hover {
  border-color: var(--blue-100);
  background: var(--blue-50);
}

.icon-button,
.profile-trigger {
  display: inline-grid;
  place-items: center;
  width: 42px;
  padding: 0;
  border-radius: 13px;
}

.profile-trigger {
  overflow: hidden;
  border-radius: 50%;
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--blue-500);
}

.workspace-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
  min-height: calc(100dvh - var(--topbar-height));
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + var(--safe-top));
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height) - var(--safe-top));
  height: calc(100dvh - var(--topbar-height) - var(--safe-top));
  padding: 20px 14px 18px max(14px, var(--safe-left));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--white);
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.sidebar-link {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.sidebar-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: var(--blue-50);
  color: var(--navy-900);
}

.sidebar-link.is-active {
  background: var(--surface-blue);
  color: var(--blue-700);
}

.sidebar-link.is-active .icon {
  stroke-width: 2.2;
}

.sidebar-spacer {
  flex: 1 1 auto;
  min-height: 28px;
}

.sidebar-nav-secondary {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sidebar-account {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 13px 8px 0;
  border-top: 1px solid var(--line);
}

.sidebar-account .icon-button {
  width: 36px;
  min-height: 36px;
  border: 0;
  box-shadow: none;
}

.sidebar-account-copy {
  min-width: 0;
}

.sidebar-account-copy strong,
.sidebar-account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-copy strong {
  font-size: 13px;
}

.sidebar-account-copy small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 11px;
}

.view {
  width: 100%;
  min-width: 0;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 30px clamp(20px, 3.3vw, 52px) 54px;
  outline: none;
}

.mobile-nav {
  display: none;
}

/* Shared controls */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(10, 102, 237, .22);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--blue-700);
  background: var(--blue-700);
  box-shadow: 0 13px 30px rgba(10, 102, 237, .27);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--white);
  color: var(--navy-900);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--blue-700);
}

.button-quiet {
  min-height: 40px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
  color: var(--blue-700);
}

.button-danger {
  border-color: #ffd3da;
  background: var(--danger-soft);
  color: var(--danger);
}

.button-small {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  font-size: 13px;
}

.button-wide {
  width: 100%;
}

.button-row,
.header-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.icon-button.button-blue {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: var(--white);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--blue-700);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

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

.avatar-small {
  width: 38px;
  height: 38px;
}

.avatar-large {
  width: 58px;
  height: 58px;
  font-size: 16px;
}

.avatar-xl {
  width: 92px;
  height: 92px;
  font-size: 24px;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.7vw, 1.16rem);
  line-height: 1.65;
}

.page-shell {
  min-width: 0;
  animation: page-in .34s var(--ease) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.page-header-copy {
  min-width: 0;
}

.page-header h1 {
  margin-bottom: 8px;
  font-size: clamp(1.85rem, 3.4vw, 3.15rem);
}

.page-header p {
  max-width: 760px;
  margin-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 34px 0 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.32rem, 2.4vw, 1.82rem);
}

.section-heading p {
  margin: 5px 0 0;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--blue-700);
  font-weight: 800;
  white-space: nowrap;
}

.text-link .icon {
  width: 17px;
  height: 17px;
}

.surface,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card {
  min-width: 0;
  padding: 22px;
}

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

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 16px;
}

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

.mini-tag,
.status-pill,
.source-pill,
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 27px;
  padding: 3px 9px;
  overflow: hidden;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-tag,
.category-pill {
  background: var(--surface-soft);
  color: var(--navy-700);
}

.status-pill {
  background: var(--surface-blue);
  color: var(--blue-700);
}

.status-completed,
.status-resolved {
  background: var(--success-soft);
  color: var(--success);
}

.status-overdue,
.status-rejected,
.status-cancelled,
.status-refunded,
.status-dispute {
  background: var(--danger-soft);
  color: var(--danger);
}

.source-ai {
  background: #edeaff;
  color: #6b4fd3;
}

.source-user {
  background: var(--surface-blue);
  color: var(--blue-700);
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.rating .icon {
  width: 15px;
  height: 15px;
  fill: #ffb629;
  stroke: #ffb629;
}

.muted {
  color: var(--text-muted);
}

.clamp-2,
.clamp-3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.clamp-2 {
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.clamp-3 {
  line-clamp: 3;
  -webkit-line-clamp: 3;
}

/* Onboarding */
.onboarding {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(22px, var(--safe-top)) max(22px, var(--safe-right)) max(22px, var(--safe-bottom)) max(22px, var(--safe-left));
  overflow: hidden;
  background: var(--white);
}

.onboarding::before,
.onboarding::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: var(--surface-blue);
  pointer-events: none;
}

.onboarding::before {
  top: -220px;
  right: -180px;
  width: 540px;
  height: 540px;
}

.onboarding::after {
  bottom: -250px;
  left: -210px;
  width: 480px;
  height: 480px;
  background: var(--blue-50);
}

.onboarding-language {
  position: absolute;
  top: max(20px, var(--safe-top));
  right: max(22px, var(--safe-right));
  z-index: 3;
}

.onboarding-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.1fr);
  align-items: center;
  gap: clamp(36px, 8vw, 120px);
  width: min(1180px, 100%);
  margin: auto;
}

.onboarding-brand {
  min-width: 0;
}

.onboarding-logo {
  position: relative;
  width: min(360px, 88%);
  height: 225px;
  margin: -45px 0 -30px;
  overflow: hidden;
}

.onboarding-logo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.onboarding-brand h1 {
  max-width: 600px;
  margin-bottom: 18px;
}

.onboarding-brand > .eyebrow {
  position: relative;
  z-index: 1;
}

.onboarding-brand .lead {
  max-width: 540px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy-700);
  font-size: 12px;
  font-weight: 750;
}

.trust-chip .icon {
  width: 16px;
  height: 16px;
  color: var(--blue-600);
}

.registration-card {
  width: 100%;
  max-width: 570px;
  justify-self: end;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-lg);
}

.progress-track {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.progress-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.progress-dot.is-active,
.progress-dot.is-complete {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: var(--white);
}

.progress-line {
  height: 2px;
  background: var(--line);
}

.legal-choice-list {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.legal-choice {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  text-align: left;
}

.legal-choice:hover {
  border-color: var(--blue-100);
  background: var(--blue-50);
}

.legal-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface-blue);
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 900;
}

.legal-choice-copy {
  min-width: 0;
}

.legal-choice-copy strong,
.legal-choice-copy small {
  display: block;
}

.legal-choice-copy small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.consent-list {
  display: grid;
  gap: 12px;
  margin: 21px 0;
}

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}

.consent-row input {
  margin-top: 1px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 800;
}

.back-link .icon {
  width: 17px;
  height: 17px;
}

/* Forms */
.form-stack {
  display: grid;
  gap: 16px;
}

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

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.field > span {
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 800;
}

.field em,
.settings-profile-card em {
  color: var(--text-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
}

.field small,
.form-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.input-prefix {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.input-prefix:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .12);
}

.input-prefix b {
  display: grid;
  place-items: center;
  height: 100%;
  border-right: 1px solid var(--line);
  color: var(--text-muted);
}

.input-prefix input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

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

.search-input {
  position: relative;
  min-width: 0;
}

.search-input .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input input {
  padding-left: 43px;
}

.search-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
}

.category-strip::-webkit-scrollbar,
.admin-tabs::-webkit-scrollbar {
  display: none;
}

.category-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.category-button:hover,
.category-button.is-active {
  border-color: var(--blue-100);
  background: var(--surface-blue);
  color: var(--blue-700);
}

/* Home */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: 390px;
  padding: clamp(28px, 5vw, 62px);
  overflow: hidden;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.hero::after {
  position: absolute;
  right: -105px;
  bottom: -150px;
  width: 370px;
  height: 370px;
  border-radius: 50%;
  background: var(--surface-blue);
  content: "";
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero h1 {
  max-width: 760px;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 670px;
  margin-top: 26px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.hero-search input {
  border: 0;
  box-shadow: none;
}

.hero-visual {
  display: grid;
  align-content: center;
  gap: 12px;
}

.hero-brand-mark {
  position: relative;
  width: min(360px, 100%);
  height: 205px;
  margin: -35px auto -20px;
  overflow: hidden;
}

.hero-brand-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
}

.hero-callout {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  max-width: 330px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--blue-100);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.hero-callout-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.hero-callout strong,
.hero-callout small {
  display: block;
}

.hero-callout small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.stat-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.stat-copy span,
.stat-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-copy span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.stat-copy strong {
  margin-top: 2px;
  color: var(--navy-950);
  font-size: 20px;
}

/* Market cards */
.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.market-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 265px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease;
}

.market-card:hover {
  border-color: var(--blue-100);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.market-card-top,
.market-card-footer,
.person-line,
.meta-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.market-card-top,
.market-card-footer {
  justify-content: space-between;
}

.market-card h3 {
  margin: 16px 0 8px;
  font-size: 1.04rem;
}

.market-card p {
  margin-bottom: 18px;
  font-size: 13px;
}

.market-card-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.person-line {
  min-width: 0;
}

.person-copy {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.person-copy strong,
.person-copy small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-copy strong {
  font-size: 12px;
}

.person-copy small {
  color: var(--text-muted);
  font-size: 10px;
}

.person-copy .rating {
  max-width: 100%;
  font-size: inherit;
}

.price {
  color: var(--navy-950);
  font-size: 1.05rem;
  font-weight: 900;
  white-space: nowrap;
}

.meta-row {
  flex-wrap: wrap;
  margin-top: 13px;
  color: var(--text-muted);
  font-size: 11px;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-row .icon {
  width: 14px;
  height: 14px;
}

.list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 2px 16px;
  color: var(--text-muted);
  font-size: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.pagination span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

/* Detail panels */
.detail-hero {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.detail-hero h2 {
  margin-top: 14px;
}

.detail-price {
  margin: 18px 0 4px;
  color: var(--blue-700);
  font-size: 1.65rem;
  font-weight: 900;
}

.detail-section {
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section p:last-child {
  margin-bottom: 0;
}

.detail-person {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.notice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--blue-100);
  border-radius: 14px;
  background: var(--blue-50);
  color: var(--navy-700);
  font-size: 12px;
  line-height: 1.55;
}

.notice > :only-child {
  grid-column: 1 / -1;
}

.notice.is-warning {
  border-color: #f5dfae;
  background: var(--warning-soft);
  color: #8a570b;
}

.notice.is-danger {
  border-color: #ffd2da;
  background: var(--danger-soft);
  color: #a92f43;
}

/* Messages */
.messages-shell {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  height: calc(100vh - var(--topbar-height) - 60px);
  height: calc(100dvh - var(--topbar-height) - 60px);
  min-height: 590px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.chat-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.chat-list-header {
  padding: 20px 17px 15px;
  border-bottom: 1px solid var(--line);
}

.chat-list-header h2 {
  margin-bottom: 13px;
  font-size: 1.3rem;
}

.chat-rows {
  overflow-y: auto;
}

.chat-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 74px;
  padding: 12px 14px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  text-align: left;
}

.chat-row:hover,
.chat-row.is-active {
  background: var(--blue-50);
}

.chat-row-copy {
  min-width: 0;
}

.chat-row-copy strong,
.chat-row-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row-copy strong {
  font-size: 13px;
}

.chat-row-copy small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.chat-row time {
  align-self: start;
  padding-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.conversation {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  background: #f9fbfe;
}

.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.conversation-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.conversation-user span:last-child {
  min-width: 0;
}

.conversation-user strong,
.conversation-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-user small {
  color: var(--text-muted);
  font-size: 10px;
}

.messages-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 20px;
  overflow-y: auto;
}

.message {
  max-width: min(74%, 650px);
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  background: var(--white);
  box-shadow: 0 4px 12px rgba(8, 45, 93, .04);
}

.message.is-mine {
  align-self: flex-end;
  border-color: #cae0ff;
  border-radius: 16px 16px 5px 16px;
  background: var(--surface-blue);
}

.message.is-system {
  align-self: center;
  max-width: 88%;
  border-color: var(--blue-100);
  border-radius: 14px;
  background: var(--blue-50);
  text-align: center;
}

.message.is-offer {
  width: min(88%, 520px);
  max-width: 520px;
  padding: 16px;
  border-color: var(--blue-100);
}

.message p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message time {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
  text-align: right;
}

.offer-box {
  display: grid;
  gap: 11px;
}

.offer-box h4 {
  margin: 0;
  font-size: 14px;
}

.offer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.message-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  padding: 14px 16px max(14px, var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--white);
}

.message-composer textarea {
  min-height: 44px;
  max-height: 120px;
  resize: none;
}

.message-composer .button {
  width: 44px;
  min-height: 44px;
  padding: 0;
}

.chat-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 36px;
  text-align: center;
}

.chat-placeholder-content {
  max-width: 360px;
}

/* Orders and finance */
.order-list,
.transaction-list,
.ticket-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.order-card,
.transaction-row,
.ticket-card,
.admin-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px;
  /* Use the semantic surface token so a theme switch can never leave this card
     on the light-only --white token while its text has already switched dark. */
  background: var(--surface);
  color: var(--text);
}

.order-card h3 {
  margin: 10px 0 6px;
}

.order-card p {
  margin-bottom: 0;
  font-size: 12px;
}

.order-side {
  display: grid;
  align-content: space-between;
  justify-items: end;
  gap: 16px;
  text-align: right;
}

.balance-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(2, minmax(0, .8fr));
  gap: 14px;
  margin-bottom: 20px;
}

.balance-card {
  display: grid;
  min-width: 0;
  min-height: 155px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.balance-card.is-primary {
  border-color: var(--navy-900);
  background: var(--navy-900);
  color: var(--white);
}

.balance-card span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.balance-card.is-primary span {
  color: #b9cdf0;
}

.balance-card strong {
  margin: 13px 0;
  overflow: hidden;
  color: var(--navy-950);
  font-size: clamp(1.7rem, 3.5vw, 2.55rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-card.is-primary strong {
  color: var(--white);
}

.balance-card small {
  align-self: end;
  color: var(--text-muted);
  font-size: 10px;
}

.balance-card.is-primary small {
  color: #9eb7df;
}

.finance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.transaction-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 11px 14px;
}

.transaction-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.transaction-copy {
  min-width: 0;
}

.transaction-copy strong,
.transaction-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-copy small {
  color: var(--text-muted);
  font-size: 10px;
}

.transaction-amount {
  color: var(--navy-950);
  font-weight: 900;
  white-space: nowrap;
}

/* Profile and settings */
.profile-header {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.profile-title {
  min-width: 0;
}

.profile-title h1 {
  margin-bottom: 3px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.profile-title p {
  margin: 0;
  overflow-wrap: break-word;
}

.profile-ratings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.rating-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.rating-card strong {
  font-size: 1.5rem;
}

.rating-card span,
.rating-card small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}

.about-card {
  padding: 22px;
}

.review-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.review-card p {
  margin: 10px 0 0;
  font-size: 13px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.settings-profile-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.avatar-upload {
  position: relative;
  display: grid;
  place-items: center;
}

.avatar-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.avatar-upload-button {
  position: absolute;
  right: -4px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--blue-600);
  color: var(--white);
}

.settings-form-card {
  padding: clamp(20px, 3vw, 30px);
}

/* Support and admin */
.support-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.support-action {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 100px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  text-align: left;
}

.support-action:hover {
  border-color: var(--blue-100);
  background: var(--blue-50);
}

.support-action-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.support-action strong,
.support-action small {
  display: block;
}

.support-action small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.ticket-card,
.admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 17px;
}

.ticket-card h3,
.admin-card h3 {
  margin: 8px 0 4px;
  font-size: 14px;
}

.ticket-card p,
.admin-card p {
  margin: 0;
  font-size: 11px;
}

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

.admin-stat {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

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

.admin-stat span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
}

.admin-stat strong {
  margin-top: 7px;
  font-size: 1.55rem;
}

.admin-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tab {
  flex: 0 0 auto;
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-tab.is-active {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: var(--white);
}

.admin-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.admin-user span:last-child {
  min-width: 0;
}

.admin-user strong,
.admin-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user small {
  color: var(--text-muted);
  font-size: 10px;
}

/* Modal, drawer, legal, feedback */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(3, 22, 51, .34);
  backdrop-filter: blur(4px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(480px, 100%);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  transform: translateX(104%);
  transition: transform .32s var(--ease);
}

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

.panel-header,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: max(14px, var(--safe-top)) 18px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.panel-header > span {
  min-width: 0;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-content {
  min-width: 0;
  padding: 22px 20px max(26px, var(--safe-bottom));
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scroll-behavior: auto;
}

.modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 20px;
  overflow-y: auto;
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(3, 22, 51, .46);
  backdrop-filter: blur(5px);
}

.modal-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 18px;
}

.modal-heading {
  min-width: 0;
}

.modal-heading .eyebrow {
  margin-bottom: 2px;
}

.modal-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.modal-content {
  max-height: calc(100vh - 132px);
  max-height: calc(100dvh - 132px);
  padding: 20px;
  overflow-y: auto;
}

.modal-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.legal-document {
  color: var(--text-soft);
  font-size: 13px;
}

.legal-document .legal-intro {
  padding: 14px;
  border: 1px solid var(--blue-100);
  border-radius: 14px;
  background: var(--blue-50);
  color: var(--navy-700);
}

.legal-document h3 {
  margin: 23px 0 8px;
  font-size: 15px;
}

.legal-document p,
.legal-document li {
  line-height: 1.72;
}

.legal-document ul {
  padding-left: 21px;
}

.toast-region {
  position: fixed;
  right: max(18px, var(--safe-right));
  bottom: max(18px, var(--safe-bottom));
  z-index: 110;
  display: grid;
  gap: 9px;
  width: min(390px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #c9e9dc;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  color: var(--navy-900);
  font-size: 12px;
  pointer-events: auto;
  transition: opacity .16s ease-out, transform .16s ease-out;
  will-change: opacity, transform;
}

.toast.is-dismissing {
  opacity: 0;
  transform: translateY(7px);
  pointer-events: none;
}

.toast.is-error {
  border-color: #ffd0d8;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--success-soft);
  color: var(--success);
}

.toast.is-error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.loading-state,
.empty-state,
.error-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 36px;
  text-align: center;
}

.loading-state p,
.empty-state p,
.error-state p {
  max-width: 460px;
  margin: 12px auto 0;
}

.loading-state h3,
.empty-state h3,
.error-state h3 {
  margin: 0;
}

.loading-state .button,
.empty-state .button,
.error-state .button {
  margin-top: 20px;
}

.state-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 13px;
  border-radius: 18px;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.state-icon .icon {
  width: 26px;
  height: 26px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

/* Polished interaction, unread, support and attachment states */
.sidebar-link {
  grid-template-columns: 22px minmax(0, 1fr) auto;
}

.sidebar-link .icon,
.mobile-link .icon,
.admin-tab,
.support-action-icon .icon {
  align-self: center;
  justify-self: center;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notification-count,
.nav-unread,
.chat-unread {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: #c92f4a;
  color: var(--white);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
}

.nav-unread {
  border-width: 0;
}

.mobile-link {
  position: relative;
}

.nav-unread.is-mobile {
  position: absolute;
  top: 2px;
  right: max(5px, 14%);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--white);
  font-size: 8px;
}

.profile-name {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--navy-950);
  font-size: inherit;
  font-weight: 800;
  line-height: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-name:hover {
  color: var(--blue-700);
  text-decoration-color: currentColor;
}

.username-status {
  min-height: 18px;
  font-size: 11px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.username-status.is-available {
  color: var(--success);
}

.username-status.is-taken {
  color: var(--danger);
}

.username-status button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--success);
  font-weight: 850;
  text-decoration: underline;
}

.content-language,
.rate-source,
.support-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.content-language {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.content-language .icon,
.rate-source .icon,
.support-identity .icon {
  width: 16px;
  height: 16px;
}

.content-language .text-link {
  margin-left: auto;
}

.rate-source {
  width: fit-content;
  max-width: 100%;
  margin: -10px 0 16px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  overflow-wrap: anywhere;
}

.rate-source.is-live {
  border-color: #bde8d8;
  background: var(--success-soft);
  color: #087453;
}

.chat-row-side {
  display: grid;
  justify-items: end;
  align-self: stretch;
  gap: 7px;
}

.chat-row-side time {
  align-self: start;
}

.chat-row.has-unread .chat-row-copy strong {
  color: var(--navy-950);
  font-weight: 900;
}

.conversation {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

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

.message-format-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
}

.message-format-toolbar button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy-800);
  font: inherit;
}

.message-format-toolbar button:hover,
.message-format-toolbar button:focus-visible {
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--blue-700);
}

.message-text strong {
  font-weight: 900;
}

.message-text em {
  font-style: italic;
}

.message-text u {
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.attachment-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  color: var(--blue-700);
}

.attachment-button:hover {
  border-color: var(--blue-100);
  background: var(--blue-50);
}

.attachment-button.is-uploading .icon {
  animation: spin .8s linear infinite;
}

.attachment-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-limits-hint {
  padding: 0 16px max(8px, var(--safe-bottom));
  border-top: 0;
  background: var(--white);
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.message.is-file {
  width: min(88%, 420px);
  max-width: 420px;
  padding: 8px;
}

.file-message-card {
  display: grid;
  gap: 8px;
}

.chat-inline-media {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid var(--blue-100);
  border-radius: 13px;
  background: #061a36;
}

.chat-inline-media img,
.chat-inline-media video {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
}

.chat-inline-media video {
  background: #061a36;
}

.chat-inline-loading,
.chat-inline-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: rgba(255, 255, 255, .86);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.chat-inline-loading .spinner {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, .35);
  border-top-color: var(--white);
}

.chat-inline-error .icon {
  width: 19px;
  height: 19px;
}

.file-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.file-message-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-700);
}

.file-message strong,
.file-message small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-message strong {
  font-size: 12px;
}

.file-message small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

.file-message-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.file-message-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  background: var(--white);
  color: var(--blue-700);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.file-message-actions button:first-child {
  background: var(--blue-700);
  color: var(--white);
}

.file-message-actions button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.file-message-actions .icon {
  width: 14px;
  height: 14px;
}

.file-preview-shell {
  display: grid;
  gap: 14px;
}

.file-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--blue-50);
}

.file-preview-meta > span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-preview-meta strong {
  overflow-wrap: anywhere;
}

.file-preview-meta small {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 10px;
}

.file-preview-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #071a35;
}

.file-preview-stage img,
.file-preview-stage video {
  display: block;
  max-width: 100%;
  max-height: min(66vh, 720px);
  max-height: min(66dvh, 720px);
  object-fit: contain;
}

.file-preview-stage video {
  width: 100%;
}

.file-preview-stage.is-pdf {
  display: block;
  min-height: min(68vh, 760px);
  min-height: min(68dvh, 760px);
  background: var(--blue-50);
}

.file-preview-stage iframe {
  display: block;
  width: 100%;
  height: min(68vh, 760px);
  height: min(68dvh, 760px);
  border: 0;
  background: var(--white);
}

.file-preview-stage.is-audio {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  min-height: 150px;
  padding: 24px;
  background: linear-gradient(135deg, #031633, #064abf);
}

.file-preview-audio-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .12);
  color: var(--white);
}

.file-preview-audio-icon .icon {
  width: 30px;
  height: 30px;
}

.file-preview-stage audio {
  width: 100%;
}

.file-preview-stage.is-text {
  display: block;
  max-height: min(64vh, 700px);
  max-height: min(64dvh, 700px);
  overflow: auto;
  background: #f8fbff;
}

.file-preview-stage pre {
  min-height: 240px;
  margin: 0;
  padding: 18px;
  color: var(--navy-950);
  font: 12px/1.62 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.file-preview-truncated {
  position: sticky;
  bottom: 0;
  padding: 9px 14px;
  border-top: 1px solid var(--blue-100);
  background: var(--blue-50);
  color: var(--text-soft);
  font-size: 10px;
  text-align: center;
}

.file-preview-unavailable,
.file-preview-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 260px;
  padding: 28px;
  border: 1px dashed var(--blue-100);
  border-radius: 16px;
  background: var(--blue-50);
  text-align: left;
}

.file-preview-unavailable p,
.file-preview-error p {
  max-width: 560px;
  margin: 5px 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.file-preview-unavailable small {
  color: var(--text-muted);
}

.file-preview-fallback-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 19px;
  background: var(--white);
  color: var(--blue-700);
}

.file-preview-fallback-icon .icon {
  width: 28px;
  height: 28px;
}

.file-preview-error {
  display: grid;
  justify-items: center;
  text-align: center;
}

.file-preview-loading {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 300px;
  color: var(--text-muted);
}

.file-preview-loading .loading-state {
  min-height: auto;
}

.file-preview-actions,
.file-card-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.setting-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-50);
}

.setting-toggle strong,
.setting-toggle small {
  display: block;
}

.setting-toggle small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.setting-toggle input {
  width: 20px;
  min-height: 20px;
}

.ticket-card {
  width: 100%;
  color: inherit;
  text-align: left;
  transition: border-color .18s ease, background-color .18s ease;
}

.ticket-card:hover {
  border-color: var(--blue-100);
  background: var(--blue-50);
}

.ticket-card > span,
.ticket-card small,
.ticket-title {
  min-width: 0;
}

.ticket-title,
.ticket-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-title {
  margin: 8px 0 4px;
  font-size: 14px;
}

.ticket-card small {
  color: var(--text-soft);
  font-size: 11px;
}

.admin-stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.admin-stat small {
  display: block;
  margin-top: 4px;
  color: var(--warning);
  font-size: 9px;
  font-weight: 800;
}

.admin-stat.needs-attention,
.admin-card.needs-attention {
  border-color: #f0cf87;
  background: var(--warning-soft);
}

.attention-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f3b63d;
  color: #633d00;
  font-size: 9px;
  font-weight: 900;
}

.support-thread-head {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.support-thread {
  display: grid;
  gap: 10px;
  max-height: min(42vh, 420px);
  padding: 13px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.support-message {
  width: min(88%, 620px);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px 15px 15px 5px;
  background: var(--white);
}

.support-message.is-staff {
  justify-self: end;
  border-color: #f0cf87;
  border-radius: 15px 15px 5px 15px;
  background: var(--warning-soft);
}

.support-message header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 10px;
}

.support-message time {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 8px;
}

.support-message p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.support-reply {
  margin-top: 14px;
}

.support-identity {
  padding: 10px 12px;
  border: 1px solid #f0cf87;
  border-radius: 12px;
  background: var(--warning-soft);
  color: #7a4b00;
  font-weight: 800;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-list button {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  text-align: left;
}

.notification-list strong,
.notification-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-list small {
  color: var(--text-muted);
  font-size: 10px;
}

.notification-list b {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  border-radius: 999px;
  background: var(--blue-600);
  color: var(--white);
  font-size: 10px;
}

.market-card *,
.order-card *,
.admin-card *,
.ticket-card *,
.conversation *,
.detail-section * {
  min-width: 0;
}

.admin-card p,
.order-card p,
.detail-section p,
.legal-document,
.notice,
.support-action small {
  overflow-wrap: anywhere;
}

/* Account safety, translation, escrow and expanded administrator tools */
.balance-chip {
  max-width: min(32vw, 220px);
  overflow: hidden;
}

.balance-chip span,
.admin-balance,
.transaction-amount,
.price {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-size-compact {
  font-size: clamp(.92rem, 2.2vw, 1.45rem) !important;
  letter-spacing: -.03em;
}

.money-size-tiny {
  font-size: clamp(.72rem, 1.7vw, 1.05rem) !important;
  letter-spacing: -.045em;
}

.card-actions,
.conversation-actions,
.admin-card-actions,
.admin-management-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.message-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 10px;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 9px;
}

.message-tools > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.message-tools .icon {
  width: 12px;
  height: 12px;
}

.message-composer-disabled,
.finance-freeze-notice {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 16px 8px;
  padding: 12px 14px;
  border: 1px solid #bcd6ff;
  border-radius: 14px;
  background: var(--surface-blue);
  color: var(--navy-800);
  font-size: 11px;
  font-weight: 750;
}

.finance-freeze-notice {
  margin: 0 0 16px;
  border-color: #b5d3ff;
}

.finance-freeze-notice .icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: var(--blue-600);
}

.finance-freeze-notice strong,
.finance-freeze-notice small {
  display: block;
}

.finance-freeze-notice small {
  margin-top: 2px;
  color: var(--text-soft);
  font-weight: 550;
}

.status-text.is-blocked {
  color: var(--danger) !important;
  font-weight: 850;
}

.profile-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.status-blocked {
  border-color: #f2bcc4;
  background: var(--danger-soft);
  color: var(--danger);
}

.status-frozen {
  border-color: #b5d3ff;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.status-frozen .icon {
  width: 12px;
  height: 12px;
}

.admin-stat.is-frozen {
  border-color: #b5d3ff;
  background: var(--surface-blue);
}

.admin-user-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-bottom: 14px;
}

.admin-user-card {
  align-items: center;
}

.admin-user-card .admin-user > span:last-child {
  display: grid;
  gap: 3px;
}

.admin-balance {
  max-width: 190px;
  color: var(--navy-950);
  font-size: 15px;
}

.balance-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.balance-mode legend {
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.balance-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.balance-mode label span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
}

.balance-mode input:checked + span {
  border-color: var(--blue-600);
  background: var(--surface-blue);
  color: var(--blue-700);
  box-shadow: 0 0 0 1px var(--blue-600);
}

.admin-user-detail {
  display: grid;
  gap: 20px;
}

.admin-user-detail > header {
  display: flex;
  align-items: center;
  gap: 13px;
}

.admin-user-detail > header > span:last-child,
.admin-user-detail > header strong,
.admin-user-detail > header small {
  display: block;
}

.admin-user-detail > header small {
  margin: 3px 0 7px;
  color: var(--text-muted);
  font-size: 10px;
}

.admin-user-detail section > h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.admin-balance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-balance-grid article {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--blue-50);
}

.admin-balance-grid span,
.admin-balance-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-balance-grid span {
  color: var(--text-muted);
  font-size: 9px;
}

.admin-balance-grid strong {
  margin-top: 5px;
  font-size: 13px;
}

.admin-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.admin-detail-row:last-child {
  border-bottom: 0;
}

.admin-detail-row > span,
.admin-detail-row strong,
.admin-detail-row small {
  display: block;
  min-width: 0;
}

.admin-detail-row strong {
  font-size: 11px;
}

.admin-detail-row small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.admin-chat-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.admin-chat-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  text-align: left;
}

.admin-chat-row strong,
.admin-chat-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chat-row small,
.admin-chat-row time {
  color: var(--text-muted);
  font-size: 9px;
}

.admin-message-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60vh, 560px);
  margin-top: 12px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-50);
}

@media (max-width: 720px) {
  .admin-user-search,
  .balance-mode,
  .admin-balance-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-card,
  .admin-detail-row {
    align-items: stretch;
  }

  .admin-card-actions,
  .admin-management-actions {
    justify-content: flex-start;
  }

  .conversation-actions .button span {
    display: none;
  }
}

/* TaskLink live UI, contextual translator and resilient text layout */
.loading-state > div,
.empty-state > div,
.error-state > div,
.chat-placeholder-content {
  display: grid;
  justify-items: center;
  width: min(100%, 620px);
  margin-inline: auto;
}

.state-icon {
  margin-inline: auto;
}

.toast-region {
  z-index: 2147483647;
  isolation: isolate;
}

.modal > .toast-region {
  position: fixed;
  z-index: 2147483647;
}

.toast > span:last-child,
.dialog-message {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dialog-message {
  margin: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-50);
  color: var(--text-soft);
  line-height: 1.65;
}

.translator-teaser {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 18px 0 22px;
  padding: 15px 17px;
  border: 1px solid #bad5ff;
  border-radius: var(--radius-md);
  background: linear-gradient(105deg, #f5f9ff 0%, #ffffff 60%);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.translator-teaser:hover {
  border-color: var(--blue-500);
  transform: translateY(-1px);
}

.translator-teaser-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--blue-600);
  color: var(--white);
}

.translator-teaser strong,
.translator-teaser small {
  display: block;
}

.translator-teaser small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 11px;
}

.translator-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.translator-editor,
.translator-result {
  min-width: 0;
  min-height: 480px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.translator-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.translator-language-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: end;
  gap: 9px;
}

.translator-swap {
  margin-bottom: 1px;
}

.translator-input-field {
  flex: 1 1 auto;
}

.translator-input-field textarea {
  min-height: 300px;
  height: 100%;
  white-space: pre-wrap;
}

.translator-input-field > small {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
}

.translator-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 9px;
}

.translator-result {
  display: flex;
  flex-direction: column;
}

.translator-result > header,
.translator-result > footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.translator-result > header h2 {
  margin: 2px 0 0;
  font-size: 1.35rem;
}

.translation-result-text {
  flex: 1 1 auto;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--blue-50);
  color: var(--navy-900);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.translator-result > footer {
  justify-content: flex-start;
  color: var(--text-muted);
  font-size: 10px;
}

.translator-result.is-empty {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--blue-700);
  font-weight: 800;
}

.context-pill .icon {
  width: 12px;
  height: 12px;
}

.order-title-link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.order-title-link:hover h3 {
  color: var(--blue-700);
}

.order-detail-hero {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--navy-950);
  color: var(--white);
}

.order-detail-hero h2,
.order-detail-hero .detail-price {
  margin: 0;
  color: var(--white);
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}

.order-detail-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-50);
}

.order-detail-grid article > span,
.order-detail-grid article > strong,
.order-detail-grid article > small {
  display: block;
}

.order-detail-grid article > span,
.order-detail-grid article > small {
  color: var(--text-muted);
  font-size: 9px;
}

.order-detail-grid article > strong,
.order-detail-grid .profile-name {
  margin-top: 4px;
  font-size: 11px;
}

.order-source {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 13px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--blue-50);
}

.order-source strong,
.order-source small {
  display: block;
}

.order-source small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

.order-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  padding: 0 0 17px;
}

.order-timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: -1px;
  left: 5px;
  width: 2px;
  background: var(--blue-100);
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--blue-600);
  box-shadow: 0 0 0 2px var(--blue-100);
}

.order-timeline strong,
.order-timeline small {
  display: block;
}

.order-timeline small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.order-review-form {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #c5daf9;
  border-radius: var(--radius-md);
  background: var(--surface-blue);
  contain: layout;
}

.review-deadline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #c5daf9;
  border-radius: 13px;
  background: var(--white);
  color: var(--blue-700);
}

.review-deadline > .icon {
  width: 21px;
  height: 21px;
}

.review-deadline > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.review-deadline small {
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.45;
}

.review-deadline strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.review-edit-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #c5daf9;
  border-radius: var(--radius-md);
  background: var(--surface-blue);
}

.review-edit-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.review-edit-heading .state-icon {
  flex: 0 0 auto;
  background: var(--white);
  color: var(--blue-700);
}

.review-edit-heading h3,
.review-edit-heading p {
  margin: 0;
}

.review-edit-heading p {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

[data-review-window].is-expired {
  border-color: var(--line-strong);
  background: #f7f9fc;
}

[data-review-window].is-expired .review-deadline {
  border-color: var(--line-strong);
  color: var(--text-muted);
}

.rating-choice {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.rating-choice legend {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 5px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.rating-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  opacity: 0;
}

.rating-choice label {
  display: block;
  min-width: 0;
  cursor: pointer;
}

.rating-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--white);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.rating-choice input[value="1"]:checked + span { border-color: #dc3f4f; background: #fff0f2; color: #b81f31; box-shadow: 0 0 0 1px #dc3f4f; }
.rating-choice input[value="2"]:checked + span { border-color: #f27922; background: #fff4e9; color: #bd4e00; box-shadow: 0 0 0 1px #f27922; }
.rating-choice input[value="3"]:checked + span { border-color: #e5aa16; background: #fff9dd; color: #946600; box-shadow: 0 0 0 1px #e5aa16; }
.rating-choice input[value="4"]:checked + span { border-color: #7bad22; background: #f5fbe8; color: #4e7b00; box-shadow: 0 0 0 1px #7bad22; }
.rating-choice input[value="5"]:checked + span { border-color: #1d9b59; background: #ebfaf1; color: #117340; box-shadow: 0 0 0 1px #1d9b59; }

.rating-choice input:checked + span .icon {
  fill: currentColor;
}

.rating-choice input:focus-visible + span {
  outline: 3px solid rgba(22, 119, 255, .22);
  outline-offset: 2px;
}

.order-review-card small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
}

.order-number-link {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.order-number-link:hover {
  background: var(--blue-100);
  color: var(--blue-700);
}

.order-media-section {
  display: grid;
  gap: 12px;
}

.order-media-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-media-heading h3,
.order-media-heading p {
  margin-bottom: 0;
}

.order-media-heading p,
.order-media-hint {
  color: var(--text-muted);
  font-size: 10px;
}

.order-media-upload {
  position: relative;
  flex: 0 1 auto;
  min-height: 38px;
  padding: 0 12px;
  overflow: hidden;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.order-media-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}

.order-media-upload.is-uploading {
  pointer-events: none;
  opacity: .62;
}

.order-media-list {
  display: grid;
  gap: 8px;
}

.order-media-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--blue-50);
}

.order-media-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--white);
  color: var(--blue-700);
}

.order-media-copy {
  min-width: 0;
}

.order-media-copy strong,
.order-media-copy small {
  display: block;
  max-width: 100%;
}

.order-media-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: clip;
  white-space: nowrap;
}

.order-media-copy small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 8px;
  overflow-wrap: break-word;
}

.review-empty-copy {
  color: var(--text-muted) !important;
  font-style: italic;
}

.rating-card-title {
  display: flex !important;
  align-items: center;
  gap: 6px;
  color: var(--navy-900) !important;
  font-weight: 850;
}

.rating-card-title .icon,
.profile-review-tab .icon,
.review-score .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: #ffb629;
  stroke: #ffb629;
}

.profile-review-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.profile-review-tab {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--white);
  color: var(--text-soft);
  font-weight: 800;
  text-align: left;
}

.profile-review-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.profile-review-tab strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 11px;
}

.profile-review-tab.is-active {
  border-color: var(--blue-600);
  background: var(--surface-blue);
  color: var(--blue-700);
}

.profile-review-card .review-author,
.profile-review-card .review-author small {
  display: block;
}

.profile-review-card .review-author {
  min-width: 0;
}

.profile-review-card .review-author small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.review-score {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--navy-900);
  white-space: nowrap;
}

.profile-review-card footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  color: var(--text-muted);
  font-size: 9px;
}

.conversation-user small.is-online {
  color: var(--success);
  font-weight: 800;
}

.conversation-user small.is-online::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--success);
}

/* Long prose wraps normally; compact UI labels stay in place and are fitted by app.js. */
.page-shell *,
.modal-card *,
.drawer *,
.sidebar *,
.topbar *,
.mobile-nav * {
  min-width: 0;
}

:where(h1, h2, h3, h4, p, small, strong, span, button, label, legend, time, a, li) {
  overflow-wrap: break-word;
  word-break: normal;
}

.clamp-2,
.clamp-3 {
  display: block;
  overflow: visible;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

.button,
.text-link,
.desktop-shortcuts button,
.compact-control,
.profile-trigger,
.sidebar-link,
.mobile-link,
.category-button,
.admin-tab,
.mini-tag,
.status-pill,
.source-pill,
.category-pill,
.rating,
.profile-name {
  height: auto;
  white-space: nowrap;
}

.button,
.desktop-shortcuts button,
.compact-control,
.profile-trigger,
.sidebar-link span,
.mobile-link span,
.category-button,
.admin-tab,
.mini-tag,
.status-pill,
.source-pill,
.category-pill,
.rating,
.profile-name,
.sidebar-account-copy strong,
.sidebar-account-copy small,
.person-copy strong,
.person-copy small,
.admin-user strong,
.admin-user small,
.chat-row-copy strong,
.ticket-title,
.panel-header > span,
.balance-chip span,
.admin-balance,
.transaction-amount,
.price,
.chat-row time,
.admin-chat-row time {
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.chat-row,
.ticket-card,
.admin-chat-row {
  align-items: center;
}

.balance-chip {
  min-width: 0;
  max-width: min(42vw, 240px);
}

.money-size-micro {
  font-size: clamp(.56rem, 1.35vw, .86rem) !important;
  letter-spacing: -.055em;
}

@media (max-width: 900px) {
  .translator-workspace {
    grid-template-columns: 1fr;
  }

  .translator-editor,
  .translator-result {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .translator-teaser {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .translator-teaser .text-link {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .translator-language-row {
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  }

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

  .order-media-heading {
    display: grid;
  }

  .order-media-upload {
    width: 100%;
  }

  .order-media-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .order-media-card > .file-card-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .toast-region {
    right: max(10px, var(--safe-right));
    bottom: max(84px, var(--safe-bottom));
    width: min(430px, calc(100vw - 20px));
  }
}

@media (max-width: 420px) {
  .translator-language-row {
    grid-template-columns: 1fr;
  }

  .translator-swap {
    justify-self: center;
    transform: rotate(90deg);
  }

  .translator-input-field textarea {
    min-height: 240px;
  }
}

/* Readable responsive labels and persistent service portfolio media. */
.fit-text-wrap {
  overflow: visible !important;
  white-space: normal !important;
  line-height: 1.2;
}

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

.modal.is-compact .modal-card {
  width: min(580px, 100%);
}

.modal.is-compact .modal-header {
  min-height: 64px;
  padding: 14px 18px;
}

.modal.is-compact .modal-content {
  padding: 20px 22px 22px;
}

.service-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(310px, .72fr);
  gap: 20px;
  align-items: start;
}

.service-create-fields {
  display: grid;
  gap: 17px;
}

.service-create-fields textarea {
  min-height: 230px;
}

.service-media-picker {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  background: var(--blue-50);
}

.service-media-picker header > span,
.service-media-picker header > small {
  display: block;
}

.service-media-picker header strong {
  color: var(--navy-950);
  font-size: 14px;
}

.service-media-picker header em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.service-media-picker header small {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

.service-media-drop {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 130px;
  padding: 20px 15px;
  border: 2px dashed #9bc2ff;
  border-radius: 17px;
  background: var(--white);
  color: var(--navy-900);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s var(--ease);
}

.service-media-drop:hover {
  border-color: var(--blue-600);
  background: #fbfdff;
  transform: translateY(-1px);
}

.service-media-drop:has(input:disabled) {
  opacity: .58;
  pointer-events: none;
}

.service-media-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.service-media-drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.service-media-drop-icon .icon {
  width: 21px;
  height: 21px;
}

.service-media-drop strong {
  font-size: 13px;
}

.service-media-drop small {
  max-width: 260px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.service-media-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.service-media-counters span {
  display: block;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.service-media-counters span.is-full {
  border-color: #9ec2ff;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.service-media-draft-list {
  display: grid;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.service-media-empty {
  margin: 0;
  padding: 10px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.service-media-draft-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}

.service-media-draft-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 42px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-blue);
  color: var(--blue-700);
}

.service-media-draft-preview img,
.service-media-draft-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-media-draft-icon .icon {
  width: 20px;
  height: 20px;
}

.service-media-draft-copy {
  min-width: 0;
}

.service-media-draft-copy strong,
.service-media-draft-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.service-media-draft-copy strong {
  color: var(--navy-950);
  font-size: 11px;
  line-height: 1.3;
}

.service-media-draft-copy small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.service-media-remove {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.market-card {
  container-type: inline-size;
}

.service-media-cover {
  position: relative;
  display: grid;
  place-items: center;
  height: 138px;
  margin: -20px -20px 17px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #eff6ff, #f9fbff);
}

.service-media-cover img,
.service-media-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-media-cover.is-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(3, 22, 51, .2));
}

.service-media-play {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--blue-700);
  box-shadow: var(--shadow-sm);
}

.service-media-play .icon {
  width: 19px;
  height: 19px;
}

.service-media-document {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--blue-700);
}

.service-media-document .icon {
  width: 34px;
  height: 34px;
}

.service-media-count {
  position: absolute;
  right: 10px;
  bottom: 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(3, 22, 51, .78);
  color: var(--white);
  font-size: 10px;
  font-weight: 900;
  backdrop-filter: blur(6px);
}

.service-media-count .icon {
  width: 13px;
  height: 13px;
}

.market-card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.market-card-footer .card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.market-card .person-copy {
  display: grid;
  gap: 3px;
  overflow: visible;
}

.detail-person .person-copy {
  overflow: visible;
}

.market-card .profile-name,
.detail-person .profile-name {
  display: block;
  max-width: 100%;
  overflow: visible;
  color: var(--navy-950);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: break-word;
}

.person-rating {
  display: block;
  min-width: 0;
}

.person-rating .rating,
.market-card .rating {
  overflow: visible;
  font-size: 11px;
  text-overflow: clip;
  white-space: nowrap;
}

@container (max-width: 340px) {
  .market-card-footer {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .market-card-footer .card-actions {
    justify-content: stretch;
  }

  .market-card-footer .card-actions .button {
    flex: 1 1 110px;
  }
}

.service-media-section > p {
  color: var(--text-muted);
  font-size: 12px;
}

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

.service-media-gallery-item {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--text);
  text-decoration: none;
}

.service-media-gallery-item img,
.service-media-gallery-item video {
  width: 100%;
  height: 135px;
  background: var(--navy-950);
  object-fit: cover;
}

.service-media-gallery-item > span {
  min-width: 0;
  padding: 9px 10px 10px;
}

.service-media-gallery-item strong,
.service-media-gallery-item small {
  display: block;
  overflow-wrap: anywhere;
}

.service-media-gallery-item strong {
  color: var(--navy-950);
  font-size: 11px;
  line-height: 1.35;
}

.service-media-gallery-item small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.service-media-gallery-item.is-pdf {
  grid-column: 1 / -1;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  padding: 10px;
  color: var(--blue-700);
}

.service-media-gallery-item.is-pdf > .icon:first-child {
  width: 28px;
  height: 28px;
}

.service-media-gallery-item.is-pdf > span {
  padding: 0;
}

@media (max-width: 820px) {
  .service-create-layout {
    grid-template-columns: 1fr;
  }

  .service-create-fields textarea {
    min-height: 190px;
  }

  .service-media-draft-list {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .service-media-counters,
  .service-media-gallery {
    grid-template-columns: 1fr;
  }

  .service-media-counters span {
    white-space: normal;
  }

  .service-media-gallery-item.is-pdf {
    grid-column: auto;
  }
}

/* Meaningful secondary text stays readable on compact screens. */
.chat-row time,
.message time,
.file-limits-hint,
.file-message small,
.admin-stat small,
.support-message time,
.message-tools,
.admin-balance-grid span,
.admin-detail-row small,
.admin-chat-row small,
.admin-chat-row time,
.order-detail-grid article > span,
.order-detail-grid article > small,
.order-source small,
.order-timeline small,
.order-review-card small,
.order-media-copy small,
.profile-review-card .review-author small,
.review-card-meta,
.service-media-draft-copy small,
.service-media-gallery-item small {
  font-size: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

.profile-review-controls .profile-review-tabs {
  margin-bottom: 0;
}

.profile-review-rating {
  min-width: 170px;
  border-color: var(--line-strong);
}

.profile-review-rating .icon {
  flex: 0 0 auto;
  fill: #ffb629;
  stroke: #ffb629;
}

.profile-review-rating select {
  width: 100%;
  min-width: 0;
}

.delivery-submit-form .modal-intro {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.delivery-file-field input[type="file"] {
  height: auto;
  min-height: 58px;
  padding: 11px;
  border: 1px dashed #8dbaff;
  background: var(--blue-50);
}

.delivery-file-field input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: 10px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: var(--blue-700);
  color: var(--white);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.delivery-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.delivery-choice::before,
.delivery-choice::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.delivery-requirement {
  margin: 0;
}

.order-delivery-section {
  display: grid;
  gap: 12px;
  border-color: #a7d1b4;
  background: #f5fff7;
}

.order-delivery-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.order-delivery-heading .state-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  background: #dff7e6;
  color: #168343;
}

.order-delivery-heading h3,
.order-delivery-heading p,
.delivery-result-note p {
  margin: 0;
}

.order-delivery-heading p {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.45;
}

.delivery-result-card,
.delivery-drive-link {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #cce6d3;
  border-radius: 13px;
  background: var(--white);
}

.delivery-result-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--blue-50);
  color: var(--blue-700);
}

.delivery-result-card > span:nth-child(2),
.delivery-drive-link > span {
  min-width: 0;
}

.delivery-result-card strong,
.delivery-result-card small,
.delivery-drive-link strong,
.delivery-drive-link small {
  display: block;
  overflow-wrap: anywhere;
}

.delivery-result-card small,
.delivery-drive-link small,
.delivery-submitted-at {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.delivery-drive-link {
  color: var(--blue-700);
  text-decoration: none;
}

.delivery-drive-link > .icon:first-child {
  width: 23px;
  height: 23px;
  margin: auto;
}

.delivery-result-note {
  padding: 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .75);
}

.delivery-result-note p {
  margin-top: 5px;
  color: var(--text-soft);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .profile-review-controls {
    grid-template-columns: 1fr;
  }

  .profile-review-rating {
    width: 100%;
  }

  .delivery-result-card,
  .delivery-drive-link {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .delivery-result-card > .file-card-actions,
  .delivery-drive-link > .icon:last-child {
    grid-column: 1 / -1;
    width: 100%;
  }

  .file-card-actions .button {
    flex: 1 1 130px;
  }

  .file-preview-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-preview-stage {
    min-height: 190px;
  }

  .file-preview-stage.is-pdf,
  .file-preview-stage iframe {
    min-height: 60dvh;
    height: 60dvh;
  }

  .file-preview-stage.is-audio {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .file-preview-unavailable {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .file-preview-actions .button {
    flex: 1 1 130px;
  }
}

/* Consistent breathing room for every text-bearing action. */
.button {
  min-height: 48px;
  padding: 11px 20px;
}

.button-small {
  min-height: 40px;
  padding: 9px 15px;
}

.button-quiet {
  padding-inline: 15px;
}

.button-row,
.header-actions,
.modal-actions,
.card-actions,
.admin-card-actions,
.admin-management-actions,
.file-card-actions {
  gap: 12px;
}

.cookie-banner {
  position: fixed;
  z-index: 9000;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  max-width: 760px;
  margin-left: auto;
  padding: 14px;
  border: 1px solid #d8c6f3;
  border-radius: 17px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 48px rgba(25, 16, 48, .2);
}

.cookie-banner-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f2ecff;
  color: #7652bc;
}

.cookie-banner p { margin: 0; color: var(--navy-900); font-size: 13px; }
.cookie-banner-actions { display: flex; align-items: center; gap: 12px; }

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

.portfolio-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.portfolio-card.is-draft { border-style: dashed; }
.portfolio-cover { display: block; width: 100%; height: 190px; padding: 0; overflow: hidden; border: 0; background: #edf2fb; }
.portfolio-cover img, .portfolio-cover video { width: 100%; height: 100%; object-fit: cover; }
.portfolio-cover-empty { display: grid; place-items: center; gap: 8px; width: 100%; height: 100%; padding: 18px; color: #7652bc; }
.portfolio-cover-empty .icon { width: 36px; height: 36px; }
.portfolio-cover-empty small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.portfolio-file-type { position: absolute; }
.portfolio-card-body { display: grid; gap: 10px; padding: 17px; }
.portfolio-card-body h3, .portfolio-card-body p { margin: 0; }
.portfolio-card-body footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.portfolio-card-controls, .portfolio-skills, .portfolio-media-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.portfolio-empty { display: flex; align-items: center; gap: 16px; padding: 24px; }
.portfolio-empty > span { color: #7652bc; }
.portfolio-empty > span .icon { width: 34px; height: 34px; }
.portfolio-empty div { flex: 1; }
.portfolio-empty h3, .portfolio-empty p { margin: 0; }

.portfolio-detail { display: grid; gap: 16px; }
.portfolio-description { margin: 0; white-space: pre-wrap; }
.portfolio-fact { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.portfolio-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.portfolio-media-item { display: grid; gap: 7px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.portfolio-media-item > button:first-child { display: grid; gap: 7px; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.portfolio-media-item img, .portfolio-media-item > button > span:first-child { display: grid; place-items: center; width: 100%; height: 118px; border-radius: 10px; object-fit: cover; background: var(--canvas); }
.portfolio-media-item strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.success-score-card { width: 100%; border: 1px solid #d8c6f3; color: inherit; text-align: left; cursor: pointer; }
.profile-ratings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.success-score-card:hover { background: #fbf9ff; border-color: #bca1e7; }
.success-score-hero { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 16px; background: #f4effd; }
.success-score-hero > strong { font-size: 2.6rem; color: #6f4db3; }
.success-score-hero span { display: grid; }
.success-components { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.success-components article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; }
.success-components article span { display: grid; }
.level-criteria { display: grid; gap: 10px; }
.level-criteria article { padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.level-criteria p { margin: 4px 0 0; }

.review-moderation { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.profile-review-card.is-moderated { opacity: .72; border-style: dashed; }
.admin-primary-protected { display: inline-flex; width: auto; margin: 0; }

@media (max-width: 900px) {
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .cookie-banner { grid-template-columns: 36px 1fr; }
  .cookie-banner-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .portfolio-grid, .portfolio-media-grid, .success-components { grid-template-columns: 1fr; }
  .portfolio-cover { height: 210px; }
  .portfolio-fact { grid-template-columns: 1fr; gap: 3px; }
  .portfolio-empty { align-items: flex-start; flex-wrap: wrap; }
  .profile-ratings { grid-template-columns: 1fr; }
}

/* Connected order finances, revisions, refunds and post-completion tips. */
.commission-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.commission-preview > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--white);
}

.commission-preview small,
.detail-helper,
.offer-net {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

.commission-preview strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--navy-900);
  font-size: 13px;
}

.commission-preview .is-net {
  border: 1px solid #bfe3cd;
  background: #f2fff7;
}

.commission-preview .is-net strong {
  color: var(--success);
}

.financial-detail,
.revision-section,
.refund-section,
.tip-section {
  display: grid;
  gap: 12px;
}

.revision-heading,
.tip-section {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.revision-heading .state-icon {
  flex: 0 0 auto;
  background: #edf3ff;
  color: var(--blue-700);
}

.revision-heading h3,
.revision-heading p,
.tip-section h3,
.tip-section p {
  margin: 0;
}

.revision-heading p,
.tip-section p {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

.revision-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.revision-metrics > span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  text-align: center;
}

.revision-metrics small {
  color: var(--text-muted);
  font-size: 9px;
}

.revision-metrics strong {
  font-size: 15px;
}

.revision-offer-list {
  display: grid;
  gap: 8px;
}

.revision-offer-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #cdddf7;
  border-radius: 12px;
  background: #f8fbff;
}

.revision-offer-card > span:nth-child(2),
.revision-offer-card strong,
.revision-offer-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.revision-offer-card small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

.revision-offer-card .button-row {
  grid-column: 2 / -1;
}

.revision-offer-icon,
.tip-icon,
.tip-modal-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--blue-50);
  color: var(--blue-700);
}

.refund-section {
  border-color: #f0d7a7;
  background: #fffbf3;
}

.refund-status-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #ead6b1;
  border-radius: 13px;
  background: var(--white);
}

.refund-status-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notice.is-warning {
  border-color: #f0d7a7;
  background: #fff8e9;
  color: #805b11;
}

.tip-section {
  grid-template-columns: auto minmax(0, 1fr);
  border-color: #cdb9ef;
  background: #fbf8ff;
}

.tip-icon,
.tip-modal-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #efe7ff;
  color: #7152aa;
}

.tip-icon .icon,
.tip-modal-icon .icon {
  width: 27px;
  height: 27px;
}

.tip-modal-icon {
  margin-inline: auto;
}

.tip-section.is-sent {
  border-color: #bfe3cd;
  background: #f2fff7;
}

/* TaskLink controls: native select data stays in the form, while the visible menu is fully branded. */
.native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.custom-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  line-height: 1.35;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.custom-select-trigger:hover {
  border-color: #aac1df;
}

.custom-select-trigger:focus-visible,
.custom-select.is-open .custom-select-trigger {
  border-color: var(--blue-500);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .12);
}

.custom-select-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-note {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
}

.custom-select-trigger > .icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  transition: transform .18s ease;
}

.custom-select.is-open .custom-select-trigger > .icon {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 280;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  width: max(100%, 170px);
  max-height: min(260px, 42vh);
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #8fa1b8 transparent;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  box-shadow: 0 18px 48px rgba(8, 31, 67, .18);
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-menu.is-floating {
  position: fixed;
  z-index: 2147483000;
  inset: auto;
  isolation: isolate;
}

.custom-select-menu::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-select-menu::-webkit-scrollbar-track {
  background: transparent;
}

.custom-select-menu::-webkit-scrollbar-thumb {
  border: 2px solid var(--white);
  border-radius: 999px;
  background: #8fa1b8;
}

.custom-select-menu::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.custom-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  text-align: left;
}

.custom-select-option > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  outline: 0;
  background: var(--blue-50);
  color: var(--blue-700);
}

.custom-select-option.is-selected {
  background: var(--surface-blue);
  color: var(--blue-700);
}

.custom-select-option small {
  grid-column: 1;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
}

.custom-select-option > .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 15px;
  height: 15px;
}

.compact-control .custom-select {
  width: 52px;
}

.compact-control .custom-select-trigger {
  min-height: 40px;
  padding: 0 3px 0 5px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 850;
}

.compact-control .custom-select-menu {
  right: -8px;
  left: auto;
  width: 174px;
}

.profile-review-rating .custom-select {
  width: 100%;
}

.profile-review-rating .custom-select-trigger {
  width: 100%;
}

/* TaskLink calendar: a localized date control with the same compact footprint on desktop and mobile. */
.tasklink-date {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.tasklink-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font: inherit;
  line-height: 1.35;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.tasklink-date-trigger:hover {
  border-color: #aac1df;
}

.tasklink-date-trigger:focus-visible,
.tasklink-date.is-open .tasklink-date-trigger {
  border-color: var(--blue-500);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .12);
}

.tasklink-date.is-invalid .tasklink-date-trigger {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 53, 69, .1);
}

.tasklink-date-trigger.is-placeholder .tasklink-date-value {
  color: #93a2b7;
}

.tasklink-date-trigger > .icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--blue-700);
}

.tasklink-date-picker {
  position: absolute;
  z-index: 280;
  top: calc(100% + 6px);
  left: 0;
  width: min(326px, calc(100vw - 16px));
  padding: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 20px 56px rgba(8, 31, 67, .2);
  color: var(--navy-900);
}

.tasklink-date-picker[hidden] {
  display: none;
}

.tasklink-date-picker.is-floating {
  position: fixed;
  z-index: 2147483000;
  inset: auto;
  isolation: isolate;
}

.tasklink-calendar-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-bottom: 4px;
}

.tasklink-calendar-header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--navy-900);
}

.tasklink-calendar-header button:hover,
.tasklink-calendar-header button:focus-visible {
  outline: 0;
  background: var(--blue-50);
  color: var(--blue-700);
}

.tasklink-calendar-header .icon {
  width: 18px;
  height: 18px;
}

.tasklink-calendar-header .tasklink-calendar-title {
  gap: 5px;
  padding-inline: 8px;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.tasklink-calendar-title .icon {
  width: 13px;
  height: 13px;
}

.tasklink-calendar-weekdays,
.tasklink-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
}

.tasklink-calendar-weekdays {
  min-height: 34px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.tasklink-calendar-days button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 700;
}

.tasklink-calendar-days button:hover:not(:disabled),
.tasklink-calendar-days button:focus-visible {
  border-color: #bcd5ff;
  outline: 0;
  background: var(--blue-50);
  color: var(--blue-700);
}

.tasklink-calendar-days button.is-outside {
  color: #94a0b0;
  font-weight: 600;
}

.tasklink-calendar-days button.is-today:not(.is-selected)::after {
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue-600);
  content: "";
}

.tasklink-calendar-days button.is-selected {
  border-color: var(--blue-700);
  background: var(--blue-700);
  box-shadow: 0 4px 12px rgba(18, 88, 210, .24);
  color: var(--white);
}

.tasklink-calendar-days button:disabled,
.tasklink-calendar-months button:disabled,
.tasklink-calendar-footer button:disabled {
  cursor: not-allowed;
  opacity: .34;
}

.tasklink-calendar-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-height: 260px;
  padding: 8px 2px;
}

.tasklink-calendar-months button {
  min-width: 0;
  min-height: 48px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 750;
}

.tasklink-calendar-months button:hover:not(:disabled),
.tasklink-calendar-months button:focus-visible,
.tasklink-calendar-months button.is-current {
  border-color: #bcd5ff;
  outline: 0;
  background: var(--blue-50);
  color: var(--blue-700);
}

.tasklink-calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-top: 7px;
  padding: 7px 4px 0;
  border-top: 1px solid var(--line);
}

.tasklink-calendar-footer button {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 800;
}

.tasklink-calendar-footer button:hover:not(:disabled),
.tasklink-calendar-footer button:focus-visible {
  outline: 0;
  background: var(--blue-50);
}

/* Visual message formatting is stored as ranges, never as visible Markdown markers. */
.message-editor {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 13px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--white);
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-editor:empty::before,
.message-editor.is-logically-empty::before {
  content: attr(data-placeholder);
  color: #93a2b7;
  pointer-events: none;
}

.message-editor:hover {
  border-color: #aac1df;
}

.message-editor:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .12);
}

.message-format-toolbar button.is-active {
  border-color: var(--blue-500);
  background: var(--blue-700);
  color: var(--white);
}

.message-payload {
  display: none !important;
}

.message-text {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Public ratings use a consistent trust scale; review input colors are intentionally separate. */
.rating-tone-5,
.rating-tone-5 .icon {
  color: #b77900;
  fill: #ffb629;
  stroke: #ffb629;
}

.rating-tone-mid,
.rating-tone-mid .icon {
  color: #b84d00;
  fill: #f27922;
  stroke: #f27922;
}

.rating-tone-low,
.rating-tone-low .icon {
  color: #b81f31;
  fill: #dc3f4f;
  stroke: #dc3f4f;
}

.rating-tone-empty,
.rating-tone-empty .icon {
  color: var(--text-muted);
  fill: #b8c3d1;
  stroke: #b8c3d1;
}

.rating-card.rating-tone-5,
.rating-card.rating-tone-mid,
.rating-card.rating-tone-low,
.rating-card.rating-tone-empty {
  border-color: var(--line);
  color: var(--text);
}

.review-score.rating-tone-5,
.review-score.rating-tone-mid,
.review-score.rating-tone-low {
  color: inherit;
}

/* Listings stay in the owner's profile and can be published/unpublished without deletion. */
.listing-active-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.listing-active-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.listing-active-track {
  position: relative;
  width: 29px;
  height: 17px;
  border-radius: 999px;
  background: #b8c3d1;
  transition: background .18s ease;
}

.listing-active-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(8, 31, 67, .2);
  transition: transform .18s ease;
}

.listing-active-control input:checked + .listing-active-track {
  background: var(--success);
}

.listing-active-control input:checked + .listing-active-track::after {
  transform: translateX(12px);
}

.listing-active-control input:focus-visible + .listing-active-track {
  outline: 3px solid rgba(22, 119, 255, .38);
  outline-offset: 2px;
}

.listing-active-control.is-locked {
  opacity: .7;
}

.market-card.is-inactive {
  border-style: dashed;
  background: #fbfcfe;
}

.listing-state-pill {
  margin-left: auto;
}

/* Highlighted order sections are complete cards, never top/bottom-only strips. */
.detail-section.order-delivery-section,
.detail-section.financial-detail,
.detail-section.revision-section,
.detail-section.refund-section,
.detail-section.tip-section {
  margin-block: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.detail-section.order-delivery-section {
  border-color: #a7d1b4;
}

.detail-section.refund-section {
  border-color: #f0d7a7;
  background: #fffbf3;
}

.detail-section.tip-section {
  border-color: #cdb9ef;
}

.detail-section.tip-section.is-sent {
  border-color: #bfe3cd;
}

.trusted-link-input-wrap {
  position: relative;
  display: block;
}

.trusted-link-field input {
  padding-right: 44px;
}

.trusted-link-status {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.trusted-link-status .icon {
  width: 15px;
  height: 15px;
}

.trusted-link-field.is-valid input {
  border-color: var(--success);
}

.trusted-link-field.is-valid .trusted-link-status {
  background: #e8f8ef;
  color: var(--success);
}

.trusted-link-field.is-invalid input {
  border-color: var(--danger);
}

.trusted-link-field.is-invalid .trusted-link-status {
  background: var(--danger-soft);
  color: var(--danger);
}

.trusted-link-message {
  font-size: 10px;
}

.trusted-link-message.is-valid { color: var(--success); }
.trusted-link-message.is-invalid { color: var(--danger); }

.offer-balance-warning {
  margin: 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 750;
}

.offer-balance-warning.is-ok {
  color: var(--text-soft);
  font-weight: 700;
}

.tip-financials {
  margin-top: 4px;
}

.order-workflow-actions .button-row,
.revision-actions {
  align-items: stretch;
}

.order-workflow-actions .button,
.revision-actions .button {
  flex: 1 1 180px;
}

@media (max-width: 700px) {
  .commission-preview {
    grid-template-columns: 1fr;
  }

  .revision-offer-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .revision-offer-card > strong,
  .revision-offer-card .button-row {
    grid-column: 2;
  }
}
.success-mini {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #d9e3ff;
  border-radius: 999px;
  background: #f4f7ff;
  color: #3157b7;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}


/* v18 targeted polish: legal library, XP, certificates and consistent action spacing. */
.button-row,
.header-actions,
.modal-actions,
.card-actions,
.admin-card-actions,
.admin-management-actions,
.file-card-actions,
.portfolio-card-controls,
.portfolio-media-actions,
.review-moderation,
.translator-actions,
.certificate-actions {
  column-gap: 12px;
  row-gap: 10px;
}

.modal-actions,
.admin-card-actions,
.certificate-actions {
  align-items: center;
}

.custom-select-option-main {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.language-flag {
  display: block;
  width: 28px;
  height: 19px;
  flex: 0 0 28px;
  border: 1px solid rgba(13, 37, 79, .10);
  border-radius: 4px;
  object-fit: cover;
}

.legal-library {
  display: grid;
  gap: 14px;
}

.legal-library-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 102px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  color: var(--navy-950);
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.legal-library-item:hover,
.legal-library-item:focus-visible {
  transform: translateY(-1px);
  border-color: #bcd2ff;
  box-shadow: 0 10px 28px rgba(40, 79, 160, .08);
}

.legal-library-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #f2f6ff;
  color: var(--blue-600);
}

.legal-library-icon .icon {
  width: 28px;
  height: 28px;
}

.legal-cookie-icon {
  font-size: 29px;
  line-height: 1;
}

.legal-library-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.legal-library-copy small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.legal-library-copy strong {
  overflow-wrap: anywhere;
  font-size: clamp(16px, 2.2vw, 21px);
  line-height: 1.2;
}

.legal-library-arrow {
  display: grid;
  place-items: center;
  color: var(--navy-800);
}

.legal-library-arrow .icon {
  width: 22px;
  height: 22px;
}

.xp-summary-card > strong {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.xp-summary-card > strong small {
  font-size: 12px;
  color: var(--text-muted);
}

.xp-detail {
  display: grid;
  gap: 18px;
}

.xp-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border: 1px solid #d9e5ff;
  border-radius: 22px;
  background: linear-gradient(145deg, #f7faff, #eef4ff);
}

.xp-hero > span {
  display: grid;
  gap: 5px;
}

.xp-hero small,
.xp-hero em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 750;
}

.xp-hero strong {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1;
  letter-spacing: -.04em;
}

.xp-orbit {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  flex: 0 0 86px;
  border: 1px solid #bfd2ff;
  border-radius: 50%;
  background: var(--white);
  color: var(--blue-700);
  box-shadow: 0 12px 28px rgba(31, 91, 207, .12);
}

.xp-orbit .icon { width: 22px; height: 22px; }
.xp-orbit b { font-size: 21px; }

.xp-progress {
  display: grid;
  gap: 9px;
}

.xp-progress > span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.xp-progress > span small { color: var(--text-muted); }
.xp-progress > div {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9effb;
}
.xp-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue-600);
}

.xp-scale {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid #d9e5ff;
  border-radius: 16px;
  background: #f8fbff;
}
.xp-scale > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.xp-scale > span small { color: var(--text-muted); text-align: right; }
.xp-scale-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edfb;
}
.xp-scale-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #0b5fd7);
}
.xp-scale-ticks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  color: var(--text-muted);
}
.xp-scale-ticks small { text-align: center; font-size: 10px; }
.xp-scale-ticks small:first-child { text-align: left; }
.xp-scale-ticks small:last-child { text-align: right; }

.xp-explanation { margin: 0; color: var(--text-muted); line-height: 1.65; }
.xp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.xp-metrics article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}
.xp-metrics article > span { color: var(--blue-600); }
.xp-metrics article .icon { width: 20px; height: 20px; }
.xp-metrics article strong { font-size: 21px; }
.xp-metrics article small { color: var(--text-muted); line-height: 1.25; }

.xp-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.xp-levels article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}
.xp-levels article.is-current {
  border-color: #aac5ff;
  background: #f3f7ff;
}
.xp-levels article span { font-weight: 800; }
.xp-levels article strong { color: var(--blue-700); font-size: 13px; }

.certificate-list {
  display: grid;
  gap: 12px;
}

.certificate-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.certificate-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: #f2f6ff;
  color: var(--blue-600);
}
.certificate-icon .icon { width: 24px; height: 24px; }
.certificate-copy { display: grid; gap: 5px; min-width: 0; }
.certificate-copy h3,
.certificate-copy p { margin: 0; }
.certificate-copy p,
.certificate-copy small { color: var(--text-muted); }
.certificate-rejection { color: var(--danger) !important; }
.certificate-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.certificate-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
}
.certificate-empty > span { color: var(--blue-600); }
.certificate-empty > span .icon { width: 32px; height: 32px; }
.certificate-empty h3,
.certificate-empty p { margin: 0; }
.admin-certificate-review { margin-bottom: 18px; }

@media (max-width: 760px) {
  .legal-library-item {
    grid-template-columns: 52px minmax(0, 1fr) 22px;
    min-height: 88px;
    padding: 14px;
    gap: 13px;
  }
  .legal-library-icon { width: 52px; height: 52px; border-radius: 15px; }
  .xp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .certificate-card { grid-template-columns: 44px minmax(0, 1fr); }
  .certificate-icon { width: 44px; height: 44px; }
  .certificate-actions { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 520px) {
  .xp-hero { padding: 18px; }
  .xp-orbit { width: 68px; height: 68px; flex-basis: 68px; }
  .xp-levels { grid-template-columns: 1fr; }
  .xp-progress > span { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* v19 — native-logic validation bubble, continuous discovery rating and spacing polish. */
.validation-popover {
  position: fixed;
  z-index: 12000;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  max-width: calc(100vw - 24px);
  padding: 11px 16px 11px 12px;
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  background: rgba(255, 255, 255, .99);
  box-shadow: 0 18px 45px rgba(24, 47, 84, .18), 0 3px 10px rgba(24, 47, 84, .08);
  color: var(--navy-900);
  pointer-events: none;
}

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

.validation-popover-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.validation-popover-message {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.validation-popover-arrow {
  position: absolute;
  left: var(--validation-arrow-x, 28px);
  width: 12px;
  height: 12px;
  border: solid #cfe0ff;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

.validation-popover[data-placement="below"] .validation-popover-arrow {
  top: -7px;
  border-width: 1px 0 0 1px;
}

.validation-popover[data-placement="above"] .validation-popover-arrow {
  bottom: -7px;
  border-width: 0 1px 1px 0;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(10, 102, 237, .10);
}

.custom-select-trigger[aria-invalid="true"],
.tasklink-date-trigger[aria-invalid="true"] {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(10, 102, 237, .10);
}

.xp-summary-card {
  position: relative;
  overflow: hidden;
  padding-bottom: 18px;
}

.rating-card-progress {
  position: absolute;
  right: 14px;
  bottom: 8px;
  left: 14px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-50);
}

.rating-card-progress > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue-600);
}

.xp-metrics-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Keep action groups optically separated without changing page structure. */
.section-heading,
.market-card-footer,
.profile-header,
.support-thread-head,
.order-workflow-actions {
  gap: 14px;
}

.modal-actions {
  margin-top: 4px;
}

.legal-choice-list {
  gap: 12px;
}

.legal-choice {
  min-height: 68px;
  padding: 12px 14px;
}

@media (max-width: 760px) {
  .validation-popover {
    border-radius: 15px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    min-height: 58px;
    padding: 10px 13px 10px 10px;
  }

  .validation-popover-icon {
    width: 36px;
    height: 36px;
  }

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

  .button-row,
  .modal-actions,
  .header-actions,
  .card-actions,
  .admin-card-actions,
  .certificate-actions {
    row-gap: 10px;
    column-gap: 10px;
  }
}

/* v20 — consistent breathing room across cards, actions and rating metadata. */
.person-rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin-top: 5px;
}

.person-rating > .rating,
.person-rating > .success-mini {
  flex: 0 0 auto;
}

.detail-person .person-copy > small + .person-rating {
  margin-top: 7px;
}

.market-card-footer {
  column-gap: 16px;
  row-gap: 12px;
}

.button-row,
.header-actions,
.modal-actions,
.card-actions,
.conversation-actions,
.admin-card-actions,
.admin-management-actions,
.file-card-actions,
.file-preview-actions,
.portfolio-card-controls,
.portfolio-media-actions,
.review-moderation,
.translator-actions,
.certificate-actions,
.finance-actions,
.revision-actions,
.cookie-banner-actions {
  column-gap: 12px;
  row-gap: 10px;
}

.file-message-actions {
  gap: 8px;
}

.section-heading {
  column-gap: 22px;
  row-gap: 12px;
}

.profile-ratings {
  gap: 16px;
}

.rating-card {
  gap: 14px;
}

@media (max-width: 760px) {
  .person-rating { gap: 7px; }
  .market-card-footer { gap: 12px; }
  .section-heading { row-gap: 10px; }
}

/* v21 — stable translated controls, TaskLink validation, promotions and admin inboxes. */
.button {
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 46px;
  padding-block: 10px;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: normal;
  flex: 0 0 auto;
}
.button-small {
  min-height: 40px;
  padding-block: 8px;
  line-height: 1.2;
}
.button > .icon,
.button > svg,
.order-media-upload > .icon {
  flex: 0 0 auto;
}
.section-heading > .button,
.section-heading > a.button,
.header-actions > .button,
.card-actions > .button,
.certificate-actions > .button {
  width: fit-content;
  max-width: 100%;
}
.section-heading h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}
.section-optional {
  color: var(--text-muted);
  opacity: .68;
  font-size: .55em;
  font-weight: 700;
  letter-spacing: 0;
}
.order-media-upload {
  overflow: visible;
  white-space: normal;
  min-height: 42px;
  padding: 8px 14px;
}
.card-actions,
.admin-card-actions,
.certificate-actions,
.offer-decision-actions,
.promotion-duration-row,
.promotion-theme-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Site-owned visual for the browser Constraint Validation engine. */
.validation-popover {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  min-height: 82px;
  padding: 13px 18px 13px 16px;
  border: 1px solid #d6e4fb;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(31, 55, 89, .18), 0 3px 12px rgba(31, 55, 89, .06);
}
.validation-popover-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0f6df5;
  color: #fff;
  font-size: 27px;
  font-weight: 950;
  box-shadow: 0 6px 16px rgba(15, 109, 245, .18);
}
.validation-popover-message {
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
}
.validation-popover-arrow {
  width: 14px;
  height: 14px;
  background: #fff;
  border-color: #d6e4fb;
}

/* Paid listing promotion never disguises itself as organic ranking. */
.market-card {
  position: relative;
}
.market-card.is-promoted-premium {
  border-color: rgba(15, 109, 245, .42);
  box-shadow: 0 12px 32px rgba(15, 109, 245, .10);
}
.market-card.is-highlight-blue {
  background: linear-gradient(0deg, rgba(224, 241, 255, .72), rgba(224, 241, 255, .72)), #fff;
}
.market-card.is-highlight-coral {
  background: linear-gradient(0deg, rgba(255, 232, 224, .72), rgba(255, 232, 224, .72)), #fff;
}
.market-card.is-highlight-gold,
.market-card.is-highlight-sand {
  border-color: rgba(205, 151, 18, .42);
  background: linear-gradient(0deg, rgba(255, 230, 145, .58), rgba(255, 230, 145, .58)), #fff;
  box-shadow: 0 12px 30px rgba(175, 122, 0, .08);
}
.market-card.is-highlight-mint {
  border-color: rgba(16, 151, 126, .34);
  background: linear-gradient(0deg, rgba(210, 248, 238, .72), rgba(210, 248, 238, .72)), #fff;
  box-shadow: 0 12px 30px rgba(11, 130, 109, .07);
}
.promotion-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}
.promotion-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.promotion-pill .icon { width: 13px; height: 13px; }
.promotion-pill.is-premium { color: #0758c9; background: #e4f0ff; }
.promotion-pill.is-bump { color: #935116; background: #fff0df; }
.promotion-pill.is-highlight { color: #126f61; background: #e3f8f2; }
.promotion-picker { display: grid; gap: 13px; }
.promotion-option {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.promotion-option h3,
.promotion-option p { margin: 0; }
.promotion-option p { margin-top: 4px; color: var(--text-muted); line-height: 1.45; }
.promotion-option-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--blue-50);
  color: var(--blue-700);
}
.promotion-duration-row,
.promotion-theme-row { margin-top: 10px; }
.promotion-theme {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(7, 38, 86, .12);
  border-radius: 10px;
  color: var(--navy-900);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.promotion-theme.is-blue { background: #dff1ff; }
.promotion-theme.is-coral { background: #ffe5dc; }
.promotion-theme.is-gold,
.promotion-theme.is-sand { background: #ffe59a; border-color: rgba(190, 132, 0, .28); }
.promotion-theme.is-mint { background: #d5f6ed; border-color: rgba(8, 143, 117, .24); }

.xp-breakdown {
  display: grid;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}
.xp-breakdown h3,
.xp-breakdown p { margin: 0; }
.xp-breakdown p { color: var(--text-muted); }
.xp-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.xp-breakdown-grid > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
}
.xp-breakdown-grid b { color: #0b67df; white-space: nowrap; }
.xp-breakdown-grid .is-negative b { color: #b64646; }
.xp-review-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.xp-review-rules span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid rgba(188, 139, 15, .12);
  border-radius: 10px;
  background: #fff5cf;
  font-size: 12px;
  font-weight: 700;
}
.xp-review-rules em {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--text-muted);
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.rank-formula {
  display: grid;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.rank-formula h3,
.rank-formula p { margin: 0; }
.rank-formula p { color: var(--text-muted); }
.rank-factor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.rank-factor-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8fbff;
  font-size: 12px;
}
.rank-factor-grid b { color: var(--blue-700); font-size: 15px; }

.notice.notice-success {
  border-color: #b9e5d1;
  background: #f1fbf6;
  color: #176b4a;
}

.admin-tab {
  position: relative;
  gap: 7px;
}
.admin-unread-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e33d47;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}
.admin-chooser { margin-top: 14px; }
.admin-certificate-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.admin-certificate-summary img {
  width: 64px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.certificate-proof {
  width: 76px;
  height: 58px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f7f9fc;
  cursor: pointer;
}
.certificate-proof img { width: 100%; height: 100%; object-fit: cover; display: block; }
.certificate-review-image {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--blue-700);
  font-weight: 800;
  text-decoration: none;
}
.certificate-review-image img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 10px;
  background: #f6f8fb;
}

@media (max-width: 720px) {
  .section-heading { align-items: flex-start; }
  .section-heading > .button,
  .section-heading > a.button { width: auto; max-width: min(100%, 230px); }
  .promotion-option { grid-template-columns: 42px minmax(0, 1fr); }
  .promotion-option > .button { grid-column: 1 / -1; width: 100%; }
  .xp-breakdown-grid { grid-template-columns: 1fr; }
  .rank-factor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xp-scale > span { align-items: flex-start; flex-direction: column; gap: 4px; }
  .xp-scale > span small { text-align: left; }
  .validation-popover { grid-template-columns: 42px minmax(0, 1fr); min-height: 76px; }
  .validation-popover-icon { width: 42px; height: 42px; }
}


/* v22 — validation top-layer fix and branded certificate file picker. */
.validation-popover {
  z-index: 2147483647;
}

/* Keep the TaskLink validation bubble in the same top layer as an open dialog. */
.modal > .validation-popover {
  position: fixed;
  z-index: 2147483647;
}

.certificate-photo-field {
  gap: 8px;
}

.tasklink-file-picker {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.tasklink-file-picker:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}

.tasklink-file-picker:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .12);
}

.tasklink-file-picker > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.tasklink-file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--blue-600);
  color: var(--white);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.tasklink-file-picker-button .icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.tasklink-file-picker-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasklink-file-picker-name.has-file {
  color: var(--navy-900);
}

@media (max-width: 520px) {
  .tasklink-file-picker {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .tasklink-file-picker-button {
    width: 100%;
  }

  .tasklink-file-picker-name {
    padding: 0 2px 2px;
  }
}


/* v23 — compact browser-like TaskLink validation bubble. */
.validation-popover {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px 8px 10px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(31, 55, 89, .15), 0 2px 8px rgba(31, 55, 89, .06);
}
.validation-popover-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 22px;
}
.validation-popover-message {
  font-size: 14px;
  line-height: 1.3;
}
.validation-popover-arrow {
  width: 10px;
  height: 10px;
}
.validation-popover[data-placement="below"] .validation-popover-arrow { top: -6px; }
.validation-popover[data-placement="above"] .validation-popover-arrow { bottom: -6px; }

@media (max-width: 720px) {
  .validation-popover {
    grid-template-columns: 32px minmax(0, 1fr);
    min-height: 50px;
    gap: 9px;
    padding: 7px 10px 7px 9px;
  }
  .validation-popover-icon { width: 32px; height: 32px; font-size: 20px; }
  .validation-popover-message { font-size: 13.5px; }
}

/* Admin operations center — v27 */
.admin-order-card {
  align-items: center;
}

.admin-order-reason,
.admin-evidence-inline {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.admin-activity-section,
.admin-user-detail > section,
.admin-order-evidence > section {
  min-width: 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-activity-grid,
.admin-mfa-grid,
.admin-order-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

/* v78: separate read-only/admin notices from the content they describe. */
.modal-content > .notice + .admin-mfa-grid,
.modal-content > .notice + .admin-chat-list,
.modal-content > .notice + .admin-message-feed,
.modal-content > .notice + .admin-activity-grid,
.modal-content > .notice + .admin-list {
  margin-top: 14px;
}

.admin-mfa-grid + .modal-actions {
  margin-top: 14px;
}

.admin-activity-grid article,
.admin-mfa-grid article,
.admin-order-summary > div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft, #f8fbff);
}

.admin-activity-grid span,
.admin-mfa-grid span,
.admin-order-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.admin-activity-grid strong,
.admin-mfa-grid strong,
.admin-order-summary strong {
  display: block;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-activity-feed,
.admin-note-list,
.admin-evidence-list,
.admin-evidence-messages,
.admin-evidence-files {
  display: grid;
  gap: 8px;
}

.admin-activity-row,
.admin-note,
.admin-evidence-list article,
.admin-evidence-messages article,
.admin-evidence-file {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
}

.admin-activity-row > span,
.admin-activity-row strong,
.admin-activity-row small {
  min-width: 0;
}

.admin-activity-row strong,
.admin-activity-row small {
  display: block;
}

.admin-activity-row small,
.admin-activity-row time,
.admin-note time,
.admin-evidence-messages time {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-activity-row time {
  flex: 0 0 auto;
  text-align: right;
}

.admin-note,
.admin-evidence-list article,
.admin-evidence-messages article {
  padding: 12px 13px;
}

.admin-note header,
.admin-evidence-list header,
.admin-evidence-messages header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.admin-note p,
.admin-evidence-list p,
.admin-evidence-messages p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-evidence-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-evidence-file > span:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  min-width: 0;
}

.admin-evidence-file strong,
.admin-evidence-file small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-evidence-file small {
  grid-column: 2;
  color: var(--text-muted);
}

.admin-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid rgba(214, 45, 63, .22);
  border-radius: 18px;
  background: rgba(214, 45, 63, .035);
}

.admin-danger-zone h3,
.admin-danger-zone p {
  margin: 0;
}

.admin-danger-zone p {
  margin-top: 5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.admin-order-evidence {
  display: grid;
  gap: 18px;
}

.admin-order-evidence h3 {
  margin: 0 0 9px;
}

.notice-danger {
  border-color: rgba(214, 45, 63, .22);
  background: rgba(214, 45, 63, .045);
}

.notice-warning {
  border-color: rgba(221, 144, 0, .25);
  background: rgba(255, 180, 0, .055);
}

@media (max-width: 900px) {
  .admin-activity-grid,
  .admin-mfa-grid,
  .admin-order-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .admin-activity-grid,
  .admin-mfa-grid,
  .admin-order-summary {
    grid-template-columns: 1fr;
  }
  .admin-danger-zone,
  .admin-activity-row,
  .admin-evidence-file {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .admin-detail-actions .button,
  .admin-danger-zone .button {
    width: 100%;
  }
  .admin-activity-row time {
    text-align: left;
  }
}

/* v28 — finance actions and withdrawal administration. */
.finance-actions .button {
  min-width: 168px;
  min-height: 46px;
  justify-content: center;
}

.admin-withdrawal-intro {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
}

.admin-withdrawal-intro .state-icon {
  flex: 0 0 auto;
}

.admin-withdrawal-intro h3,
.admin-withdrawal-intro p {
  margin: 0;
}

.admin-withdrawal-intro p {
  margin-top: 5px;
  color: var(--text-muted);
}

.admin-withdrawal-details {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  color: var(--text-muted);
}

.admin-withdrawal-details small {
  line-height: 1.45;
}

.admin-withdrawal-destination {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 560px) {
  .finance-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .finance-actions .button {
    min-width: 0;
    width: 100%;
  }
}


/* v32 — balanced marketplace rows and slightly roomier previews.
   Full listing text remains available in the View drawer; only cards are shortened.
   Grid items stretch to the tallest card in each row, matching the earlier layout. */
.market-grid {
  align-items: stretch;
}

.market-card .listing-card-title,
.market-card .listing-card-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.market-card .listing-card-title {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  line-height: 1.32;
}

.market-card .listing-card-description {
  -webkit-line-clamp: 4;
  line-clamp: 4;
  line-height: 1.48;
}

/* v31 — combined moderation actions */
.moderation-action-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.moderation-action-fieldset > legend {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.moderation-action-fieldset > small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

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

.moderation-action-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.moderation-action-choice > input {
  position: absolute;
  inset: 14px auto auto 14px;
  z-index: 1;
}

.moderation-action-copy {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  min-height: 82px;
  padding: 13px 13px 13px 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.moderation-action-copy > .icon {
  width: 20px;
  height: 20px;
  color: var(--blue-600);
}

.moderation-action-copy strong,
.moderation-action-copy small {
  display: block;
}

.moderation-action-copy strong {
  font-size: 12px;
  line-height: 1.35;
}

.moderation-action-copy small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.moderation-action-choice:hover .moderation-action-copy {
  border-color: var(--blue-100);
  background: var(--blue-50);
}

.moderation-action-choice > input:checked + .moderation-action-copy {
  border-color: var(--blue-500);
  background: var(--blue-50);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .08);
}

.moderation-action-choice.is-disabled {
  cursor: default;
}

.moderation-action-choice.is-disabled .moderation-action-copy {
  opacity: .55;
  background: var(--blue-50);
}

@media (max-width: 640px) {
  .moderation-action-grid {
    grid-template-columns: 1fr;
  }
}

/* v58.3 hybrid authentication */
.auth-card { align-self: center; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 2px 0; color: var(--muted, #667993); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line, #dfe7f1); }
.auth-switch { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 7px; color: var(--muted, #667993); font-size: 14px; }
.auth-switch .text-link { font-weight: 700; }
.telegram-login-button { gap: 9px; }
.telegram-login-button .telegram-brand-icon { color:#229ED9; fill:currentColor; stroke:none; }
.telegram-login-button .telegram-brand-icon .telegram-logo-path { fill:currentColor; stroke:none; }
.auth-provider-note { display: block; color: var(--muted, #667993); line-height: 1.45; margin-top: -6px; }
.compact-legal-list { gap: 8px; }
.compact-legal-list .legal-choice { padding-top: 10px; padding-bottom: 10px; }
.account-security-card { grid-column:1 / -1; display:block; padding:clamp(22px,3vw,30px); }
.account-security-card > h2 { margin:0 0 20px; }
.account-security-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,.72fr); gap:0; align-items:start; }
.account-security-pane { min-width:0; display:grid; align-content:start; gap:14px; }
.account-security-pane:first-child { padding-right:28px; }
.account-security-pane + .account-security-pane { border-left:1px solid var(--line); padding-left:28px; }
.account-security-pane h3 { margin:0; font-size:17px; }
.account-security-pane .status-pill { justify-self:start; }
.account-security-pane .stack { width:100%; }
.account-security-actions { display:grid; gap:10px; width:min(100%,300px); }
.account-security-actions .button { width:100%; justify-content:center; }
.account-security-card .notice { margin:0; }
@media (max-width: 780px) {
  .account-security-grid { grid-template-columns:1fr; gap:22px; }
  .account-security-pane:first-child { padding-right:0; }
  .account-security-pane + .account-security-pane { border-left:0; border-top:1px solid var(--line); padding-left:0; padding-top:22px; }
  .account-security-actions { width:100%; }
}

/* v58.4 two-factor authentication */
.mfa-setup-grid{display:grid;grid-template-columns:minmax(180px,220px) minmax(0,1fr);gap:22px;align-items:start;margin-top:18px}.mfa-qr{display:block;width:100%;max-width:220px;aspect-ratio:1/1;border:1px solid var(--line,#dbe4ef);border-radius:18px;background:#fff;padding:10px}.mfa-setup-copy{min-width:0}.copy-field{display:flex;gap:8px;align-items:center}.copy-field input{min-width:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.05em}.recovery-code-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:18px 0}.recovery-code-grid code{display:block;padding:12px 14px;border:1px solid var(--line,#dbe4ef);border-radius:12px;background:#f8fafc;text-align:center;font-weight:700;letter-spacing:.08em}.account-security-card hr{width:100%;border:0;border-top:1px solid var(--line,#dbe4ef);margin:18px 0}.account-security-card h3{margin:0 0 12px}.form-note{font-size:.9rem;color:var(--muted,#64748b)}
@media(max-width:720px){.mfa-setup-grid{grid-template-columns:1fr}.mfa-qr{margin:0 auto}.recovery-code-grid{grid-template-columns:1fr}.copy-field{align-items:stretch;flex-direction:column}}

/* v62 registration, access-support and authentication layout */
.consent-row-legal {
  align-items: flex-start;
  gap: 11px;
  padding: 2px 0;
  color: var(--text-muted);
  line-height: 1.55;
}
.consent-row-legal input { margin-top: 4px; flex: 0 0 auto; }
.inline-legal-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.inline-legal-link:hover,
.inline-legal-link:focus-visible { color: var(--blue-600); }
.auth-card { width: min(100%, 620px); justify-self: center; }
.auth-card > p { max-width: 58ch; }
.auth-card .form-stack { gap: 16px; }
.auth-card .button-wide { width: 100%; min-height: 52px; justify-content: center; }
.auth-card .auth-switch { margin-top: 4px; min-height: 28px; }
.auth-help { display:flex; justify-content:center; margin-top:4px; }
.auth-help .text-link { font-weight:700; }
.auth-provider-note { display:none !important; }
.telegram-login-button { min-height:52px; justify-content:center; }
.telegram-login-button .telegram-brand-icon { width:22px; height:22px; color:#229ED9; }
.modal-intro { margin:0; color:var(--text-muted); line-height:1.55; }
.account-access-ticket-note { display:grid; gap:4px; margin-top:8px; color:var(--text-muted); }
.account-access-ticket-note strong { color:var(--text); }
.account-security-card { overflow:hidden; }
.account-security-pane p { max-width:62ch; }
.mfa-setup-copy .form-stack { margin-top:14px; }
.mfa-setup-copy .button-wide { min-height:50px; justify-content:center; }
.auth-card .mfa-setup-grid + .auth-switch,
.auth-card > .auth-switch:last-child { margin-top:18px; padding-top:2px; }

/* v62 public account-recovery ticket details */
.admin-recovery-meta {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.public-recovery-ticket .attention-pill { white-space: nowrap; }

/* v62 final auth/MFA spacing polish */
.auth-card > .auth-switch:last-child {
  width: 100%;
  justify-content: center !important;
  text-align: center;
}
.auth-card > .auth-switch:last-child .text-link {
  min-height: 38px;
  max-width: 100%;
  justify-content: center;
  padding: 6px 10px;
  white-space: normal;
  text-align: center;
}
.mfa-setup-copy > p { margin: 0 0 14px; line-height: 1.55; }
.mfa-setup-copy .field { min-width: 0; }
.auth-card .telegram-login-button { margin: 0; }

/* v63 registration/password UX */
.username-field .username-status {
  display: none;
  min-height: 0;
  margin: 0;
}

.username-field .username-status.is-available,
.username-field .username-status.is-taken {
  display: block;
  margin-top: 5px;
  line-height: 1.35;
}

.password-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.password-input-wrap > input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  background: var(--blue-50);
  color: var(--blue-700);
}

.password-toggle .icon {
  width: 18px;
  height: 18px;
}

.password-strength {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.password-strength[hidden] {
  display: none !important;
}

.password-strength-bar {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.password-strength-bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width .18s var(--ease), background .18s var(--ease);
}

.password-strength small {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 16px;
  color: var(--text-muted);
}

.password-strength.is-weak strong { color: var(--danger); }
.password-strength.is-weak .password-strength-bar > i { background: var(--danger); }
.password-strength.is-medium strong { color: var(--warning); }
.password-strength.is-medium .password-strength-bar > i { background: var(--warning); }
.password-strength.is-strong strong { color: var(--success); }
.password-strength.is-strong .password-strength-bar > i { background: var(--success); }

.auth-back-button {
  width: fit-content;
  min-height: 34px;
  margin: -4px 0 10px -5px;
  padding: 5px 8px 5px 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--blue-700);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-back-button:hover,
.auth-back-button:focus-visible {
  background: var(--blue-50);
}

.auth-back-button .icon {
  width: 18px;
  height: 18px;
}

/* v68: 2FA recovery modal + admin Telegram identity spacing */
.mfa-recovery-codes {
  min-width: 0;
}

.mfa-recovery-modal {
  display: grid;
  gap: 16px;
}

.mfa-recovery-modal .modal-intro,
.mfa-recovery-modal .form-note,
.mfa-recovery-modal .recovery-code-grid {
  margin: 0;
}

.mfa-recovery-modal .recovery-code-grid {
  gap: 10px;
}

.mfa-recovery-actions {
  margin-top: 2px;
}

.admin-telegram-meta {
  display: flex !important;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 4px 0 7px !important;
  color: var(--text-muted);
  font-size: 11px !important;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.admin-telegram-meta .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.admin-telegram-meta > span {
  min-width: 0;
}

.admin-user-card .admin-user,
.admin-user-card .admin-user > span:last-child {
  min-width: 0;
}

.admin-user-card .admin-card-actions {
  gap: 8px;
}

.admin-telegram-button {
  white-space: nowrap;
}

.admin-user-detail > header > span:last-child {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-user-detail > header .admin-telegram-button {
  width: fit-content;
  margin-top: 8px;
}

@media (max-width: 620px) {
  .mfa-recovery-modal {
    gap: 13px;
  }

  .mfa-recovery-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .mfa-recovery-actions .button,
  .admin-user-detail > header .admin-telegram-button {
    width: 100%;
    justify-content: center;
  }

  .admin-user-detail > header {
    align-items: flex-start;
  }
}

/* v69: support-recovery tools stay visually separated from the conversation. */
.admin-support-context {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-support-context .admin-list {
  gap: 10px;
}
.admin-support-context .admin-card {
  padding: 12px 14px;
}
.auth-help {
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.support-password-reset-card {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface, var(--white));
}

.support-password-reset-card .notice {
  margin: 0;
}

.support-password-reset-card .form-stack {
  gap: 12px;
}

@media (max-width: 620px) {
  .support-password-reset-card {
    padding: 12px;
    border-radius: 14px;
  }
}


/* v70 — full UI/UX visual-consistency pass: navigation, spacing and action rhythm. */
.admin-tabs {
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 3px 3px 6px;
  scroll-padding-inline: 3px;
}

.admin-tab {
  min-height: 42px;
  padding: 9px 15px;
  line-height: 1.2;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.admin-tab > span {
  pointer-events: none;
}

.admin-tab:focus:not(:focus-visible) {
  outline: none;
}

.admin-tab:focus-visible {
  outline: 3px solid rgba(22, 119, 255, .34);
  outline-offset: 2px;
}

.admin-tab.is-active:focus-visible {
  outline-color: rgba(22, 119, 255, .45);
}

/* Recovery codes use the same vertical rhythm during registration and in Settings. */
.mfa-recovery-codes {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.mfa-recovery-codes > .modal-intro,
.mfa-recovery-codes > .recovery-code-grid,
.mfa-recovery-codes > .mfa-recovery-actions,
.mfa-recovery-codes > .form-note {
  margin: 0;
}

.mfa-recovery-actions {
  margin-top: 0;
}

/* Keep explanatory text visibly separated from any preceding action row. */
.button-row + .form-note,
.modal-actions + .form-note,
.mfa-recovery-actions + .form-note {
  margin-top: 2px;
}

/* Consistent inner rhythm for admin content shells and empty states. */
#admin-content > .surface,
#admin-content > .admin-list,
#admin-content > .admin-user-search {
  margin-top: 0;
}

.admin-card-actions {
  row-gap: 10px;
  column-gap: 10px;
}

@media (max-width: 760px) {
  .admin-tabs {
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 5px;
  }

  .admin-tab {
    min-height: 40px;
    padding: 8px 13px;
  }

  .mfa-recovery-codes {
    gap: 13px;
  }
}

/* v71 — notifications are user-dismissible as well as timed. */
.toast {
  cursor: pointer;
  user-select: none;
}
.toast:focus-visible {
  outline: 3px solid rgba(22,119,255,.24);
  outline-offset: 2px;
}

/* v72 — full visual-rhythm and action-spacing pass.
   Text stacks use explicit gaps instead of relying on collapsing margins. This
   keeps every locale, font metric and responsive breakpoint predictable. */
.stat-copy,
.chat-row-copy,
.transaction-copy,
.support-action > span:last-child,
.settings-profile-card > span:last-child,
.setting-toggle > span,
.profile-review-card .review-author {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.stat-copy strong,
.chat-row-copy small,
.transaction-copy small,
.support-action small,
.setting-toggle small,
.profile-review-card .review-author small {
  margin-top: 0;
}

/* Headline/subtitle pairs should never visually touch. */
.page-header-copy,
.section-heading > div,
.profile-title,
.tg-copy {
  min-width: 0;
}

.profile-title {
  display: grid;
  gap: 7px;
}
.profile-title h1,
.profile-title p {
  margin: 0;
}

.settings-profile-card > span:last-child p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

/* Keep listing metadata clear of the divider/actions even when a card is full. */
.market-card > .meta-row {
  margin-bottom: 14px;
}
.market-card-footer {
  min-width: 0;
}
.market-card-footer .card-actions {
  column-gap: 10px;
  row-gap: 10px;
}

/* Order cards previously depended on margins inside a button, which could make
   the title/description appear visually glued together in some browsers. */
.order-card > div:first-child {
  min-width: 0;
}
.order-title-link {
  margin-top: 12px;
  margin-bottom: 8px;
}
.order-title-link h3,
.order-card .order-title-link h3 {
  margin: 0;
}
.order-card > div:first-child > p {
  margin: 0;
  line-height: 1.55;
}
.order-card .order-people {
  margin-top: 13px;
}

/* Support/ticket stacks get deterministic vertical rhythm. */
.support-action > span:last-child {
  gap: 6px;
}
.ticket-card > span:first-child {
  display: grid;
  min-width: 0;
  gap: 7px;
}
.ticket-card .ticket-title,
.ticket-card > span:first-child > small {
  margin: 0;
}

/* Review moderation is a separate action region, not part of the metadata line. */
.review-moderation {
  margin-top: 12px;
}

/* Certificate and admin stat metadata remain compact, but not cramped. */
.certificate-copy {
  gap: 7px;
}
.admin-stat strong {
  margin-top: 8px;
}
.admin-stat small {
  margin-top: 6px;
  line-height: 1.35;
}

/* Clickable text should have a real hit area without looking like another button. */
.profile-name,
.order-number-link,
.text-link {
  touch-action: manipulation;
}

/* v72 — typography rhythm for compact content pairs found by the full-page audit. */
.section-heading > div,
.translator-teaser > span:nth-child(2),
.rating-card > span:first-child,
.portfolio-empty div,
.tg-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}
.section-heading p,
.translator-teaser small,
.portfolio-empty h3,
.portfolio-empty p,
.tg-copy h2,
.tg-copy p {
  margin: 0;
}
.rating-card > span:first-child {
  gap: 5px;
}

/* v73 — durable support archive + deterministic admin action layout */
.admin-support-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-support-toolbar .admin-user-search {
  margin: 0;
}

.admin-support-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-support-list {
  margin-top: 0;
}

.admin-support-ticket {
  align-items: center;
}

.admin-support-ticket > div:first-child {
  min-width: 0;
}

.admin-support-ticket h3 {
  margin: 8px 0 6px;
}

.admin-support-ticket p,
.admin-support-ticket .admin-recovery-meta {
  margin-top: 0;
  margin-bottom: 6px;
}

.admin-support-updated {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
}

.admin-support-load-more {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

.admin-support-readonly {
  margin-top: 16px;
}

.admin-management-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  gap: 12px;
}

.admin-management-actions > .button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

.admin-management-actions > .notice {
  grid-column: 1 / -1;
  margin: 0;
}

/* v73 — the profile avatar must fit inside its bordered trigger at every breakpoint. */
.profile-trigger > .avatar-small {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

/* v74 clean — spacing and native-control cleanup only; no visual redesign. */
.modal-header-leading,
.panel-header-leading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.modal-header-leading .modal-heading,
.panel-header-leading #drawer-label {
  min-width: 0;
}

.panel-back-button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 11px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--navy-900);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.panel-back-button:hover:not(:disabled) {
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--blue-700);
}

.panel-back-button:active:not(:disabled) {
  transform: translateY(1px);
}

.panel-back-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue-600) 20%, transparent);
  outline-offset: 2px;
}

.panel-back-button .icon {
  width: 16px;
  height: 16px;
}

.filter-button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--navy-800);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.filter-button:hover:not(:disabled) {
  border-color: var(--blue-200, var(--blue-100));
  background: var(--blue-50);
  color: var(--blue-700);
}

.filter-button.is-active,
.filter-button[aria-pressed="true"] {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: var(--white);
}

.filter-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue-600) 20%, transparent);
  outline-offset: 2px;
}

.filter-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.admin-support-filters {
  column-gap: 10px;
  row-gap: 10px;
}

.detail-person + .button-row,
.detail-section > p + .button-row,
.detail-section > .muted + .button-row {
  margin-top: 14px;
}

.section-title-row + .admin-activity-grid,
.section-title-row + .admin-activity-feed,
.section-title-row + .admin-list {
  margin-top: 12px;
}

.admin-user-detail > header .admin-card-meta {
  margin-top: 8px;
  column-gap: 8px;
  row-gap: 7px;
}

.admin-user-detail > header .admin-telegram-button {
  margin-top: 10px;
}

.profile-header .header-actions {
  column-gap: 12px;
  row-gap: 10px;
}

@media (max-width: 620px) {
  .modal-header-leading,
  .panel-header-leading {
    gap: 8px;
  }

  .panel-back-button {
    min-height: 36px;
    padding-inline: 9px;
  }

  .admin-support-filters {
    gap: 10px;
  }
}

/* v76 email verification flow: clear hierarchy and comfortable spacing. */
.email-verification-card > .eyebrow { margin-bottom: 10px; }
.email-verification-card > h2 { margin-bottom: 12px; }
.email-verification-card > p { margin: 0 0 18px; line-height: 1.58; }
.email-verification-notice { margin: 0 0 20px; padding: 16px 18px; align-items: flex-start; line-height: 1.58; }
.email-verification-notice .icon { flex: 0 0 auto; margin-top: 2px; }
.email-verification-card #email-verification-form { gap: 18px; }
.email-verification-card #email-verification-form .field { gap: 9px; }
.email-verification-card #email-verification-form .field > small { margin-top: 1px; line-height: 1.45; }
.email-verification-card input[autocomplete="one-time-code"] { letter-spacing: .18em; font-weight: 750; text-align: center; font-variant-numeric: tabular-nums; }
.email-verification-secondary { display: grid; gap: 10px; margin-top: 12px; }
.email-verification-secondary > small { min-height: 20px; color: var(--text-muted); line-height: 1.45; text-align: center; }
.email-verification-card .auth-switch { margin-top: 18px; }

/* Top-level modals have no fake "Back" action. Nested modal history reveals it explicitly. */
.panel-back-button[hidden] {
  display: none !important;
}

/* v80 — consistent advanced search/filter panel across every admin workspace. */
.admin-search-panel {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.admin-search-grid {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.admin-search-main {
  min-height: 46px;
  align-self: end;
}

.admin-search-field {
  gap: 6px;
  margin: 0;
}

.admin-search-field > span {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.admin-search-field select {
  min-height: 46px;
}

.admin-search-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 46px;
}

.admin-support-toolbar .admin-search-panel {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .admin-search-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-search-main {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .admin-search-panel {
    padding: 12px;
    border-radius: 16px;
  }
  .admin-search-grid {
    grid-template-columns: 1fr;
  }
  .admin-search-main {
    grid-column: auto;
  }
  .admin-search-actions {
    width: 100%;
  }
  .admin-search-actions .button {
    flex: 1 1 0;
  }
}

/* v80 search layout override: flexible wrapping prevents overflow when a tab has many filters. */
.admin-search-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.admin-search-main { flex: 2 1 300px; }
.admin-search-field { flex: 1 1 155px; min-width: 145px; }
.admin-search-actions { flex: 0 1 auto; }
@media (max-width: 760px) {
  .admin-search-main,
  .admin-search-field,
  .admin-search-actions { flex: 1 1 100%; min-width: 0; }
}


/* v91 — centered foreground dialogs and resilient compact icon/badge geometry. */
.modal {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal[open] {
  display: grid;
  place-items: center;
}

.modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: 0;
}

.modal-content {
  min-height: 0;
  max-height: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Keep counters inside their hit targets so browser/WebView clipping cannot cut them. */
.notification-button {
  overflow: visible;
}

.notification-count {
  top: 2px;
  right: 2px;
  z-index: 2;
}

/* Icon/copy rows must preserve their intended gap even under narrow localized text. */
.certificate-icon,
.certificate-proof,
.admin-certificate-summary > img,
.certificate-empty > span:first-child,
.support-action-icon,
.stat-icon,
.transaction-icon,
.state-icon {
  flex-shrink: 0;
}

.admin-certificate-summary > div,
.certificate-empty > div,
.support-action > span:last-child,
.stat-copy,
.transaction-copy,
.notice > span:last-child,
.revision-heading > span:last-child,
.order-delivery-heading > span:last-child,
.review-edit-heading > span:last-child {
  min-width: 0;
}


/* v97 — compact support ticket id and pointer-focus polish. */
.ticket-card .mini-tag {
  justify-self: start;
  width: max-content;
  max-width: 100%;
}

.mobile-secondary-nav { display: none; }
.mobile-secondary-link {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
}
.mobile-secondary-link .icon { flex: 0 0 auto; }

/* Pointer/touch activation must not leave the temporary keyboard focus frame.
   Keyboard navigation keeps the normal :focus-visible treatment. */
html[data-input-modality="pointer"] button:focus,
html[data-input-modality="pointer"] [role="button"]:focus,
html[data-input-modality="pointer"] a:focus,
html[data-input-modality="pointer"] .toast:focus,
html[data-input-modality="pointer"] .rating-choice input:focus + span,
html[data-input-modality="pointer"] .listing-active-control input:focus + .listing-active-track {
  outline: none !important;
}


/* v100 — phone interaction polish. Touch activation must not leave browser
   focus/tap rectangles on dismissible notices, notification rows or ratings.
   Desktop keyboard focus remains unchanged. */
@media (hover: none) and (pointer: coarse) {
  button:focus,
  button:focus-visible,
  [role="button"]:focus,
  [role="button"]:focus-visible,
  a:focus,
  a:focus-visible,
  .toast,
  .toast:focus,
  .toast:focus-visible {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .notification-list button:focus,
  .notification-list button:focus-visible,
  .telegram-login-button:focus,
  .telegram-login-button:focus-visible {
    box-shadow: none !important;
  }

  .rating-choice input:focus + span,
  .rating-choice input:focus-visible + span {
    outline: none !important;
  }

  .rating-choice input:checked + span {
    border-color: var(--line-strong) !important;
    box-shadow: none !important;
  }
}

/* v104 — final responsive/touch polish. No workflow or business logic changes. */
@media (hover: none) and (pointer: coarse) {
  /* iOS/WebView can paint a square tap rectangle around clickable labels even
     when the visual control itself is rounded. Suppress that transient browser
     artifact while preserving normal selected/checked styling. */
  label,
  summary,
  .crypto-method,
  .rating-choice label,
  .balance-mode label,
  .order-media-upload,
  .service-media-drop,
  .tasklink-file-picker,
  .moderation-action-choice {
    -webkit-tap-highlight-color: transparent !important;
  }

  .crypto-method:focus,
  .rating-choice label:focus,
  .order-media-upload:focus,
  .service-media-drop:focus,
  .tasklink-file-picker:focus,
  .moderation-action-choice:focus {
    outline: none !important;
  }
}

@media (max-width: 420px) {
  /* Keep the language-swap action visually centered between both selectors,
     with a slightly tighter vertical rhythm on phones. */
  .translator-language-row {
    row-gap: 8px;
  }

  .translator-swap {
    margin: -1px auto -3px;
  }
}

