:root {
  --blue: #0f46cf;
  --blue-strong: #0835a9;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dfec;
  --surface: #ffffff;
  --ground: #f4f7fc;
  --pink: #ff3376;
  --green: #157a48;
  --amber: #b36500;
  --red: #ba2739;
  --shadow: 0 14px 34px rgba(30, 48, 81, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--ground);
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body { min-width: 320px; margin: 0; background: var(--ground); color: var(--ink); }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: 4px; background: var(--ink); color: white; text-decoration: none; }
.skip-link:focus-visible { top: 16px; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0 0 0 0); white-space: nowrap; }
.content-frame { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; line-height: 1.25; }
.muted { color: var(--muted); }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 27px; height: 33px; fill: var(--blue); }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 19px; line-height: 1; }
.brand small { color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.2; text-transform: uppercase; }
.public-header { position: relative; z-index: 2; border-bottom: 1px solid rgba(216, 223, 236, 0.8); background: rgba(255, 255, 255, 0.96); }
.public-header .content-frame { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; }
.public-header nav, .workspace-actions { display: flex; align-items: center; gap: 18px; }
.text-link, .text-button { border: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.text-link:hover, .text-button:hover { color: var(--blue); }
.language-switch { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 2px; }
.language-button { min-width: 35px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 28px; }
.language-button.is-selected { background: var(--ink); color: white; }
.language-button:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(15, 70, 207, .34); outline-offset: 2px; }
.primary-button, .secondary-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 13px; border-radius: 5px; padding: 0 18px; font-size: 14px; font-weight: 800; text-decoration: none; }
.primary-button { border: 1px solid var(--blue); background: var(--blue); color: white; }
.primary-button:hover { border-color: var(--blue-strong); background: var(--blue-strong); }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }

