:root {
  --font: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --base: 12.5px;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #697386;
  --line: #dfe5ec;
  --line-soft: #eef2f6;
  --accent: #244f92;
  --accent-soft: #edf4ff;
  --success: #1f7a4d;
  --warning: #a16a00;
  --danger: #ba3030;
  --shadow: 0 20px 60px rgba(15, 23, 42, .07);
  --radius: 20px;
}

html[data-theme="dark"] {
  --bg: #101622;
  --panel: #141d2b;
  --panel-soft: #192436;
  --text: #eef4ff;
  --muted: #98a5b9;
  --line: #263449;
  --line-soft: #1e2a3d;
  --accent: #8ab4ff;
  --accent-soft: #1b2c46;
  --shadow: 0 20px 60px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { font-size: var(--base); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--base);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
strong { font-weight: 450; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: 2.05rem; line-height: 1.18; }
h2 { font-size: 1.45rem; line-height: 1.22; }
p { margin: 0; color: var(--muted); line-height: 1.55; }


.app-shell {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 228px minmax(0, 1180px);
  grid-template-rows: auto 1fr;
  gap: 0 26px;
  align-items: start;
  min-height: 100vh;
}
.sidebar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 90px;
  width: 100%;
  padding: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: transparent;
  box-shadow: none;
  z-index: 30;
}
.sidebar-brand {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 9px;
  align-items: center;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: transparent;
}
.brand-mark i { font-size: 1.45rem; }
.brand-title { font-size: 1.05rem; font-weight: 500; }
.brand-subtitle, .cell-sub, .muted, .section-kicker, .system-kicker { color: var(--muted); }
.brand-subtitle { margin-top: 2px; font-size: .92rem; }
.sidebar-section { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.sidebar-heading {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 7px;
}
.nav-link,
.plain-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 5px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
}
.nav-link i, .plain-link i { font-size: 1.2rem; color: var(--muted); }
.nav-link.active { color: var(--accent); }
.nav-link.active i { color: var(--accent); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.user-mini { line-height: 1.35; margin-bottom: 8px; }
.user-mini span { display: block; color: var(--muted); font-size: .92rem; }

.main-panel {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-height: calc(100vh - 66px);
}
.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.topbar-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { font-size: 1.2rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions, .inline-form, .button-row, .table-actions, .inline-form-row, .inline-control-row { display: flex; align-items: center; gap: 8px; }
.topbar-actions { justify-content: flex-end; flex-wrap: nowrap; }
.lang-form select { width: 74px; min-height: 32px; padding: 6px 8px; }
.header-profile {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.header-profile i { color: var(--muted); font-size: 1.18rem; }
.header-action { min-height: 34px; padding: 7px 10px; }
.content-container {
  width: 100%;
  margin: 0;
  padding: 24px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 22px;
}
.card-head, .hero-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

/* Fix card header action sizing: plain links inside cards must not occupy the whole row */
.card-head > .plain-link,
.hero-card > .plain-link {
  width: auto;
  flex: 0 0 auto;
}
.card-head > div:first-child,
.hero-card > div:first-child {
  min-width: 0;
}

.hero-card p { margin-top: 8px; max-width: 620px; }
.section-kicker { font-size: .92rem; margin-bottom: 7px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-70-30 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); gap: 18px; }
.grid-30-70 { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.4fr); gap: 18px; }
.auth-grid { display: grid; grid-template-columns: minmax(320px, 460px) minmax(320px, 1fr); gap: 18px; align-items: stretch; }
.auth-grid.single { grid-template-columns: minmax(320px, 620px); justify-content: center; }
.form-grid { display: grid; gap: 10px; margin-top: 16px; }
.form-grid.two-cols { grid-template-columns: 1fr 1fr; }
.full-span { grid-column: 1 / -1; }
.field-label { display: block; color: var(--muted); margin: 0 0 3px; }
input, select, textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--panel-soft);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
}
textarea { resize: vertical; min-height: 76px; }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--accent); }
.action-button, .ghost-button, .system-button, .small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
}
.action-button { background: var(--accent); color: #fff; }
.ghost-button { background: var(--panel-soft); color: var(--text); }
.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 10px;
}
.mobile-menu { display: none; }
.auth-note { margin-top: 16px; color: var(--muted); }
.auth-note a { text-decoration: underline; text-underline-offset: 3px; }
.exchange-form { margin-top: 12px; }
.quote-line {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
}
.chart-box { height: 260px; width: 100%; margin: 12px 0; }
.chart-box.small { height: 220px; }
.market-card h2 { margin-top: 4px; }
.small-text { font-size: .94rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 11px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
th { color: var(--muted); font-size: .94rem; }
.cell-sub { display: block; margin-top: 2px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-text { font-weight: 400; white-space: nowrap; }
.status-new { color: var(--accent); }
.status-waiting_payment, .status-paid, .status-processing { color: var(--warning); }
.status-completed { color: var(--success); }
.status-cancelled, .status-rejected { color: var(--danger); }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.metric {
  background: var(--panel-soft);
  min-height: 92px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 14px;
}
.metric span { color: var(--muted); }
.metric strong { font-size: 1.6rem; font-weight: 500; }
.profile-row, .settings-line { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-row span:first-child { color: var(--muted); }
.flash-stack { display: grid; gap: 8px; }
.flash { background: var(--accent-soft); color: var(--text); padding: 10px 12px; border-radius: 12px; }
.system-body { background: #0b1220; color: #d8e1f2; }
.system-shell { display: flex; min-height: 100vh; }
.system-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: #101827;
  color: #d8e1f2;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 40;
}
.system-titlebar { display: flex; align-items: center; gap: 8px; padding: 10px 8px 14px; border-bottom: 1px solid #263449; }
.system-section { padding-bottom: 12px; border-bottom: 1px solid #263449; }
.system-heading { color: #93a4bd; margin: 0 0 8px; font-size: .92rem; }
.system-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 6px;
  color: #d8e1f2;
  background: transparent;
  border: 0;
  text-align: left;
}
.system-link i { color: #93a4bd; font-size: 1.18rem; }
.system-link.active { background: #1c2a3f; color: #fff; text-decoration: none; }
.button-as-link { font: inherit; }
.system-main { margin-left: 260px; width: calc(100% - 260px); min-height: 100vh; background: #e9eef5; color: #182235; }
.system-topbar {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  background: #f8fafc;
  border-bottom: 1px solid #cad3df;
  position: relative;
  z-index: 20;
}
.system-page-title { font-size: 1.22rem; font-weight: 500; }
.system-page-subtitle { color: #6b778c; font-size: .92rem; margin-top: 2px; }
.system-container { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.system-card {
  background: #ffffff;
  color: #182235;
  padding: 16px;
  border-radius: 8px;
  box-shadow: none;
}
.system-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.system-kicker { color: #6b778c; margin-bottom: 5px; }
.system-muted { color: #6b778c; margin-top: 10px; }
.system-button { background: #234a84; color: #fff; }
.small-action { background: #edf2f7; color: #182235; min-height: 30px; padding: 5px 9px; }
.system-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.system-metrics.three { grid-template-columns: repeat(3, 1fr); }
.system-metric {
  background: #fff;
  border-radius: 8px;
  min-height: 92px;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: none;
}
.system-metric span { color: #6b778c; }
.system-metric strong { font-size: 1.7rem; font-weight: 500; }
.system-table th, .system-table td { border-bottom: 1px solid #dfe5ec; }
.system-table input, .system-table select,
.system-card input, .system-card select, .system-card textarea {
  background: #f8fafc;
  color: #182235;
  border-bottom: 1px solid #cbd5e1;
}
.system-form-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.system-form-grid.compact-form { grid-template-columns: repeat(6, minmax(130px, 1fr)); align-items: end; }
.direction-form { margin-top: 10px; }
.editable-table input, .editable-table select { min-width: 90px; }
.mini-check { display: block; color: #6b778c; margin-top: 4px; white-space: nowrap; }
.mini-check input { width: auto; min-height: auto; }
.status-form { display: flex; gap: 6px; align-items: center; }
.status-form select { min-width: 130px; }
.inline-control-row { gap: 10px; flex-wrap: wrap; }
.inline-control-row select { width: 240px; }
.system-grid-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-grid > div { padding: 10px 0; border-bottom: 1px solid #dfe5ec; }
.detail-grid span { display: block; color: #6b778c; margin-bottom: 3px; }
.detail-grid strong { font-weight: 450; }
.decision-card { position: sticky; top: 84px; }


@media (max-width: 980px) {
  .app-shell {
    display: block;
    max-width: none;
    padding: 0 16px;
  }
  .sidebar {
    position: fixed;
    inset: 66px auto auto 16px;
    width: min(274px, calc(100vw - 32px));
    max-height: calc(100vh - 78px);
    overflow-y: auto;
    padding: 14px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    transform: translateX(calc(-100% - 24px));
    transition: transform .18s ease;
  }
  .system-sidebar {
    transform: translateX(-104%);
    transition: transform .18s ease;
  }
  .sidebar.open, .system-sidebar.open { transform: translateX(0); }
  .main-panel, .system-main { margin-left: 0; width: 100%; }
  .mobile-menu { display: grid; }
  .content-container { padding: 16px 0 22px; }
  .grid-70-30, .grid-30-70, .auth-grid, .system-grid-detail { grid-template-columns: 1fr; }
  .system-form-grid, .system-form-grid.compact-form { grid-template-columns: repeat(2, 1fr); }
  .system-metrics, .system-metrics.three { grid-template-columns: repeat(2, 1fr); }
  .topbar { min-height: 66px; }
  .topbar-actions { flex-wrap: wrap; }
}

@media (max-width: 620px) {
  html { font-size: 12.5px; }
  .app-shell { padding: 0 12px; }
  .content-container { padding: 12px 0 18px; }
  .system-container { padding: 12px; }
  .card, .system-card { padding: 16px; border-radius: 14px; }
  .system-card { border-radius: 8px; }
  .form-grid.two-cols, .system-form-grid, .system-form-grid.compact-form, .metrics-grid, .system-metrics, .system-metrics.three { grid-template-columns: 1fr; }
  .card-head, .hero-card { flex-direction: column; align-items: stretch; }
  .button-row, .hero-actions { flex-direction: column; align-items: stretch; }
  .action-button, .ghost-button, .system-button { width: 100%; }
  .topbar .action-button, .topbar .ghost-button { width: auto; }
  th, td { padding: 10px 8px; }
  .topbar {
    height: auto;
    min-height: 66px;
    padding: 8px 0;
    align-items: flex-start;
  }
  .topbar-actions { gap: 6px; }
  .header-profile span {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lang-form select { width: 68px; }
}

/* Exchange landing */
.exchange-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 62.5fr) minmax(360px, 37.5fr);
  gap: 30px;
  align-items: start;
}
.exchange-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  padding: 0;
}
.exchange-hero-copy h1 {
  max-width: 760px;
  font-size: clamp(2rem, 3.5vw, 4rem);
  line-height: 1;
  letter-spacing: -.045em;
}
.exchange-hero-copy p {
  max-width: 760px;
  font-size: 1.04rem;
}
.working-pill {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  margin-bottom: 56px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #45d483;
  display: inline-block;
  animation: livePulse 1.35s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { transform: scale(.82); opacity: .75; }
  50% { transform: scale(1.25); opacity: 1; }
}
.exchange-calculator-card {
  background: var(--panel);
  color: var(--text);
  border-radius: 20px;
  padding: 18px;
  min-height: 100%;
}
.calculator-title {
  text-align: center;
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 14px;
  font-weight: 500;
}
.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.calculator-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: .96rem;
}
.calculator-topline a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
}
.verification-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-soft);
}
.verification-switch button {
  min-height: 38px;
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 400;
}
.verification-switch button.active {
  background: var(--accent);
  color: #fff;
}
.calculator-field {
  display: block;
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 10px 12px;
}
.calculator-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.calculator-field span {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}
.calculator-field input,
.calculator-field textarea,
.direction-box select {
  background: transparent;
  border-bottom: 0;
  color: var(--text);
  padding: 0;
  min-height: 26px;
  font-size: 1.12rem;
}
.calculator-field textarea {
  min-height: 48px;
  font-size: 1rem;
  line-height: 1.4;
}
.calculator-field input::placeholder,
.calculator-field textarea::placeholder { color: var(--muted); }
.asset-badge {
  font-style: normal;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.asset-badge i {
  flex: 0 0 20px;
  width: 20px;
  text-align: center;
  font-size: 1.2rem;
}
.asset-badge span {
  min-width: 34px;
  margin: 0;
  text-align: left;
}
.direction-box {
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 10px 12px;
}
.direction-box .field-label { color: var(--muted); }
.direction-box select { width: 100%; font-size: 1rem; }
.direction-box option { color: #172033; }
.swap-marker {
  align-self: center;
  width: 36px;
  height: 36px;
  margin: -18px 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  z-index: 2;
}
.calculator-facts {
  display: grid;
  gap: 7px;
  padding: 6px 0;
}
.calculator-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.calculator-facts span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
}
.calculator-facts span:last-child {
  color: var(--text);
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.load-dots {
  display: inline-flex;
  gap: 5px;
}
.load-dots i {
  display: block;
  width: 13px;
  height: 9px;
  border-radius: 4px;
  background: var(--line);
}
.load-dots i:first-child { background: #82e17a; }
.promo-field input { font-size: 1rem; }
.promo-help {
  color: var(--accent);
  padding-left: 14px;
  font-size: .94rem;
}
.calculator-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
.calculator-actions .action-button {
  min-height: 43px;
  border-radius: 10px;
}
.check-address-button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  text-decoration: none;
}
.section-line-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.section-line-title::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--line);
}
.benefits-grid,
.review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.benefit-metric,
.review-metric {
  min-height: 130px;
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.benefit-metric i {
  font-size: 2rem;
  color: var(--accent);
}
.benefit-metric span,
.review-head span {
  color: var(--text);
  font-weight: 500;
}
.benefit-metric p,
.review-metric p {
  font-size: .96rem;
  line-height: 1.45;
}
.review-metric {
  align-items: stretch;
  text-align: left;
}
.review-head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.review-head i { color: var(--muted); font-size: 1.25rem; }
.review-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-head em { font-style: normal; text-align: right; }
.reviews-bottom {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.empty-review {
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.all-reviews-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.status-pending { color: var(--warning); }
.status-approved { color: var(--success); }
.status-rejected { color: var(--danger); }
.line-clamp-two {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 360px;
}
.review-create-form { grid-template-columns: minmax(220px, .65fr) minmax(160px, .35fr); }

@media (max-width: 1100px) {
  .exchange-hero-grid { grid-template-columns: 1fr; }
  .exchange-hero-copy h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
  .benefits-grid, .review-grid, .all-reviews-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .exchange-calculator-card { padding: 16px; border-radius: 16px; }
  .calculator-title { font-size: 1.35rem; }
  .calculator-topline { align-items: flex-start; flex-direction: column; }
  .benefits-grid, .review-grid, .all-reviews-grid, .review-create-form { grid-template-columns: 1fr; }
}

/* Exchange flow update */
.exchange-calculator-card button.asset-badge {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.asset-selector:hover { text-decoration: none; background: rgba(33, 106, 205, .16); }
.method-picker-panel {
  background: var(--panel-soft);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 10px;
}
.method-picker-panel[hidden] { display: none; }
.method-panel-title { color: var(--muted); text-align: center; }
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.method-grid button {
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 1px 8px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}
.method-grid button i { grid-row: 1 / 3; color: var(--accent); font-size: 1.35rem; }
.method-grid button span { color: var(--text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.method-grid button em { color: var(--muted); font-style: normal; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exchange-description {
  min-height: 46px;
  border-radius: 12px;
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--text);
  padding: 10px 12px;
}
.exchange-description i { color: var(--accent); }
.compact-description { margin-bottom: 12px; }
.calculator-field select {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 0;
  min-height: 30px;
  font: inherit;
  font-size: 1.05rem;
}
.calculator-field select option { color: #172033; }
.flow-shell {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}
.wide-flow { max-width: 1080px; }
.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.flow-steps div {
  min-height: 72px;
  background: var(--panel-soft);
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px;
  gap: 5px;
}
.flow-steps span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--muted);
}
.flow-steps em { font-style: normal; color: var(--muted); }
.flow-steps .active span,
.flow-steps .done span { background: var(--accent); color: #fff; }
.flow-steps .active em,
.flow-steps .done em { color: var(--text); }
.centered-calculator { width: 100%; }
.preview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.preview-summary.large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.preview-summary div {
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
}
.preview-summary span { color: var(--muted); }
.preview-summary strong { font-weight: 450; overflow-wrap: anywhere; }
.details-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.details-list > div:not(.section-line-title) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.details-list span { color: var(--muted); }
.details-list strong { font-weight: 450; text-align: right; overflow-wrap: anywhere; }
.flow-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.request-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}
.request-chat-card { position: sticky; top: 14px; }
.request-chat-list {
  display: grid;
  gap: 9px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}
.request-message {
  background: var(--panel-soft);
  border-radius: 14px;
  padding: 10px;
}
.request-message.client { background: var(--accent-soft); }
.request-message.moderator { background: var(--panel-soft); }
.request-message.system { opacity: .82; }
.request-message span { display: block; color: var(--muted); margin-bottom: 4px; font-size: .92rem; }
.request-message p { margin: 0; overflow-wrap: anywhere; }
.chat-form { display: grid; gap: 8px; margin-top: 12px; }
.chat-empty { color: var(--muted); text-align: center; padding: 18px 0; }
@media (max-width: 980px) {
  .request-layout { grid-template-columns: 1fr; }
  .request-chat-card { position: static; }
}
@media (max-width: 620px) {
  .method-grid, .flow-steps, .preview-summary, .preview-summary.large, .flow-actions { grid-template-columns: 1fr; }
}
.system-detail-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid #dfe5ec; }
.system-chat-list { display: grid; gap: 8px; margin-top: 10px; max-height: 420px; overflow-y: auto; }
.system-message { background: #f8fafc; border-radius: 8px; padding: 10px; }
.system-message.client { background: #eef4ff; }
.system-message span { display: block; color: #6b778c; margin-bottom: 4px; }
.system-message p { margin: 0; overflow-wrap: anywhere; }
.system-chat-form { display: grid; gap: 8px; margin-top: 10px; }

/* Calculator and flow polish */
.calculator-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 7px 0;
}
.swap-marker {
  border: 0;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease;
}
.swap-marker:hover { transform: rotate(180deg); }
.method-picker-panel {
  margin: 2px 0 4px;
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 8px;
  box-shadow: none;
}
.method-grid {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}
.method-grid button {
  border-radius: 10px;
  background: transparent;
  border-bottom: 1px solid var(--line);
}
.method-grid button:last-child { border-bottom: 0; }
.method-grid button:hover,
.method-grid button.selected {
  background: var(--accent-soft);
}
.method-grid button[hidden] { display: none; }
.exchange-description {
  line-height: 1.35;
}
.verification-switch {
  background: var(--panel-soft);
  gap: 2px;
  padding: 3px;
}
.verification-switch button { border-radius: 8px; }
.preview-summary.centered-metrics div,
.centered-metrics div,
.preview-summary div {
  align-items: center;
  justify-items: center;
  text-align: center;
}
.flow-steps {
  gap: 0;
  background: var(--panel);
  border-radius: 16px;
  padding: 12px;
}
.flow-steps div {
  background: transparent;
  border-radius: 0;
  min-height: 58px;
  position: relative;
}
.flow-steps div:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 24px;
  right: -50%;
  width: 100%;
  height: 1px;
  background: var(--line);
  z-index: 0;
}
.flow-steps span,
.flow-steps em { position: relative; z-index: 1; }
.flow-steps span { box-shadow: 0 0 0 6px var(--panel); }
.request-review-card { width: 100%; }
.request-layout { grid-template-columns: 1fr; }
.request-chat-card {
  position: static;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.request-chat-list,
.pro-chat-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 300px;
  max-height: 560px;
  overflow-y: auto;
  padding: 4px 6px 4px 0;
}
.request-message {
  width: min(76%, 620px);
  border-radius: 16px 16px 16px 6px;
  padding: 9px 11px;
  background: var(--panel-soft);
  align-self: flex-start;
}
.request-message.client {
  background: var(--accent-soft);
  align-self: flex-end;
  border-radius: 16px 16px 6px 16px;
}
.request-message.operator,
.request-message.moderator {
  background: var(--panel-soft);
  align-self: flex-start;
}
.request-message.system {
  width: auto;
  align-self: center;
  text-align: center;
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
}
.pro-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pro-chat-form textarea {
  min-height: 42px;
  max-height: 140px;
  resize: vertical;
  border-radius: 12px;
  border-bottom: 0;
  background: var(--panel-soft);
  padding: 12px;
}
.pro-chat-form .action-button,
.pro-chat-form .system-button {
  min-height: 42px;
  border-radius: 12px;
  white-space: nowrap;
}
.system-request-stack {
  display: grid;
  gap: 14px;
}
.system-decision-form {
  display: grid;
  gap: 12px;
}
.compact-decision-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}
.system-dynamic-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.system-dynamic-fields .full-span { grid-column: 1 / -1; }
.system-chat-card { min-height: 520px; display: flex; flex-direction: column; }
.system-pro-chat-form textarea {
  background: #f8fafc;
  color: #182235;
}
.system-pro-chat-form .system-button { background: #234a84; color: #fff; }
.system-chat-card .request-message { color: #182235; }
.system-chat-card .request-message.client { background: #eaf1ff; }
.system-chat-card .request-message.operator { background: #f8fafc; }
.system-chat-card .request-message.system { color: #6b778c; }
@media (max-width: 980px) {
  .compact-decision-grid,
  .system-dynamic-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-steps div:not(:last-child)::after { display: none; }
}
@media (max-width: 620px) {
  .pro-chat-form { grid-template-columns: 1fr; }
  .request-message { width: 92%; }
  .compact-decision-grid,
  .system-dynamic-fields { grid-template-columns: 1fr; }
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.calculator-field select,
.system-card select,
.lang-form select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

/* Fixes: system layout isolation and wider exchange flow */
.flow-shell {
  width: 100%;
  max-width: 1120px;
}
.flow-shell.wide-flow,
.request-flow-shell {
  max-width: 100%;
}
.request-review-card,
.request-chat-card {
  width: 100%;
}
.request-chat-card {
  min-height: 580px;
}
.request-chat-list,
.pro-chat-list {
  min-height: 380px;
}
.exchange-calculator-card.centered-calculator {
  width: 100%;
}
@media (max-width: 980px) {
  .flow-shell,
  .flow-shell.wide-flow,
  .request-flow-shell {
    max-width: 100%;
  }
}

/* System container/navigation refresh */
.system-body {
  background: #eef2f6;
  color: #182235;
}
.system-shell {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 228px minmax(0, 1180px);
  grid-template-rows: auto 1fr;
  gap: 0 26px;
  align-items: start;
  min-height: 100vh;
}
.system-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid #cbd5e1;
  position: relative;
  z-index: 20;
}
.system-topbar-main,
.system-topbar-actions,
.system-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}
.system-topbar-actions { justify-content: flex-end; flex-wrap: nowrap; }
.system-user-chip {
  min-height: 32px;
  color: #64748b;
  white-space: nowrap;
}
.system-user-chip i { font-size: 1.2rem; }
.system-sidebar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  inset: auto;
  top: 90px;
  width: 100%;
  padding: 24px 0 0;
  background: transparent;
  color: #182235;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 30;
}
.system-titlebar {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 9px;
  padding: 0 0 14px;
  border-bottom: 1px solid #cbd5e1;
}
.system-titlebar i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #234a84;
  font-size: 1.35rem;
}
.system-titlebar span {
  display: block;
  color: #182235;
  font-size: 1.05rem;
  font-weight: 500;
}
.system-titlebar em {
  display: block;
  color: #64748b;
  font-style: normal;
  font-size: .92rem;
  margin-top: 2px;
}
.system-section {
  padding-bottom: 13px;
  border-bottom: 1px solid #cbd5e1;
}
.system-heading {
  color: #64748b;
  font-size: .94rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.system-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 0;
  color: #334155;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
  text-decoration: none;
}
.system-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.system-link i { color: #64748b; font-size: 1.18rem; }
.system-link.active,
.system-link.active i {
  background: transparent;
  color: #234a84;
  text-decoration: none;
}
.system-main {
  grid-column: 2;
  grid-row: 2;
  margin-left: 0;
  width: 100%;
  min-height: calc(100vh - 66px);
  background: transparent;
  color: #182235;
}
.system-container {
  width: 100%;
  margin: 0;
  padding: 24px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.system-card,
.system-metric {
  box-shadow: none;
  border: 0;
}
.system-card {
  border-radius: 12px;
  padding: 18px;
}
.system-metric { border-radius: 12px; }
.system-page-title { color: #182235; }
.system-page-subtitle { color: #64748b; }
.system-table th,
.system-table td {
  vertical-align: middle;
}
@media (max-width: 980px) {
  .system-shell {
    display: block;
    max-width: none;
    padding: 0 16px;
  }
  .system-topbar {
    min-height: 66px;
    height: auto;
    padding: 8px 0;
  }
  .system-topbar-actions {
    flex-wrap: wrap;
  }
  .system-sidebar {
    position: fixed;
    inset: 66px auto auto 16px;
    top: auto;
    width: min(274px, calc(100vw - 32px));
    max-height: calc(100vh - 78px);
    overflow-y: auto;
    padding: 14px;
    background: #ffffff;
    color: #182235;
    border-right: 1px solid #cbd5e1;
    transform: translateX(calc(-100% - 24px));
    transition: transform .18s ease;
  }
  .system-sidebar.open { transform: translateX(0); }
  .system-main {
    margin-left: 0;
    width: 100%;
    min-height: auto;
  }
  .system-container { padding: 16px 0 22px; }
}
@media (max-width: 620px) {
  .system-shell { padding: 0 12px; }
  .system-topbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .system-topbar-actions { width: 100%; justify-content: flex-start; }
  .system-user-chip { display: none; }
  .system-container { padding: 12px 0 18px; }
}


/* Request detail/payment update */
.details-list.two-col-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}
.details-list.two-col-details .section-line-title,
.details-list.two-col-details .full-span {
  grid-column: 1 / -1;
}
.details-list.two-col-details > div:not(.section-line-title) {
  min-width: 0;
}
.system-dynamic-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.payment-method-card .system-decision-form {
  gap: 14px;
}
@media (max-width: 620px) {
  .details-list.two-col-details,
  .system-dynamic-fields {
    grid-template-columns: 1fr;
  }
}

/* Polishing: separate client payment card and compact system payment form */
.request-payment-card {
  width: 100%;
}
.request-payment-card .card-head {
  margin-bottom: 12px;
}
.compact-decision-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Header profile menu, dynamic brand and footer */
.site-head-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}
.site-head-brand:hover { text-decoration: none; }
.site-head-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}
.brand-mark.compact {
  width: 30px;
  height: 30px;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
}
.profile-dropdown { position: relative; }
.profile-trigger {
  min-width: 46px;
  min-height: 34px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
}
.profile-trigger > .ti-user-circle { font-size: 1.25rem; }
.verified-mark { color: var(--success); font-size: 1.05rem; }
.profile-chevron { transition: transform .16s ease; color: var(--muted); }
.profile-dropdown.open .profile-chevron { transform: rotate(180deg); }
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 254px;
  padding: 10px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(15,23,42,.13);
  z-index: 80;
}
html[data-theme="dark"] .profile-menu { box-shadow: 0 18px 46px rgba(0,0,0,.35); }
.profile-menu-head { padding: 6px 6px 10px; }
.profile-menu-name { color: var(--text); font-weight: 500; }
.profile-menu-email { color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-verify {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.profile-menu-verify.verified { color: var(--success); }
.profile-menu-section {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  display: grid;
  gap: 2px;
}
.profile-menu-section a,
.profile-menu-section button,
.menu-inline-form,
.menu-inline-form label {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  text-decoration: none;
  text-align: left;
  width: 100%;
  padding: 5px 6px;
}
.profile-menu-section i { color: var(--muted); font-size: 1.12rem; }
.profile-menu-section a:hover,
.profile-menu-section button:hover { background: var(--panel-soft); border-radius: 10px; text-decoration: none; }
.menu-inline-form { justify-content: space-between; padding: 0 6px; }
.menu-inline-form label { padding: 0; min-height: 32px; width: auto; }
.menu-inline-form select { width: 82px; min-height: 30px; }
.menu-inline-form button { justify-content: flex-start; padding: 5px 0; }
.profile-logout-form button { justify-content: flex-start; }
.site-footer {
  margin-top: 10px;
  padding: 20px 0 26px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: start;
}
.footer-brand { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; }
.footer-brand img { width: 36px; height: 36px; object-fit: contain; }
.footer-brand > i { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); font-size: 1.45rem; }
.footer-brand div div { font-weight: 500; }
.footer-brand p { max-width: 520px; margin-top: 3px; }
.footer-links,
.footer-socials { display: flex; gap: 12px; flex-wrap: wrap; }
.footer-socials a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
@media (max-width: 760px) {
  .profile-menu { right: 0; width: min(254px, calc(100vw - 24px)); }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links, .footer-socials { justify-content: flex-start; }
}
.compact-status-form select { width: 170px; min-height: 30px; }
.compact-status-form .small-action { white-space: nowrap; }

.tab-nav { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.small-action.active { color: var(--accent); background: var(--accent-soft); }
.bulk-actions-panel { padding: 10px 0 14px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); margin-bottom: 10px; }
.audit-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 16px; align-items: end; }
.system-filter-grid .inline-form-row { align-self: end; }
.compact-table th, .compact-table td { padding: 8px 8px; }
.system-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.system-chart-box { background: var(--panel-soft); padding: 14px; border-radius: 14px; }
.system-chart-box canvas { width: 100%; display: block; }
.system-control-metrics { grid-template-columns: repeat(4, 1fr); }
.system-live-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crypto-method-icon, .asset-method-icon { width: 22px; height: 22px; object-fit: contain; display: inline-block; }
.asset-badge .asset-method-icon { flex: 0 0 20px; width: 20px; height: 20px; }
.method-grid button .crypto-method-icon { grid-row: 1 / 3; }
.status-closed { color: var(--success); }
.support-create-form { margin-top: 14px; }
.cell-sub { max-width: 260px; }
@media (max-width: 920px) {
  .audit-filter-grid, .system-chart-grid, .system-control-metrics { grid-template-columns: 1fr; }
}
.asset-pair { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.asset-mini-icon { width: 17px; height: 17px; object-fit: contain; vertical-align: -3px; }

/* Header/footer refinement */
.topbar {
  background: var(--panel);
  border-bottom: 0;
  position: relative;
  isolation: isolate;
}
.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: -1;
}
.profile-trigger {
  min-width: 38px;
  min-height: 34px;
  padding: 5px 0;
  gap: 4px;
  background: transparent;
  border-radius: 0;
}
.profile-trigger:hover { background: transparent; }
.profile-trigger > .ti-user-circle { font-size: 1.35rem; }
.verified-mark { font-size: 1rem; }
.profile-chevron { font-size: 1rem; }
.header-action {
  background: transparent;
  border-radius: 0;
  padding-left: 4px;
  padding-right: 4px;
}
.header-action.action-button,
.header-action.ghost-button {
  color: var(--text);
  background: transparent;
}
.header-action i { color: var(--muted); }
.header-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.sidebar-brand-spacer {
  min-height: 54px;
  padding: 0;
  border-bottom: 0;
}
.site-footer {
  position: relative;
  isolation: isolate;
  margin-top: 24px;
  padding: 30px 0 34px;
  border-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 28px;
  align-items: start;
  color: #ffffff;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #244f92;
  z-index: -1;
}
.footer-column { min-width: 0; }
.footer-brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.footer-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}
.footer-brand > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 1.85rem;
}
.footer-brand-name {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 500;
}
.footer-brand p {
  max-width: 680px;
  margin-top: 5px;
  color: rgba(255,255,255,.78);
}
.footer-legal {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: rgba(255,255,255,.76);
}
.footer-legal p {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: rgba(255,255,255,.76);
}
.footer-legal i { color: rgba(255,255,255,.92); font-size: 1.1rem; }
.footer-title {
  color: #ffffff;
  font-size: 1.05rem;
  margin-bottom: 12px;
}
.footer-links,
.footer-socials {
  display: grid;
  gap: 9px;
}
.footer-links a,
.footer-socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.82);
  width: max-content;
  max-width: 100%;
}
.footer-links a:hover,
.footer-socials a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-links i,
.footer-socials i {
  width: 18px;
  color: rgba(255,255,255,.92);
  font-size: 1.15rem;
}
.footer-links span,
.footer-socials span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 980px) {
  .topbar { padding-left: 0; padding-right: 0; }
  .sidebar-brand-spacer { min-height: 28px; }
}
@media (max-width: 760px) {
  .site-footer {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 26px 22px 30px;
  }
  .footer-links a,
  .footer-socials a { width: auto; }
}

/* Final layout fixes */
body { min-height: 100vh; }
.app-shell,
.system-shell { min-height: 100vh; }
.main-panel,
.system-main { display: flex; flex-direction: column; }
.content-container,
.system-container { flex: 1 0 auto; }
.sidebar,
.system-sidebar { position: relative; top: auto; align-self: start; }
.profile-trigger,
.profile-trigger:hover,
.profile-trigger:focus {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  outline: none;
}
.profile-trigger::before,
.profile-trigger::after { display: none !important; }
.system-body {
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #182235;
  --muted: #64748b;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;
  --accent: #234a84;
  --accent-soft: #e8f1ff;
  background: #eef2f6 !important;
  color: #182235 !important;
}
.site-footer { margin-top: auto; }
.footer-brand { align-items: start; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.28);
  padding-top: 13px;
  margin-top: 15px;
}
.footer-legal p.footer-legal-text {
  display: block;
  color: rgba(255,255,255,.78);
}
.footer-legal p.footer-address {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: rgba(255,255,255,.78);
}
.footer-empty-contact { color: rgba(255,255,255,.65); }
html[data-theme="dark"] .site-footer { background: #1f4682; }
html[data-theme="dark"] .topbar::before { background: var(--panel); border-bottom-color: var(--line); }
.swap-marker:hover { transform: none; }
.swap-marker.swapping i { animation: swapClickSpin .24s ease-out; }
@keyframes swapClickSpin { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }
.subject-clamp,
.one-line-cell {
  display: block;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.localized-settings-block { padding-top: 14px; margin-top: 14px; border-top: 1px solid #dfe5ec; }
.system-bars-table .bar-cell { min-width: 160px; }
.system-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.system-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #234a84;
}
.system-bar.danger span { background: #ba3030; }
.system-bar.warn span { background: #a16a00; }
.system-control-grid-wide { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.system-small-note { color: #64748b; font-size: .92rem; }
@media (max-width: 1180px) { .system-control-grid-wide { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .system-control-grid-wide { grid-template-columns: 1fr; } }
.system-chart-box { position: relative; }
.system-chart-summary { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: #64748b; font-size: .92rem; }
.system-chart-summary span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Corrections: header icon and viewport-wide bottom-aligned footer */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}
@supports not (overflow-x: clip) {
  html,
  body { overflow-x: hidden; }
}
.brand-mark.compact { background: transparent !important; border-radius: 0 !important; }
.content-container {
  padding-bottom: 0;
  min-height: 100%;
}
.site-footer {
  margin-top: auto;
  margin-bottom: 0;
  padding: 30px 0 34px;
  background: #244f92;
  overflow: visible;
  isolation: isolate;
  box-shadow: 0 0 0 100vmax #244f92;
  clip-path: inset(0 -100vmax);
}
.site-footer::before { content: none !important; display: none !important; }
html[data-theme="dark"] .site-footer {
  background: #1f4682;
  box-shadow: 0 0 0 100vmax #1f4682;
}
@media (max-width: 760px) { .site-footer { padding: 26px 0 30px; } }

/* Login page refinement */
.login-grid {
  grid-template-columns: minmax(320px, 440px) minmax(340px, 1fr);
  align-items: stretch;
  min-height: clamp(460px, calc(100vh - 210px), 620px);
}
.login-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 24px;
}
.auth-head h1 { margin-top: 2px; }
.auth-title-divider {
  height: 1px;
  width: 100%;
  margin-top: 18px;
  background: var(--line);
}
.auth-bottom {
  margin-top: auto;
  display: grid;
  gap: 14px;
}
.auth-form-stack {
  display: grid;
  gap: 10px;
  margin: 0;
}
.auth-input-field {
  margin: 0;
}
.auth-input-field input {
  font-size: 1.04rem;
}
.auth-submit {
  width: 100%;
  min-height: 38px;
  margin-top: 2px;
}
.auth-note {
  margin-top: 0;
  color: var(--muted);
  text-align: center;
}
.auth-note a {
  color: var(--text);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-market-art {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0 6px;
  overflow: hidden;
}
.login-market-art img {
  width: min(100%, 760px);
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 28px 44px rgba(15, 23, 42, .12));
}
html[data-theme="dark"] .login-market-art img {
  filter: drop-shadow(0 28px 44px rgba(0, 0, 0, .34));
}

/* Header lighter profile state */
.topbar,
.site-head-brand,
.header-action,
.profile-trigger {
  font-size: 1.04rem;
  font-weight: 400;
}
.site-head-brand,
.footer-brand-name,
.footer-brand div div {
  font-weight: 400;
}
.topbar i,
.site-head-brand i,
.header-action i,
.profile-trigger i {
  font-weight: 400;
  opacity: .84;
}
.profile-trigger {
  min-width: 0;
  min-height: 34px;
  padding: 5px 0;
  gap: 7px;
  color: var(--text);
}
.profile-trigger-name {
  display: inline-block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  color: var(--text);
}
.profile-user-icon {
  color: var(--muted);
  font-size: 1.22rem !important;
}
.profile-verify-icon {
  font-size: 1.08rem;
  opacity: 1 !important;
}
.profile-verify-icon.verified { color: var(--success); }
.profile-verify-icon.pending { color: var(--warning); }
.profile-verify-icon.unverified { color: var(--danger); }
.verified-mark { display: none; }
.profile-menu-name { font-weight: 400; }
.profile-menu-section i { font-weight: 400; opacity: .84; }

@media (max-width: 980px) {
  .login-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .login-card { min-height: 430px; }
  .login-market-art {
    min-height: 250px;
    padding-top: 0;
  }
}
@media (max-width: 620px) {
  .login-card { min-height: 390px; }
  .profile-trigger-name { max-width: 128px; }
  .profile-trigger { gap: 5px; }
  .login-market-art { min-height: 210px; }
}

.profile-menu-verify.pending { color: var(--warning); }
.profile-menu-verify.unverified { color: var(--danger); }

/* Chat, notifications, login compact refinements */
.login-grid {
  grid-template-columns: minmax(292px, 372px) minmax(260px, 560px) !important;
  align-items: stretch !important;
  justify-content: center;
  min-height: 0 !important;
  gap: 28px;
}
.login-card {
  width: 100%;
  min-height: 0 !important;
  align-self: center;
  padding: 24px 24px 22px !important;
}
.auth-head h1 { font-size: 1.7rem; }
.auth-title-divider { margin-top: 14px !important; }
.auth-bottom { margin-top: 22px !important; gap: 12px !important; }
.auth-form-stack { gap: 11px !important; }
.auth-input-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  margin: 0;
}
.auth-input-field span { font-size: 1rem; line-height: 1.2; }
.auth-input-field input {
  min-height: 38px;
  padding: 8px 0 7px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 1rem !important;
}
.auth-submit { margin-top: 4px !important; }
.login-market-art {
  align-self: stretch;
  min-height: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}
.login-market-art img {
  width: auto !important;
  max-width: 100%;
  height: 100%;
  max-height: 244px;
  object-fit: contain;
}

.pro-chat-form {
  grid-template-columns: 42px minmax(0, 1fr) auto !important;
  align-items: end;
}
.pro-chat-form textarea,
.system-pro-chat-form textarea {
  resize: none !important;
  overflow-y: auto;
  min-height: 42px;
  max-height: 150px;
}
.chat-attach-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.system-pro-chat-form .chat-attach-button { background: #234a84; color: #fff; }
.pro-chat-form.has-file .chat-attach-button { outline: 2px solid var(--success); outline-offset: 2px; }
.chat-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.request-message { position: relative; }
.chat-message-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #64748b;
  opacity: .65;
}
.chat-message-delete:hover { opacity: 1; color: #ba3030; }
.request-message:has(.chat-message-delete) { padding-right: 34px; }

.notification-bell { position: relative; }
.notification-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
}
.notification-trigger i { font-size: 1.2rem; font-weight: 400; opacity: .82; }
.notification-count {
  position: absolute;
  top: 1px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: .78rem;
  line-height: 1;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, calc(100vw - 24px));
  max-height: 420px;
  overflow-y: auto;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .12);
  border-radius: 16px;
  padding: 12px;
  z-index: 120;
}
.notification-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.notification-panel-head span { font-size: 1.05rem; }
.notification-panel-head button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
}
.notification-list { display: grid; gap: 4px; margin-top: 8px; }
.notification-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}
.notification-item:last-child { border-bottom: 0; }
.notification-item i { color: var(--muted); font-size: 1.15rem; margin-top: 1px; }
.notification-item strong,
.notification-item em {
  display: block;
  font-style: normal;
  font-weight: 400;
  line-height: 1.35;
}
.notification-item em { color: var(--muted); margin-top: 2px; }
.notification-item.unread strong { color: var(--accent); }
.notification-empty { color: var(--muted); text-align: center; padding: 18px 0; }

@media (max-width: 760px) {
  .app-shell {
    display: block !important;
    width: 100%;
    max-width: none;
    padding: 0 12px !important;
    overflow-x: hidden;
  }
  .main-panel { width: 100%; min-width: 0; }
  .content-container { width: 100%; min-width: 0; }
  .topbar { align-items: center !important; }
  .topbar-main { min-width: 0; }
  .site-head-brand span { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { flex-wrap: nowrap !important; margin-left: auto; }
  .profile-trigger-name { display: none; }
  .profile-chevron { display: none; }
  .notification-panel { right: -46px; }
  .card-head, .hero-card { gap: 10px; }
  .detail-grid, .preview-summary.large, .preview-summary, .metrics-grid, .method-grid { grid-template-columns: 1fr !important; }
  .table-wrap { overflow-x: auto; }
  .request-chat-card { min-height: 0 !important; }
  .request-chat-list, .pro-chat-list { min-height: 260px !important; max-height: 62vh; }
  .pro-chat-form { grid-template-columns: 40px minmax(0, 1fr) 42px !important; gap: 6px; }
  .pro-chat-form .action-button span,
  .pro-chat-form .system-button span { display: none; }
  .pro-chat-form .action-button,
  .pro-chat-form .system-button { width: 42px; min-width: 42px; padding: 0; }
  .chat-attach-button { width: 40px; height: 42px; }
  .login-grid { grid-template-columns: 1fr !important; gap: 18px; }
  .login-card { max-width: 370px; margin: 0 auto; }
  .login-market-art { max-width: 420px; margin: 0 auto; height: auto; }
  .login-market-art img { height: auto; max-height: 190px; }
}

/* Final client header, mobile drawer, copy controls and mobile tables */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0;
}
.profile-identity {
  position: relative;
  margin-right: clamp(28px, 8vw, 5cm);
  min-width: 0;
}
.profile-identity-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 400;
  max-width: 260px;
}
.profile-identity-trigger:hover { text-decoration: underline; text-underline-offset: 3px; }
.profile-status-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 190px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .12);
  z-index: 120;
}
.topbar-icon-cluster {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.profile-trigger,
.notification-trigger {
  width: 35px;
  height: 35px;
  min-width: 35px;
  min-height: 35px;
}
.profile-user-icon,
.profile-trigger > .ti-user-circle {
  font-size: calc(1.35rem + .5px) !important;
}
.notification-trigger i {
  font-size: calc(1.2rem + .5px) !important;
}
.profile-chevron { font-size: calc(1rem + .5px); }
.profile-verify-icon {
  font-size: calc(1.08rem + .5px);
}

.copyable-detail {
  display: grid !important;
  grid-template-columns: minmax(92px, .75fr) minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
}
.details-list .copyable-detail strong {
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}
.copy-detail-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  transition: transform .14s ease, color .14s ease, background .14s ease;
}
.copy-detail-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.copy-detail-button.copied {
  color: var(--success);
  background: rgba(31, 122, 77, .1);
  animation: copyPop .22s ease-out;
}
@keyframes copyPop {
  0% { transform: scale(.86); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@media (max-width: 980px) {
  .client-sidebar {
    position: fixed !important;
    inset: 66px auto 0 0 !important;
    top: 66px !important;
    width: min(302px, 84vw) !important;
    height: calc(100vh - 66px) !important;
    max-height: none !important;
    overflow-y: auto;
    padding: 18px 16px 22px !important;
    background: var(--panel) !important;
    box-shadow: 18px 0 52px rgba(15, 23, 42, .14);
    border-right: 1px solid var(--line);
    transform: translateX(-105%) !important;
    transition: transform .2s ease;
    z-index: 110;
  }
  .client-sidebar.open { transform: translateX(0) !important; }
  .client-sidebar-backdrop {
    position: fixed;
    inset: 66px 0 0 0;
    background: rgba(15, 23, 42, .18);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    z-index: 100;
  }
  .client-sidebar-backdrop[hidden] { display: none !important; }
  body.client-nav-open { overflow: hidden; }
  .app-shell { display: block !important; }
  .main-panel { min-height: calc(100vh - 66px); }
}

@media (max-width: 760px) {
  .profile-identity { display: none; }
  .topbar-actions { margin-left: auto; }
  .notification-panel { right: 0; transform: translateX(38px); }
  .flow-steps {
    display: block !important;
    padding: 10px 12px !important;
    background: var(--panel) !important;
  }
  .flow-steps div {
    display: none !important;
    min-height: 44px !important;
    padding: 0 !important;
  }
  .flow-steps div.active {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr);
    place-items: initial;
    align-items: center;
    justify-content: start;
    gap: 9px;
    text-align: left;
  }
  .flow-steps div::after { display: none !important; }
  .flow-steps span { box-shadow: none !important; }

  .app-shell .client-mobile-table-wrap,
  .app-shell .table-wrap {
    overflow-x: visible !important;
  }
  .app-shell .client-mobile-table-wrap table,
  .app-shell .client-mobile-table-wrap thead,
  .app-shell .client-mobile-table-wrap tbody,
  .app-shell .client-mobile-table-wrap tr,
  .app-shell .client-mobile-table-wrap td {
    display: block;
    width: 100%;
  }
  .app-shell .client-mobile-table-wrap thead { display: none; }
  .app-shell .client-mobile-table-wrap tbody {
    display: grid;
    gap: 11px;
  }
  .app-shell .client-mobile-table-wrap tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .app-shell .client-mobile-table-wrap tr:last-child { border-bottom: 0; }
  .app-shell .client-mobile-table-wrap td {
    display: grid;
    grid-template-columns: minmax(82px, .42fr) minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    border-bottom: 0;
    padding: 4px 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .app-shell .client-mobile-table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    min-width: 0;
  }
  .app-shell .client-mobile-table-wrap td[colspan] {
    display: block;
    color: var(--muted);
    text-align: center;
    padding: 16px 0;
  }
  .app-shell .client-mobile-table-wrap td[colspan]::before { content: none; }
  .app-shell .client-mobile-table-wrap .mobile-hide { display: none !important; }
  .app-shell .client-mobile-table-wrap .mobile-hide-soft { display: none !important; }
  .app-shell .client-mobile-table-wrap .mobile-action-cell {
    grid-template-columns: 1fr;
    padding-top: 8px;
  }
  .app-shell .client-mobile-table-wrap .mobile-action-cell::before { content: none; }
  .app-shell .client-mobile-table-wrap .mobile-action-cell .small-action {
    width: 100%;
    min-height: 34px;
  }
  .app-shell .client-mobile-table-wrap .asset-pair {
    white-space: normal;
    flex-wrap: wrap;
  }
  .app-shell .client-mobile-table-wrap .cell-sub,
  .app-shell .client-mobile-table-wrap .one-line-cell,
  .app-shell .client-mobile-table-wrap .subject-clamp {
    max-width: none;
    white-space: normal;
  }
  .copyable-detail {
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 4px 8px;
  }
  .copyable-detail > span {
    grid-column: 1 / -1;
  }
  .details-list .copyable-detail strong {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .site-head-brand span { max-width: 104px !important; }
  .topbar-icon-cluster { gap: 4px; }
  .notification-panel {
    width: calc(100vw - 24px);
    right: -47px;
    transform: none;
  }
}


/* Patch: header verification is static, burger icon is not a pill, request mobile nav */
.profile-identity-static {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: 260px;
  color: var(--text);
  font-weight: 400;
}
.profile-identity-trigger:hover { text-decoration: none; }
.profile-status-popover { display: none !important; }
.mobile-menu.icon-button,
button.mobile-menu {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.mobile-menu.icon-button:hover,
button.mobile-menu:hover {
  background: transparent !important;
}
.mobile-menu i {
  font-weight: 400 !important;
  opacity: .84;
}
.notification-count {
  min-width: 13px !important;
  height: 13px !important;
  padding: 0 3px !important;
  top: 3px !important;
  right: 1px !important;
  font-size: .62rem !important;
  line-height: 13px !important;
  border: 1px solid var(--panel);
}
.requests-mobile-nav-card { display: none; }

@media (max-width: 760px) {
  .requests-desktop-actions { display: none !important; }
  .requests-mobile-nav-card {
    display: grid;
    gap: 10px;
    padding: 12px !important;
  }
  .requests-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(84px, 25%));
    justify-content: start;
    gap: 8px;
  }
  .requests-mobile-tabs .small-action {
    width: 100%;
    min-height: 34px;
  }
  .requests-mobile-create {
    width: 100%;
    min-height: 38px;
  }
  .requests-mobile-nav-card + .card .card-head {
    margin-bottom: 8px;
  }
  .requests-mobile-nav-card + .card .card-head > div:first-child {
    width: 100%;
  }
}

/* Patch: verified clients are locked to verified exchange mode */
.verification-switch.locked-verified button[disabled] {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .62;
}
.verification-switch.locked-verified button[disabled]:hover {
  background: transparent;
}

/* Patch: exchange method reachability and compact mobile labels */
.exchange-description {
  min-width: 0;
}
.exchange-description span {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.method-grid button.pair-mismatch:not(.selected) {
  opacity: .72;
}
.method-grid button.pair-mismatch:not(.selected) em::after {
  content: ' · auto';
}
@media (max-width: 760px) {
  .exchange-description {
    min-height: 40px;
    padding: 9px 10px;
    justify-content: flex-start;
    text-align: left;
  }
  .exchange-description i {
    flex: 0 0 auto;
  }
  .method-grid button {
    min-height: 48px;
    grid-template-rows: auto;
  }
  .method-grid button em {
    display: none;
  }
  .method-grid button i,
  .method-grid button .crypto-method-icon {
    grid-row: 1;
  }
}

/* KYC review redesign */
.kyc-review-page { gap: 14px; }
.kyc-review-hero h1 { margin: 0; }
.kyc-review-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.kyc-review-summary > div,
.kyc-info-grid > div,
.system-inline-note {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid #dfe5ec;
}
.kyc-review-summary span,
.kyc-info-grid span,
.system-inline-note span {
  display: block;
  color: #64748b;
  margin-bottom: 4px;
}
.kyc-review-summary em,
.kyc-info-grid em,
.system-inline-note em {
  display: block;
  color: #182235;
  font-style: normal;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.kyc-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}
.kyc-review-main,
.kyc-review-side { display: grid; gap: 14px; }
.kyc-review-side { position: sticky; top: 84px; }
.kyc-document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.kyc-document-photo {
  display: block;
  color: #182235;
  text-decoration: none;
}
.kyc-document-photo img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 10px;
}
.kyc-document-photo span,
.kyc-document-photo em {
  display: block;
  margin-top: 7px;
  font-style: normal;
}
.kyc-document-photo em { color: #64748b; font-size: .92rem; }
.kyc-document-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kyc-info-grid { display: grid; gap: 10px; }
.kyc-info-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kyc-info-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kyc-info-grid.one-col { grid-template-columns: 1fr; }
.kyc-info-grid .full { grid-column: 1 / -1; }
.kyc-info-grid .wide { grid-column: span 2; }
.kyc-decision-card { display: grid; gap: 10px; }
.decision-actions-stacked { display: grid; grid-template-columns: 1fr; gap: 8px; }
.decision-actions-stacked .system-button,
.decision-actions-stacked .small-action { width: 100%; justify-content: center; }

/* Admin site control */
.site-control-stack code { color: #234a84; background: #f1f5f9; padding: 1px 4px; border-radius: 4px; }
.site-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.site-control-pane { min-width: 0; display: grid; align-content: start; gap: 10px; }
.site-control-status-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.site-control-actions { margin-top: 14px; flex-wrap: wrap; }
.system-inline-note { align-self: end; }
.system-inline-note em { color: #64748b; }
.maintenance-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.maintenance-card {
  width: min(440px, 100%);
  background: var(--panel);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
}
.maintenance-card > i { font-size: 2.2rem; color: var(--accent); margin-bottom: 10px; }
.maintenance-card h1 { margin: 8px 0; }
.maintenance-card p { color: var(--muted); }
.maintenance-card form { justify-content: center; margin-top: 18px; }

@media (max-width: 1100px) {
  .kyc-review-layout { grid-template-columns: 1fr; }
  .kyc-review-side { position: static; }
  .site-control-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .kyc-review-summary,
  .kyc-document-grid,
  .kyc-info-grid.three-cols,
  .kyc-info-grid.two-cols,
  .site-control-grid,
  .site-control-status-grid { grid-template-columns: 1fr; }
  .kyc-info-grid .wide { grid-column: 1 / -1; }
  .kyc-document-photo img { height: 210px; }
}

/* Patch: header icon size, clean copy buttons, chat line breaks, notification panel clipping */
.profile-trigger,
.notification-trigger {
  width: 37px !important;
  height: 37px !important;
  min-width: 37px !important;
  min-height: 37px !important;
}
.profile-user-icon,
.profile-trigger > .ti-user-circle {
  font-size: calc(1.45rem + .5px) !important;
}
.notification-trigger i {
  font-size: calc(1.31rem + .5px) !important;
}
.notification-count {
  min-width: 13px !important;
  height: 13px !important;
  padding: 0 3px !important;
  top: 2px !important;
  right: 1px !important;
  font-size: .61rem !important;
  line-height: 13px !important;
}
.copy-detail-button,
.copy-detail-button:hover,
.copy-detail-button.copied {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.request-message p {
  white-space: pre-wrap;
}
.notification-panel {
  max-height: none !important;
  overflow: visible !important;
}
.notification-list {
  max-height: none !important;
  overflow: visible !important;
}
.notification-item strong,
.notification-item em {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notification-item em {
  margin-top: 1px;
}
.site-status-board .detail-grid > div strong {
  overflow-wrap: anywhere;
}
.telegram-backup-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.system-check-line {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #182235;
}
.system-check-line input {
  width: 16px;
  height: 16px;
}
.site-control-log {
  display: grid;
  gap: 0;
}
.site-control-log-row {
  display: grid;
  grid-template-columns: 170px 1fr 170px 1.4fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #dfe5ec;
  min-width: 0;
}
.site-control-log-row:last-child { border-bottom: 0; }
.site-control-log-row span,
.site-control-log-row em,
.site-control-log-row small {
  color: #64748b;
  font-style: normal;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-control-log-row strong {
  color: #182235;
  font-weight: 400;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .telegram-backup-grid { grid-template-columns: 1fr; }
  .site-control-log-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

/* User profile cards: moderator/admin and client */
.user-profile-page,
.client-profile-stack { display: grid; gap: 14px; }
.user-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.user-profile-main,
.user-profile-side,
.client-profile-main,
.client-profile-side { display: grid; gap: 14px; min-width: 0; }
.user-profile-side { position: sticky; top: 84px; }
.user-status-stack { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-summary-grid,
.user-info-grid,
.profile-info-grid {
  display: grid;
  gap: 10px;
}
.user-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.user-info-grid.three-cols,
.profile-info-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.user-info-grid.two-cols,
.profile-info-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-info-grid .full,
.profile-info-grid .full { grid-column: 1 / -1; }
.user-info-grid .wide,
.profile-info-grid .wide { grid-column: span 2; }
.user-summary-grid > div,
.user-info-grid > div,
.profile-info-grid > div {
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.user-summary-grid span,
.user-info-grid span,
.profile-info-grid span {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}
.user-summary-grid em,
.user-info-grid em,
.profile-info-grid em {
  display: block;
  color: var(--text);
  font-style: normal;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.user-info-subgrid,
.profile-subgrid { margin-top: 12px; }
.user-log-list { display: grid; gap: 0; }
.user-log-row {
  display: grid;
  grid-template-columns: 160px minmax(120px, .9fr) minmax(120px, .8fr) minmax(0, 1.4fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.user-log-row:last-child { border-bottom: 0; }
.user-log-row span,
.user-log-row em,
.user-log-row small,
.user-log-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  font-style: normal;
}
.user-log-row span,
.user-log-row em,
.user-log-row small { color: var(--muted); }
.danger-action { color: var(--danger) !important; }
.compact-user-table td,
.compact-user-table th { vertical-align: middle; }
.client-profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.client-profile-side { position: sticky; top: 84px; }
.client-profile-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; }
.no-border-line { border-bottom: 0; }

/* Fix notification overflow: clamp against panel right edge */
.notification-panel,
.notification-list,
.notification-item,
.notification-item > span {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
.notification-panel {
  overflow: visible !important;
}
.notification-item {
  grid-template-columns: 24px minmax(0, 1fr) !important;
  width: 100%;
  overflow: hidden;
}
.notification-item > span {
  display: block;
  overflow: hidden;
}
.notification-item strong,
.notification-item em {
  max-width: 100%;
  overflow: hidden !important;
  word-break: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .user-profile-layout,
  .client-profile-grid { grid-template-columns: 1fr; }
  .user-profile-side,
  .client-profile-side { position: static; }
  .user-summary-grid,
  .client-profile-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .user-summary-grid,
  .user-info-grid.three-cols,
  .user-info-grid.two-cols,
  .profile-info-grid.three-cols,
  .profile-info-grid.two-cols,
  .client-profile-metrics { grid-template-columns: 1fr; }
  .user-info-grid .wide,
  .profile-info-grid .wide { grid-column: 1 / -1; }
  .user-log-row { grid-template-columns: 1fr; gap: 3px; }
  .client-profile-hero .card-head { align-items: flex-start; }
}

/* Hotfix: notification dropdown layout after overflow clamp */
.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.notification-panel {
  width: 340px !important;
  max-width: min(340px, calc(100vw - 24px)) !important;
  min-width: 300px !important;
  overflow: hidden !important;
  max-height: none !important;
}
.notification-panel-head {
  width: 100%;
  min-width: 0;
}
.notification-list {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: visible !important;
}
.notification-item {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  gap: 9px !important;
  align-items: start !important;
  overflow: hidden !important;
}
.notification-item > i,
.notification-item > .ti {
  grid-column: 1;
  width: 22px;
  min-width: 22px;
  text-align: center;
  margin-top: 2px;
}
.notification-item > span {
  grid-column: 2;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
}
.notification-item strong,
.notification-item em {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}
.notification-empty {
  width: 100%;
  min-width: 0;
}
@media (max-width: 760px) {
  .notification-panel {
    right: 0 !important;
    transform: translateX(18px) !important;
    width: min(340px, calc(100vw - 24px)) !important;
    min-width: min(300px, calc(100vw - 24px)) !important;
  }
}
@media (max-width: 420px) {
  .notification-panel {
    right: -4px !important;
    transform: none !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 0 !important;
  }
}


/* Final header/profile/user-card polish */
.notification-trigger,
.profile-trigger {
  width: 37px !important;
  height: 37px !important;
  min-width: 37px !important;
  min-height: 37px !important;
}
.notification-trigger i {
  font-size: calc(1.42rem + .5px) !important;
}
.profile-user-icon,
.profile-trigger > .ti-user-circle {
  font-size: calc(1.54rem + .5px) !important;
}
.notification-count {
  min-width: 13px !important;
  height: 13px !important;
  line-height: 13px !important;
  top: 1px !important;
  right: 0 !important;
}

.notification-panel {
  width: 350px !important;
  max-width: min(350px, calc(100vw - 24px)) !important;
}
.notification-item,
.notification-item > span,
.notification-item strong,
.notification-item em {
  min-width: 0 !important;
  max-width: 100% !important;
}
.notification-item strong,
.notification-item em {
  overflow-wrap: normal !important;
  word-break: normal !important;
}
.notification-item strong {
  -webkit-line-clamp: 1 !important;
}
.notification-item em {
  -webkit-line-clamp: 2 !important;
}
@media (max-width: 420px) {
  .notification-panel {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }
}

.action-reason-note {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}
.action-reason-note > div {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.action-reason-note i {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.25;
}
.profile-activity-list {
  display: grid;
  gap: 8px;
}
.profile-activity-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(130px, .7fr);
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}
.profile-activity-row:last-child { border-bottom: 0; }
.profile-activity-row span,
.profile-activity-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}
.profile-activity-row strong,
.profile-activity-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .profile-activity-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .client-profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Final profile/header/homepage polish */
@media (min-width: 1101px) {
  .client-profile-metrics.metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .client-profile-side {
    position: static !important;
    top: auto !important;
    align-self: start;
    overflow: visible !important;
    max-height: none !important;
  }
}
.client-profile-side,
.client-profile-side .card {
  overflow: visible !important;
}
.topbar-icon-cluster {
  gap: 8px;
}
.notification-trigger,
.profile-trigger {
  background: transparent !important;
  color: var(--muted) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.notification-trigger i,
.profile-user-icon,
.profile-trigger .profile-user-icon {
  color: var(--muted) !important;
  opacity: .9 !important;
  font-size: calc(1.5rem + .5px) !important;
  font-weight: 400 !important;
  line-height: 1;
}
.notification-trigger:hover i,
.profile-trigger:hover .profile-user-icon,
.notification-trigger:focus-visible i,
.profile-trigger:focus-visible .profile-user-icon {
  color: var(--accent) !important;
  opacity: 1 !important;
}
.profile-chevron {
  color: var(--muted) !important;
  opacity: .72 !important;
  font-size: 1rem !important;
}
.notification-count {
  top: 0 !important;
  right: -1px !important;
}

/* Unified request filters and close confirmation */
.system-filter-card .system-card-head {
  margin-bottom: 10px;
}
.request-filter-form .filter-search-field {
  grid-column: span 2;
}
.filter-actions-row {
  align-self: end;
  justify-content: flex-start;
}
.system-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .42);
}
.system-modal-backdrop[hidden] {
  display: none;
}
.system-modal-box {
  width: min(480px, 100%);
  background: #fff;
  color: #182235;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 24px 58px rgba(15, 23, 42, .2);
}
.system-modal-box h2 {
  margin: 0 0 8px;
  font-weight: 500;
}
.system-modal-box p {
  color: #516074;
  line-height: 1.5;
}
.modal-actions-row {
  justify-content: flex-end;
  margin-top: 16px;
}


@media (max-width: 820px) {
  .request-filter-form .filter-search-field {
    grid-column: span 2;
  }
}
@media (max-width: 620px) {
  .request-filter-form .filter-search-field {
    grid-column: auto;
  }
  .filter-actions-row,
  .modal-actions-row {
    align-items: stretch;
  }
  .filter-actions-row .small-action,
  .modal-actions-row .small-action,
  .modal-actions-row .system-button {
    width: 100%;
    justify-content: center;
  }
}

/* Account restrictions, closed account page and final action/header refinements */
.account-restriction-card,
.system-restriction-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.account-restriction-card h2,
.system-restriction-card h2,
.closed-account-card h1 {
  margin: 0 0 6px;
  font-weight: 500;
}
.account-restriction-card p,
.system-restriction-card p,
.closed-account-card p {
  margin: 0;
  color: var(--muted);
}
.account-restriction-card .muted-text,
.closed-account-card .muted-text {
  margin-top: 6px;
}
.account-restriction-icon,
.system-restriction-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.account-restriction-icon i,
.system-restriction-icon i {
  font-size: 1.75rem;
}
.system-restriction-card {
  background: #ffffff;
  color: #182235;
}
.system-restriction-card p {
  color: #6b778c;
}
.system-restriction-icon {
  color: #234a84;
}
.system-restriction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 9px;
  color: #6b778c;
}
.exchange-calculator-card button[disabled],
.exchange-calculator-card button[aria-disabled="true"] {
  opacity: .64;
  cursor: not-allowed;
}
.closed-account-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 24px;
  background: var(--bg);
  color: var(--text);
}
.closed-account-topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.closed-account-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px 0;
}
.closed-account-card {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.closed-account-contact {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 12px !important;
}
.closed-account-contact i {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 1px;
}
.user-profile-side {
  position: static !important;
  top: auto !important;
  overflow: visible !important;
  max-height: none !important;
}
.user-profile-side,
.user-profile-side .system-card {
  overflow: visible !important;
}
.notification-trigger,
.profile-trigger {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
}
.notification-trigger i,
.profile-user-icon,
.profile-trigger .profile-user-icon {
  font-size: 1.24rem !important;
}
.profile-chevron {
  font-size: .86rem !important;
}
.notification-count {
  top: 0 !important;
  right: -1px !important;
}
@media (max-width: 620px) {
  .account-restriction-card,
  .system-restriction-card,
  .closed-account-card {
    grid-template-columns: 1fr;
  }
  .closed-account-shell { padding: 0 14px; }
}


/* Users filter and AML restriction visibility */
.user-filter-form .filter-search-field {
  grid-column: span 2;
}
.account-state-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #182235;
  line-height: 1.25;
}
.account-state-inline i {
  color: #64748b;
  font-size: 1.08rem;
}
.account-state-inline span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-state-inline.account-warning,
.account-state-inline.account-warning i {
  color: #a16a00;
}
.account-state-inline.account-warning span,
.account-state-inline.account-closed span {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.account-state-inline.account-closed,
.account-state-inline.account-closed i {
  color: #9b1c1c;
}
.account-state-inline.account-disabled,
.account-state-inline.account-disabled i {
  color: #64748b;
}
.restriction-cell-sub {
  margin-top: 4px;
}
.user-row-restricted td {
  background: transparent;
}
.account-restriction-card.account-restriction-frozen .account-restriction-icon,
.account-restriction-card.account-restriction-frozen .account-restriction-icon i,
.system-restriction-card.system-restriction-frozen .system-restriction-icon,
.system-restriction-card.system-restriction-frozen .system-restriction-icon i {
  color: #a16a00 !important;
}
.account-restriction-card.account-restriction-frozen h2,
.system-restriction-card.system-restriction-frozen h2 {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.account-restriction-card.account-restriction-frozen .section-kicker {
  color: #a16a00;
}
.restriction-warning-line {
  display: inline-grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  margin-top: 9px;
  padding-top: 8px;
  color: #a16a00;
  border-top: 1px solid var(--line-soft);
}
.restriction-warning-line i {
  font-size: 1.08rem;
  margin-top: 1px;
}
.restriction-warning-line span {
  min-width: 0;
  line-height: 1.4;
}
.notification-item.notification-account > i,
.notification-item.notification-account > .ti {
  color: #a16a00 !important;
}
.notification-item.notification-account strong {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
@media (max-width: 620px) {
  .user-filter-form .filter-search-field {
    grid-column: auto;
  }
}

/* Final login/register auth polish */
.login-grid {
  grid-template-columns: minmax(300px, 380px) minmax(320px, 560px) !important;
  align-items: stretch !important;
  justify-content: center;
  gap: 28px;
}
.login-card {
  width: 100%;
  min-height: 0 !important;
  align-self: stretch !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 24px 22px !important;
}
.login-form {
  gap: 11px !important;
}
.login-form .field-label {
  margin-bottom: 3px;
  color: var(--muted);
}
.login-form input {
  min-height: 36px;
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 1rem;
}
.login-form input:focus {
  border-bottom-color: var(--accent);
}
.login-card .auth-note {
  margin-top: 0 !important;
  text-align: center;
}
.auth-grid.single .auth-note {
  margin-top: 18px !important;
  text-align: center;
}
.login-market-art {
  align-self: stretch !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  overflow: visible;
}
.login-market-art img {
  display: block;
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 22px 34px rgba(15, 23, 42, .10));
}
html[data-theme="dark"] .login-market-art img {
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .28));
}
@media (max-width: 760px) {
  .login-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .login-card {
    max-width: 420px;
    margin: 0 auto;
    align-self: center !important;
  }
  .login-market-art {
    display: none !important;
  }
}

.logo-reset-block {
  margin: 18px 0 20px;
}

.logo-reset-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.logo-reset-preview {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.logo-reset-preview img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  display: block;
}

.logo-reset-title {
  font-size: .94rem;
  color: var(--text);
}

.logo-reset-info p {
  margin-top: 4px;
}

.logo-reset-form {
  justify-content: flex-end;
}

.logo-reset-form .small-action:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .logo-reset-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .logo-reset-form {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .logo-reset-form .small-action {
    width: 100%;
  }
}


/* Login page: centered card without market artwork */
.login-single {
  grid-template-columns: minmax(300px, 460px) !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0 !important;
  min-height: clamp(360px, calc(100vh - 300px), 520px) !important;
}
.login-single .login-card {
  width: 100%;
  max-width: 460px;
  min-height: 0 !important;
  align-self: center !important;
  justify-content: flex-start !important;
  padding: 26px 24px !important;
}
.login-single .login-form {
  margin-top: 18px;
  gap: 12px !important;
}
.login-single .auth-submit {
  width: 100%;
  margin-top: 4px !important;
}
.login-single .auth-note {
  margin-top: 16px !important;
  text-align: center;
}
.login-market-art {
  display: none !important;
}
@media (max-width: 760px) {
  .login-single {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .login-single .login-card {
    max-width: 100%;
    margin: 0 auto;
  }
}

/* Site settings: logo + favicon reset preview */
.logo-reset-preview-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-reset-main-preview {
  width: 50px;
  height: 50px;
}
.logo-reset-favicon-preview {
  width: 32px;
  height: 32px;
  background: #eef2f6;
}
.logo-reset-favicon-preview img {
  max-width: 32px;
  max-height: 32px;
}
@media (max-width: 720px) {
  .logo-reset-preview-pair {
    grid-column: auto;
  }
}

/* Footer typography: keep footer visually lighter */
.site-footer,
.site-footer p,
.site-footer a,
.site-footer span,
.site-footer div,
.footer-brand-name,
.footer-title,
.footer-empty-contact,
.footer-legal p,
.footer-links a,
.footer-socials a {
  font-weight: 400 !important;
}
.footer-title,
.footer-brand-name {
  letter-spacing: 0;
}

/* Reviews pagination and preview clamp */
.review-preview-card {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.review-preview-card:hover { text-decoration: none; }
.review-text-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.review-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.review-pagination .ghost-button:first-child { justify-self: start; }
.review-pagination .ghost-button:last-child { justify-self: end; }
.review-page-state {
  color: var(--muted);
  font-size: .95rem;
  white-space: nowrap;
}
.review-form-card { margin-top: 12px; }

/* Dark footer: match the header surface and keep the light theme unchanged. */
html[data-theme="dark"] .site-footer {
  background: var(--panel);
  box-shadow: 0 0 0 100vmax var(--panel);
  border-top: 1px solid var(--line);
  color: var(--text);
}
html[data-theme="dark"] .site-footer::before {
  content: '' !important;
  display: block !important;
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  transform: translateX(-50%);
  background: var(--line);
  z-index: 0;
}
html[data-theme="dark"] .footer-brand-name,
html[data-theme="dark"] .footer-title {
  color: var(--text);
}
html[data-theme="dark"] .footer-brand p,
html[data-theme="dark"] .footer-legal,
html[data-theme="dark"] .footer-legal p,
html[data-theme="dark"] .footer-links a,
html[data-theme="dark"] .footer-socials a,
html[data-theme="dark"] .footer-empty-contact {
  color: var(--muted);
}
html[data-theme="dark"] .footer-links a:hover,
html[data-theme="dark"] .footer-socials a:hover {
  color: var(--text);
}
html[data-theme="dark"] .footer-brand > i,
html[data-theme="dark"] .footer-legal i,
html[data-theme="dark"] .footer-links i,
html[data-theme="dark"] .footer-socials i {
  color: var(--text);
}
html[data-theme="dark"] .footer-legal {
  border-top-color: var(--line);
}
