:root {
  --brand-primary: #e41f35;
  --brand-accent: #ff7a3d;
  --ink: #18202a;
  --ink-soft: #344253;
  --muted: #697586;
  --line: #dfe4ea;
  --line-strong: #cbd3dc;
  --panel: #ffffff;
  --panel-soft: #f7f8fa;
  --bg: #f2f4f7;
  --nav: #15171c;
  --nav-soft: #23262d;
  --danger: #b42336;
  --warning: #8a5700;
  --success: #176b47;
  --info: #245d91;
  --focus: #155eef;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 12px 32px rgba(16, 24, 40, .08);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
body.nav-open { overflow: hidden; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, .button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 16px;
  color: #eef0f4;
  background:
    radial-gradient(circle at 0 0, rgba(228, 31, 53, .16), transparent 34%),
    linear-gradient(180deg, var(--nav), #101116 75%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-head { display: flex; align-items: flex-start; gap: 8px; }
.brand { display: grid; gap: 7px; min-width: 0; padding: 4px 8px 22px; text-decoration: none; }
.brand-logo { width: 190px; height: 46px; object-fit: contain; object-position: left center; }
.brand-descriptor { color: #aab0bb; font-size: .69rem; letter-spacing: .065em; text-transform: uppercase; }
.sidebar-close { display: none; margin-left: auto; }
.sidebar nav { display: grid; gap: 3px; overflow-y: auto; padding-right: 2px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #b9c0ca;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(228,31,53,.22), rgba(255,122,61,.08));
  border-color: rgba(255,255,255,.08);
  box-shadow: inset 3px 0 0 var(--brand-primary);
}
.nav-group-label {
  padding: 18px 12px 7px;
  color: #747d8a;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-count, .notification-count {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
}
.sidebar-footer {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 18px 10px 2px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.sidebar-footer small { color: #929aa6; overflow-wrap: anywhere; }
.role-pill { color: #ff9a72; font-size: .67rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.link-button { padding: 8px 0 0; border: 0; background: none; color: #fff; text-align: left; cursor: pointer; }

.mobile-header { display: none; }
.sidebar-scrim { display: none; }

.main { width: 100%; max-width: 1580px; padding: 30px 38px 64px; }
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.topbar h1 { margin: 4px 0 0; font-size: clamp(1.55rem, 2.3vw, 2rem); letter-spacing: -.035em; }
.eyebrow { color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.security-badge, .notification-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  font-size: .78rem;
  font-weight: 750;
  text-decoration: none;
}
.security-dot { width: 8px; height: 8px; border-radius: 999px; background: #22a06b; box-shadow: 0 0 0 4px #e5f6ef; }
.notification-button:hover { border-color: var(--line-strong); }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .78fr); gap: 18px; }
.stack { display: grid; gap: 14px; }

.card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.card.emphasis { border-color: #f3bdc4; box-shadow: 0 14px 30px rgba(228,31,53,.08); }
.card h2, .card h3 { margin: 0 0 14px; letter-spacing: -.025em; }
.card h2 { font-size: 1.15rem; }
.card h3 { font-size: 1rem; }
.metric { position: relative; overflow: hidden; padding: 18px; }
.metric::after { content: ""; position: absolute; top: 0; right: 0; width: 58px; height: 4px; background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent)); }
.metric .label { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.metric .value { margin-top: 7px; font-size: 1.85rem; font-weight: 800; letter-spacing: -.04em; }
.metric .sub { margin-top: 4px; color: var(--muted); font-size: .8rem; }

.metric[href] { color: inherit; text-decoration: none; }
.metric[href]:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.release-label { margin-top: 3px; font-size: .66rem; }
.control-list { display: grid; gap: 10px; margin: 14px 0; padding-left: 21px; color: var(--ink-soft); }
.account-card .balance-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.toolbar form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; font-size: 1.12rem; letter-spacing: -.025em; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }

.button, button:not(.link-button):not(.icon-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-primary), #c9192e);
  color: #fff;
  font-size: .84rem;
  font-weight: 760;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(180,35,54,.15);
}
.button:hover, button:not(.link-button):not(.icon-button):hover { filter: brightness(.96); }
.button.secondary, button.secondary { border-color: var(--line); background: #f2f4f7; color: var(--ink); box-shadow: none; }
.button.danger, button.danger { background: var(--danger); color: #fff; }
.button.warning, button.warning { background: #9b6500; color: #fff; }
.button.ghost, button.ghost { border-color: var(--line); background: transparent; color: var(--ink); box-shadow: none; }
.button.small, button.small { min-height: 32px; padding: 6px 10px; font-size: .75rem; }
.button[disabled], button[disabled] { opacity: .58; cursor: not-allowed; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; background: #fff; }
caption { padding: 12px 14px; color: var(--muted); font-size: .82rem; text-align: left; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .84rem; text-align: left; vertical-align: top; }
th { background: #f8f9fb; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
.amount { font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1f5;
  color: #44546a;
  font-size: .68rem;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}
.status.executed, .status.approved, .status.active, .status.matched { background: #e8f6ef; color: var(--success); }
.status.rejected, .status.failed, .status.closed, .status.exception { background: #fcebed; color: var(--danger); }
.status.needs_documents, .status.frozen, .status.more_info_required, .status.execution_pending { background: #fff3dc; color: var(--warning); }
.status.submitted, .status.active_review, .status.preliminary_passed, .status.under_review { background: #eaf2fb; color: var(--info); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink-soft); font-size: .78rem; font-weight: 760; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 105px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #9ba7b5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(21,94,239,.12); outline: none; }
.field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180,35,54,.09); }
.field small, .field-help { color: var(--muted); font-size: .76rem; }
.field-error { color: var(--danger); font-size: .77rem; font-weight: 650; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.error-summary { margin-bottom: 18px; padding: 14px 16px; border: 1px solid #efb8c0; border-left: 4px solid var(--danger); border-radius: 10px; background: #fff4f5; }
.error-summary h2 { margin: 0 0 6px; font-size: 1rem; }
.error-summary ul, .error-list { margin: 6px 0 0; padding-left: 20px; }

.alert { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f4f6f8; color: var(--ink-soft); font-size: .86rem; }
.alert.success { border-color: #b7dfca; background: #ebf8f1; color: var(--success); }
.alert.error { border-color: #efbcc3; background: #fff0f2; color: var(--danger); }
.alert.warning { border-color: #ead19b; background: #fff7e8; color: var(--warning); }
.alert.info { border-color: #c9dced; background: #eef5fb; color: var(--info); }
.help { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.right { text-align: right; }
.empty { padding: 30px; color: var(--muted); text-align: center; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.detail-list { display: grid; grid-template-columns: 175px minmax(0,1fr); gap: 10px 16px; margin: 0; font-size: .86rem; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.detail-section { padding-top: 16px; border-top: 1px solid var(--line); }
.detail-section:first-of-type { padding-top: 0; border-top: 0; }
.key-value-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.key-value { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.key-value span, .key-value strong { display: block; }
.key-value span { color: var(--muted); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.key-value strong { margin-top: 4px; font-size: .88rem; overflow-wrap: anywhere; }

.balance-card { color: #fff; background: linear-gradient(145deg, #252830, #15171c 70%); border-color: rgba(255,255,255,.08); box-shadow: var(--shadow); }
.balance-card .currency { color: #b8bec8; font-size: .78rem; }
.balance-card .big { margin: 8px 0 15px; font-size: 2rem; font-weight: 800; letter-spacing: -.035em; }
.bucket-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.bucket { padding: 9px; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; background: rgba(255,255,255,.06); }
.bucket span, .bucket strong { display: block; }
.bucket span { color: #aeb5bf; font-size: .62rem; text-transform: uppercase; }
.bucket strong { margin-top: 3px; font-size: .8rem; }

.timeline { display: grid; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 10px; min-height: 54px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 17px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline-dot { z-index: 1; width: 16px; height: 16px; margin-top: 2px; border: 3px solid #fff; border-radius: 999px; background: #aab4c0; box-shadow: 0 0 0 1px var(--line-strong); }
.timeline li.complete .timeline-dot { background: var(--success); }
.timeline li.current .timeline-dot { background: var(--brand-primary); }
.timeline strong, .timeline span { display: block; }
.timeline span { margin-top: 2px; color: var(--muted); font-size: .76rem; }

.stepper { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; margin-bottom: 18px; }
.step { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: .72rem; font-weight: 700; text-align: center; }
.step.complete { border-color: #b7dfca; background: #eef9f3; color: var(--success); }
.step.current { border-color: #efb8c0; background: #fff2f4; color: var(--danger); }
.progress-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #e9edf2; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent)); }

.review-summary { display: grid; gap: 14px; }
.total-panel { padding: 18px; border: 1px solid #efbcc3; border-radius: 12px; background: linear-gradient(135deg, #fff5f6, #fffaf7); }
.total-line { display: flex; justify-content: space-between; gap: 18px; padding: 6px 0; }
.total-line.total { margin-top: 8px; padding-top: 13px; border-top: 1px solid #efc8ce; font-size: 1.08rem; font-weight: 800; }
.masked { letter-spacing: .06em; }
.copy-row { display: flex; align-items: center; gap: 8px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pagination .page-meta { color: var(--muted); font-size: .8rem; }

.auth-main { display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(460px, .95fr); min-height: 100vh; }
.auth-brand-panel {
  display: grid;
  place-items: center;
  padding: 54px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 12%, rgba(228,31,53,.36), transparent 34%),
    radial-gradient(circle at 92% 85%, rgba(255,122,61,.17), transparent 32%),
    linear-gradient(145deg, #17191f, #0c0d11);
}
.auth-brand-content { max-width: 540px; }
.auth-logo { width: min(430px, 100%); height: auto; }
.auth-brand-content h1 { margin: 34px 0 12px; font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.05em; }
.auth-brand-content p { max-width: 500px; color: #c4c9d1; font-size: 1.05rem; line-height: 1.65; }
.security-note { margin-top: 30px; padding: 15px 17px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.06); color: #e6e8ec; }
.auth-form-panel { display: grid; align-content: center; padding: 50px clamp(28px, 8vw, 100px); background: #fff; }
.auth-card { width: 100%; max-width: 500px; }
.auth-card h2 { margin: 0 0 8px; font-size: 2rem; letter-spacing: -.045em; }
.auth-card .subtitle { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.auth-card form { display: grid; gap: 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: .84rem; }
.qr { width: 210px; height: 210px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.code-box { padding: 10px; border-radius: 8px; background: #f1f3f6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { margin-top: 4px; }

.confirm-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 70px rgba(16,24,40,.26); }
.confirm-dialog::backdrop { background: rgba(15,17,22,.66); backdrop-filter: blur(2px); }
.confirm-dialog form { padding: 22px; }
.confirm-dialog h2 { margin: 5px 0 8px; }
.confirm-dialog p { margin: 0 0 22px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.error-state { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 20px; max-width: 820px; }
.error-code { color: #e7eaf0; font-size: 4rem; font-weight: 900; line-height: 1; }

[data-method-fields][hidden] { display: none !important; }
details { border-radius: 10px; }
summary { cursor: pointer; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 232px minmax(0,1fr); }
  .main { padding: 28px 24px 56px; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 780px) {
  .app-shell { display: block; }
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: 44px minmax(0,1fr) 44px;
    align-items: center;
    gap: 8px;
    min-height: 62px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
  }
  .mobile-brand { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; font-weight: 800; text-decoration: none; }
  .mobile-brand img { width: 34px; height: 34px; object-fit: contain; }
  .notification-link { position: relative; text-decoration: none; }
  .notification-link > span:first-child { color: var(--brand-primary); }
  .notification-link .notification-count { position: absolute; top: -6px; right: -5px; }
  .mobile-role { color: var(--muted); font-size: .66rem; font-weight: 800; text-align: right; text-transform: uppercase; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(310px, 88vw);
    height: 100dvh;
    transform: translateX(-104%);
    transition: transform .22s ease;
    box-shadow: 24px 0 60px rgba(0,0,0,.28);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: inline-grid; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.07); color: #fff; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 50; display: block; background: rgba(15,17,22,.62); }
  .sidebar-scrim[hidden] { display: none; }
  .main { padding: 22px 14px 48px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-grid, .form-grid.cols-3, .key-value-grid { grid-template-columns: 1fr; }
  .bucket-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-list { grid-template-columns: 1fr; gap: 3px; }
  .detail-list dd { margin-bottom: 9px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar form { width: 100%; }
  .toolbar form > * { flex: 1 1 140px; }
  .form-actions { position: sticky; bottom: 0; z-index: 10; margin: 18px -14px -20px; padding: 12px 14px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
  .form-actions .button, .form-actions button { flex: 1; }
  .stepper { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination .badge-row { justify-content: space-between; }
  .error-state { grid-template-columns: 1fr; }
  .error-code { font-size: 3rem; }
  .table-wrap[data-mobile-cards] { overflow: visible; border: 0; background: transparent; }
  .table-wrap[data-mobile-cards] table, .table-wrap[data-mobile-cards] thead, .table-wrap[data-mobile-cards] tbody, .table-wrap[data-mobile-cards] tr, .table-wrap[data-mobile-cards] td { display: block; width: 100%; }
  .table-wrap[data-mobile-cards] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap[data-mobile-cards] tr { margin-bottom: 12px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
  .table-wrap[data-mobile-cards] td { display: grid; grid-template-columns: minmax(105px,.75fr) minmax(0,1.25fr); gap: 12px; padding: 7px 0; border: 0; }
  .table-wrap[data-mobile-cards] td::before { content: attr(data-label); color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .table-wrap[data-mobile-cards] td.empty { display: block; }
}

@media (max-width: 640px) {
  .auth-main { display: block; min-height: 100vh; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; padding: 34px 20px; }
  .auth-links { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* v1.6.2 customer identity, localization and account-detail refinements */
.organization-name {
  display: -webkit-box;
  overflow: hidden;
  color: #ffb09a;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.language-picker { display: flex; align-items: center; gap: 7px; min-width: 0; }
.language-picker select {
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 32px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: .78rem;
}
.sidebar-language { margin: 8px 0 3px; }
.sidebar-language select { width: 100%; border-color: rgba(255,255,255,.16); background: #24272e; color: #f3f4f6; }
.sidebar-language .language-apply { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; }
.auth-language-bar { display: flex; justify-content: flex-end; width: 100%; max-width: 500px; margin: 0 0 26px; }
.auth-language select { min-width: 190px; }
.js .language-picker .language-apply { display: none; }

/* The account-detail card uses a light surface, so explicitly use dark text. */
.account-card .balance-card {
  color: var(--ink);
  background: linear-gradient(145deg, #fbfcfd, #f3f5f8 72%);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.account-card .balance-card .currency { color: var(--muted); }
.account-card .balance-card .bucket { border-color: var(--line); background: rgba(255,255,255,.82); }
.account-card .balance-card .bucket span { color: var(--muted); }
.account-card .balance-card .bucket strong { color: var(--ink); }

[dir="rtl"] body { text-align: right; }
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid rgba(255,255,255,.06); }
[dir="rtl"] .brand-logo { object-position: right center; }
[dir="rtl"] .link-button, [dir="rtl"] th, [dir="rtl"] td, [dir="rtl"] caption { text-align: right; }
[dir="rtl"] .sidebar nav a.active { box-shadow: inset -3px 0 0 var(--brand-primary); }
[dir="rtl"] .topbar, [dir="rtl"] .toolbar, [dir="rtl"] .section-title, [dir="rtl"] .total-line { direction: rtl; }
[dir="rtl"] .language-picker select { padding-right: 10px; padding-left: 32px; }
[dir="rtl"] .timeline li { grid-template-columns: minmax(0,1fr) 18px; }
[dir="rtl"] .timeline li::before { right: auto; left: auto; inset-inline-end: 7px; }

@media (max-width: 640px) {
  .auth-language-bar { margin-bottom: 20px; }
  .auth-language { width: 100%; }
  .auth-language select { width: 100%; }
}

/* v1.6.3 staged customer KYC onboarding */
.kyc-toolbar { margin-bottom: 18px; }
.kyc-save-note { display: grid; gap: 2px; max-width: 390px; color: var(--muted); font-size: .78rem; text-align: right; }
.kyc-save-note strong { color: var(--ink); }
.kyc-progress-card { margin-bottom: 14px; padding: 18px 20px; }
.kyc-progress-card h2 { margin: 3px 0 0; font-size: 1.16rem; }
.kyc-stepper { margin-bottom: 20px; }
.kyc-stepper .step { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 52px; text-decoration: none; }
.kyc-stepper .step-number { display: inline-grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; border: 1px solid currentColor; border-radius: 999px; font-size: .66rem; }
.kyc-stepper .step.locked { border-style: dashed; background: #f7f8fa; color: #9aa2ad; cursor: not-allowed; }
.kyc-stepper .step.current { box-shadow: inset 0 0 0 1px rgba(228,31,53,.08); }
.kyc-step-card { padding: clamp(20px, 3vw, 32px); }
.kyc-step-heading { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,.65fr); align-items: end; gap: 28px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.kyc-step-heading h2 { margin: 4px 0 0; }
.kyc-step-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.kyc-context-grid { margin-bottom: 22px; }
.kyc-form-section { margin-top: 4px; }
.kyc-requirement-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.kyc-subsection { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.kyc-subsection h3 { margin: 0 0 16px; }
.kyc-wizard-actions { justify-content: space-between; padding-top: 4px; }
.kyc-wizard-actions .help { margin-right: auto; }
.kyc-missing-list { margin: 16px 0; padding: 14px 16px; border: 1px solid #efc4ca; border-radius: 10px; background: #fff6f7; }
.kyc-missing-list ul { margin: 8px 0 0; padding-left: 20px; }
.kyc-document-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.kyc-document-list small { display: block; margin-top: 5px; }
.kyc-review-summary { gap: 20px; }
.kyc-review-section { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.kyc-review-section h3 { margin: 0; }
.kyc-review-section > .toolbar { margin-bottom: 14px; }

[dir="rtl"] .kyc-save-note { text-align: left; }
[dir="rtl"] .kyc-wizard-actions .help { margin-right: 0; margin-left: auto; }

@media (max-width: 780px) {
  .kyc-save-note { max-width: none; text-align: left; }
  .kyc-step-heading { grid-template-columns: 1fr; gap: 8px; }
  .kyc-document-list { grid-template-columns: 1fr; }
  .kyc-stepper .step { justify-content: flex-start; text-align: left; }
  .kyc-subsection .form-actions { position: static; margin: 16px 0 0; padding: 0; border-top: 0; background: transparent; backdrop-filter: none; }
  .kyc-wizard-actions { align-items: stretch; }
  .kyc-wizard-actions .help { width: 100%; }
}