.about-intro { overflow: hidden; background: white; border-bottom: 1px solid var(--line); }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 40px; min-height: 440px; align-items: center; padding: 70px 0 62px; }
.intro-grid h1 { max-width: 700px; margin-top: 15px; font-size: clamp(54px, 8vw, 112px); font-weight: 800; line-height: .93; letter-spacing: 0; }
.intro-lead { max-width: 630px; margin: 26px 0 31px; color: #46536a; font-size: 20px; line-height: 1.45; }
.trust-rail { display: grid; gap: 28px; align-items: center; justify-items: end; padding: 24px 0 24px 30px; border-left: 1px solid var(--line); }
.trust-rail img:first-child { width: 142px; filter: grayscale(1); opacity: .72; }
.trust-rail img:last-child { width: 110px; }
.proof-band { background: #fbfcff; padding: 58px 0 68px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.metric-grid article { border-right: 1px solid var(--line); padding-right: 24px; }
.metric-grid article:last-child { border-right: 0; }
.metric-grid strong { display: block; color: var(--ink); font-size: clamp(34px, 4.3vw, 58px); font-weight: 800; line-height: 1; }
.metric-grid h2 { margin-top: 13px; font-size: 16px; line-height: 1.35; }
.credential-grid { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 28px; margin-top: 62px; }
.credential-grid > div { display: grid; min-height: 86px; align-content: end; gap: 12px; color: #4f596b; font-size: 14px; }
.credential-grid img { max-width: 138px; max-height: 40px; object-fit: contain; object-position: left center; filter: grayscale(1); opacity: .72; }
.audit-wordmark span { color: #222f60; font-size: 26px; font-weight: 800; }
.audit-wordmark small { color: #222f60; font-size: 14px; }
.process-section { background: var(--ink); color: white; padding: 76px 0 80px; }
.process-section .eyebrow { color: #a8beff; }
.process-section h2 { max-width: 520px; margin-top: 14px; font-size: clamp(32px, 4vw, 52px); line-height: 1.03; }
.process-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 58px; }
.process-grid article { padding-top: 19px; border-top: 1px solid rgba(255,255,255,.34); }
.process-grid span { color: #a8beff; font-size: 13px; font-weight: 800; }
.process-grid h3 { margin-top: 42px; font-size: 21px; }
.process-grid p { max-width: 280px; margin-top: 13px; color: #d3d9e8; font-size: 15px; line-height: 1.55; }
.public-footer { background: var(--ink); border-top: 1px solid rgba(255,255,255,.18); color: #d3d9e8; }
.public-footer .content-frame { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; font-size: 13px; }
.public-footer a { color: white; font-weight: 700; text-decoration: none; }

.auth-shell { display: grid; min-height: calc(100vh - 76px); place-items: center; padding: 44px 24px; background: var(--ground); }
.auth-frame { display: grid; width: min(840px, 100%); grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.auth-copy { display: grid; align-content: center; min-height: 440px; padding: 48px; background: var(--ink); color: white; }
.auth-copy .eyebrow { color: #a8beff; }
.auth-copy h1 { margin-top: 15px; font-size: 40px; line-height: 1.04; }
.auth-copy p:last-child { max-width: 330px; margin-top: 22px; color: #d3d9e8; font-size: 17px; line-height: 1.5; }
.auth-form { display: grid; align-content: center; gap: 18px; padding: 44px; }
.auth-form label, .dialog-shell label, .two-fields label { display: grid; gap: 8px; color: #445167; font-size: 13px; font-weight: 800; }
input, textarea { width: 100%; border: 1px solid #cbd4e2; border-radius: 5px; background: white; color: var(--ink); padding: 12px 13px; line-height: 1.35; }
input:hover, textarea:hover { border-color: #93a5c1; }
input:focus, textarea:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px rgba(15,70,207,.13); }
textarea { min-height: 108px; resize: vertical; }
.form-message { min-height: 20px; color: var(--red); font-size: 13px; line-height: 1.45; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 260px minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; justify-content: space-between; padding: 28px 20px 22px; background: white; border-right: 1px solid var(--line); }
.sidebar-company { margin: 39px 9px 16px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.app-nav { display: grid; gap: 4px; }
.app-nav a { padding: 11px 12px; border-radius: 5px; color: #526078; font-size: 14px; font-weight: 700; text-decoration: none; }
.app-nav a:hover, .app-nav a.is-active { background: #edf2ff; color: var(--blue); }
.sidebar-signout { align-self: start; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.sidebar-signout:hover { color: var(--red); }
.workspace { width: min(1420px, 100%); padding: 34px clamp(22px, 4vw, 56px) 56px; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.workspace-header h1 { margin-top: 5px; font-size: 32px; line-height: 1.12; }
.demo-note { width: max-content; max-width: 100%; margin: 18px 0 26px; border-radius: 4px; background: #e9eef8; color: #536078; padding: 6px 9px; font-size: 12px; font-weight: 700; }
.metric-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-cards article { min-height: 132px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.metric-cards span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.35; }
.metric-cards strong { display: block; margin-top: 24px; color: var(--ink); font-size: clamp(24px, 2.4vw, 34px); line-height: 1; white-space: nowrap; }
.exchange-rates-panel { margin-top: 16px; }
.exchange-rates-panel > header { align-items: center; }
.exchange-rates-panel > header p { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 20px 12px; }
.rate-card { min-width: 0; border: 1px solid #e2e8f2; border-radius: 5px; background: #fbfcff; padding: 14px; }
.rate-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.rate-card strong { display: block; margin-top: 10px; color: var(--ink); font-size: 22px; line-height: 1.05; white-space: nowrap; }
.rate-meta, .rate-error { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.rate-error { color: var(--red); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.workspace-panel { border: 1px solid var(--line); border-radius: 7px; background: white; }
.workspace-panel > header { display: flex; min-height: 65px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 20px; border-bottom: 1px solid #e8edf5; }
.workspace-panel h2 { font-size: 16px; line-height: 1.3; }
.workspace-panel > header > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.trend-chart { display: block; width: 100%; height: 210px; padding: 14px 6px 0; }
.trend-chart text { fill: #77839a; font-size: 11px; }
.chart-axis { stroke: #dce3ee; stroke-width: 1; }
.seller-table-panel { margin-top: 16px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 850px; border-collapse: collapse; text-align: left; }
th { padding: 13px 20px; color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
td { padding: 15px 20px; border-top: 1px solid #edf1f6; color: #435067; font-size: 13px; vertical-align: middle; }
td strong { display: block; color: var(--ink); font-size: 14px; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.status-badge { display: inline-block; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.status-invited, .status-registered { background: #edf1f7; color: #5b687d; }
.status-documents_submitted { background: #fff0d6; color: var(--amber); }
.status-scoring_ready { background: #e9edff; color: var(--blue); }
.status-approved, .status-credit_issued { background: #e4f5eb; color: var(--green); }
.status-rejected { background: #ffe8eb; color: var(--red); }
.document-chips { display: flex; gap: 5px; }
.document-chips a { border: 1px solid #d7deea; border-radius: 3px; padding: 3px 5px; color: var(--blue); font-size: 10px; font-weight: 800; text-decoration: none; }
.row-action { border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 800; white-space: nowrap; }
.row-action:hover { color: var(--blue-strong); text-decoration: underline; }

.dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 28px 84px rgba(22, 32, 51, .28); }
.dialog::backdrop { background: rgba(23, 32, 51, .48); }
.dialog-shell { display: grid; gap: 19px; padding: 25px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dialog-header h2 { font-size: 23px; line-height: 1.1; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 4px; background: #eef2f8; color: var(--ink); font-size: 25px; line-height: 1; }
.icon-button:hover { background: #dde4ef; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.copy-invite { margin-top: 10px; border: 0; background: transparent; color: var(--blue); font-size: 13px; font-weight: 800; padding: 0; }
.detail-dialog { width: min(600px, calc(100% - 32px)); }
.detail-shell { gap: 24px; }
.seller-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.seller-details div { min-width: 0; }
.seller-details dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.seller-details dd { margin: 7px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; font-weight: 700; }
.file-list { border-top: 1px solid var(--line); padding-top: 20px; }
.file-list h3 { margin-bottom: 10px; font-size: 14px; }
.file-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid #edf1f6; color: var(--ink); font-size: 13px; text-decoration: none; }
.file-row span { border-radius: 3px; background: #edf2ff; color: var(--blue); padding: 4px; font-size: 10px; font-weight: 800; text-align: center; }
.file-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { color: var(--muted); font-size: 11px; }
.full-button { width: 100%; }

.seller-shell { min-height: 100vh; background: white; }
.seller-header { display: flex; min-height: 75px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(20px, 5vw, 74px); border-bottom: 1px solid var(--line); }
.seller-header > div { display: flex; align-items: center; gap: 16px; }
.seller-main { width: min(930px, calc(100% - 48px)); margin: 0 auto; padding: 58px 0 84px; }
.seller-intro { border-bottom: 1px solid var(--line); padding-bottom: 28px; }
.seller-intro h1 { margin-top: 10px; font-size: clamp(32px, 5vw, 52px); line-height: 1.03; }
.seller-intro > p:last-child { display: flex; align-items: center; gap: 10px; margin-top: 17px; color: var(--muted); font-size: 14px; }
.seller-form > section { padding: 32px 0; border-bottom: 1px solid var(--line); }
.seller-form section > header { display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; align-items: start; gap: 16px; }
.seller-form section > header > span { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 50%; background: #eaf0ff; color: var(--blue); font-size: 12px; font-weight: 800; }
.seller-form h2 { font-size: 20px; line-height: 1.2; }
.seller-form header p { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.disabled-edo { border: 1px solid var(--line); border-radius: 4px; background: #f5f7fa; color: #8c97a9; padding: 8px 10px; font-size: 12px; font-weight: 700; }
.upload-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; margin: 22px 0 0 55px; border: 1px dashed #aab7ca; border-radius: 6px; padding: 14px; color: var(--blue); font-size: 14px; font-weight: 800; cursor: pointer; }
.upload-field.is-required { border-color: var(--blue); background: #f7f9ff; }
.upload-field:hover { border-style: solid; }
.upload-field input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-field small { color: var(--muted); font-size: 12px; font-weight: 600; }
.inn-field { display: grid; max-width: 440px; gap: 8px; margin: 22px 0 0 55px; color: #445167; font-size: 13px; font-weight: 800; }
.inn-field small { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; }
.uploaded-panel h2 { font-size: 16px; }
.uploaded-panel ul { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.uploaded-panel li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf1f6; font-size: 13px; }
.uploaded-panel li > span { border-radius: 3px; background: #edf2ff; color: var(--blue); padding: 4px; font-size: 10px; font-weight: 800; text-align: center; }
.uploaded-panel li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-panel li small { color: var(--muted); font-size: 11px; }
.seller-actions { display: flex; justify-content: flex-end; gap: 11px; padding-top: 26px; }

#portal-toast { position: fixed; z-index: 200; right: 20px; bottom: 20px; max-width: min(390px, calc(100% - 40px)); transform: translateY(24px); border: 1px solid #b9e3ca; border-radius: 6px; background: #effaf3; box-shadow: var(--shadow); color: #115e36; opacity: 0; padding: 13px 15px; font-size: 13px; font-weight: 700; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
#portal-toast[data-kind="error"] { border-color: #f1c1c8; background: #fff4f5; color: var(--red); }
#portal-toast.is-visible { transform: translateY(0); opacity: 1; }

@media (max-width: 980px) {
  .intro-grid { grid-template-columns: minmax(0, 1fr) 150px; }
  .trust-rail img:first-child { width: 124px; }
  .metric-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { grid-template-columns: 208px minmax(0, 1fr); }
  .app-sidebar { padding: 24px 14px 20px; }
  .workspace { padding: 28px 24px 46px; }
}

@media (max-width: 720px) {
  .content-frame { width: min(100% - 32px, 1180px); }
  .public-header .content-frame { min-height: 66px; }
  .public-header nav { gap: 10px; }
  .public-header .text-link { display: none; }
  .intro-grid { grid-template-columns: 1fr; min-height: 0; padding: 54px 0 42px; }
  .intro-grid h1 { font-size: 57px; }
  .intro-lead { font-size: 18px; }
  .trust-rail { display: flex; justify-content: flex-start; gap: 24px; padding: 24px 0 0; border: 0; }
  .trust-rail img:first-child { width: 136px; }
  .metric-grid, .credential-grid, .process-grid { grid-template-columns: 1fr; gap: 28px; }
  .metric-grid article { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 22px; }
  .metric-grid article:last-child { border-bottom: 0; padding-bottom: 0; }
  .credential-grid { margin-top: 38px; }
  .credential-grid > div { min-height: auto; }
  .process-section { padding: 58px 0 62px; }
  .process-grid { margin-top: 40px; }
  .process-grid h3 { margin-top: 28px; }
  .auth-shell { min-height: calc(100vh - 66px); padding: 0; }
  .auth-frame { grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; }
  .auth-copy { min-height: 0; padding: 40px 24px; }
  .auth-copy h1 { font-size: 34px; }
  .auth-form { padding: 32px 24px 44px; }
  .app-shell { display: block; }
  .app-sidebar { position: static; height: auto; min-height: 70px; flex-direction: row; align-items: center; padding: 17px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .app-sidebar > div { display: flex; align-items: center; gap: 13px; }
  .app-sidebar .brand small, .sidebar-company, .app-nav { display: none; }
  .sidebar-signout { align-self: auto; }
  .workspace { padding: 25px 16px 45px; }
  .workspace-header { align-items: flex-start; flex-direction: column; }
  .workspace-actions { width: 100%; justify-content: space-between; }
  .metric-cards, .chart-grid, .rate-grid { grid-template-columns: 1fr; }
  .metric-cards article { min-height: 110px; }
  .metric-cards strong { margin-top: 16px; }
  .rate-grid { padding: 14px 15px 12px; }
  .workspace-panel > header { padding: 0 15px; }
  .seller-main { width: min(100% - 32px, 930px); padding: 38px 0 60px; }
  .seller-header { min-height: 65px; padding: 0 16px; }
  .seller-header .brand small, .seller-header .text-button { display: none; }
  .seller-form section > header { grid-template-columns: 35px minmax(0, 1fr); }
  .disabled-edo { grid-column: 2; justify-self: start; }
  .two-fields { grid-template-columns: 1fr; }
  .upload-field { grid-template-columns: 1fr; margin-left: 0; }
  .inn-field { margin-left: 0; }
  .seller-actions { flex-direction: column-reverse; }
  .seller-actions > * { width: 100%; }
  .seller-details { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 36px minmax(0, 1fr); }
  .file-row small { grid-column: 2; }
}

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