:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --text: #172033;
  --muted: #667085;
  --line: #e4e8ef;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --good: #15803d;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(16,24,40,.07);
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-side {
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #0f172a;
  color: white;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display:grid; place-items:center; background:#fff; color:#0f172a; font-weight:900; }
.auth-lang select { background:#1e293b; color:#e2e8f0; border:1px solid #334155; border-radius:9px; padding:8px 10px; }
.auth-copy h1 { font-size: clamp(36px, 5vw, 62px); line-height: 1.02; letter-spacing: -.05em; max-width: 620px; margin: 0 0 22px; }
.auth-copy p { color: #cbd5e1; max-width: 560px; font-size: 18px; line-height:1.6; }
.auth-features { display:grid; gap:12px; margin-top:28px; color:#dbe5f3; }
.auth-feature { display:flex; align-items:center; gap:10px; }
.auth-feature span:first-child { width:26px; height:26px; border-radius:50%; background:#1e293b; display:grid; place-items:center; }
.auth-panel { display:grid; place-items:center; padding:40px; }
.auth-card { width:min(430px,100%); background:var(--surface); border:1px solid var(--line); border-radius:22px; padding:32px; box-shadow:var(--shadow); }
.auth-card h2 { margin:0 0 8px; font-size:28px; letter-spacing:-.03em; }
.auth-card .sub { color:var(--muted); margin-bottom:24px; line-height:1.5; }
.field { margin-bottom:16px; }
.field label { display:block; margin-bottom:7px; font-size:14px; font-weight:700; }
.field input { width:100%; border:1px solid #cfd6e2; border-radius:11px; padding:12px 13px; outline:none; background:white; }
.field input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.btn { border:0; border-radius:11px; padding:11px 15px; font-weight:750; transition:.16s ease; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary { background:var(--accent); color:white; }
.btn-primary:hover { background:var(--accent-strong); }
.btn-secondary { background:white; color:var(--text); border:1px solid var(--line); }
.btn-secondary:hover { background:var(--surface-2); }
.btn-danger { background:#fff1f2; color:var(--danger); border:1px solid #fecdd3; }
.btn-block { width:100%; }
.auth-switch { text-align:center; margin-top:18px; color:var(--muted); font-size:14px; }
.auth-switch button { border:0; background:none; color:var(--accent); font-weight:750; }

.portal { min-height:100vh; display:grid; grid-template-columns:250px 1fr; }
.sidebar { background:#101828; color:white; padding:22px 16px; position:sticky; top:0; height:100vh; display:flex; flex-direction:column; }
.sidebar .brand { padding:4px 8px 26px; }
.nav { display:grid; gap:6px; }
.nav button { width:100%; display:flex; align-items:center; gap:10px; border:0; background:transparent; color:#cfd6e2; padding:11px 12px; border-radius:10px; text-align:left; font-weight:650; }
.nav button:hover, .nav button.active { background:#1d2939; color:white; }
.nav .icon { width:20px; text-align:center; }
.sidebar-bottom { margin-top:auto; padding:12px 8px 2px; }
.user-mini { border-top:1px solid #344054; padding-top:16px; display:flex; gap:10px; align-items:center; }
.avatar { width:36px; height:36px; border-radius:50%; background:#344054; display:grid; place-items:center; font-weight:800; }
.user-mini small { color:#98a2b3; display:block; margin-top:2px; }
.main { min-width:0; }
.topbar { min-height:74px; display:flex; align-items:center; justify-content:space-between; padding:0 32px; background:rgba(255,255,255,.93); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; backdrop-filter:blur(9px); }
.topbar h1 { margin:0; font-size:22px; letter-spacing:-.025em; }
.content { padding:30px 32px 50px; max-width:1450px; margin:0 auto; }

.grid { display:grid; gap:18px; }
.grid-4 { grid-template-columns:repeat(4,1fr); }
.grid-3 { grid-template-columns:repeat(3,1fr); }
.grid-2 { grid-template-columns:repeat(2,1fr); }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:20px; box-shadow:0 2px 6px rgba(16,24,40,.02); }
.card h3 { margin:0 0 5px; font-size:15px; }
.kpi-label { color:var(--muted); font-size:13px; font-weight:650; }
.kpi-value { font-size:30px; font-weight:850; letter-spacing:-.035em; margin-top:8px; }
.kpi-foot { margin-top:8px; font-size:12px; color:var(--muted); }
.good { color:var(--good); }
.warn { color:var(--warn); }
.section-head { display:flex; align-items:center; justify-content:space-between; margin:30px 0 13px; }
.section-head h2 { margin:0; font-size:18px; letter-spacing:-.02em; }
.muted { color:var(--muted); }
.row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.space-between { justify-content:space-between; }
.endpoint-box { background:#0b1220; color:#e2e8f0; border-radius:12px; padding:14px; display:flex; align-items:center; justify-content:space-between; gap:12px; overflow:hidden; }
.endpoint-box code { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.copy-btn { border:1px solid #334155; background:#172033; color:#e2e8f0; border-radius:8px; padding:7px 10px; flex:0 0 auto; }
.copy-btn:hover { background:#1e293b; }
.key-box { margin-top:12px; }
.progress { height:9px; background:#e9edf3; border-radius:999px; overflow:hidden; margin-top:12px; }
.progress > div { height:100%; background:var(--accent); border-radius:inherit; }
.tag { display:inline-flex; align-items:center; border-radius:999px; padding:5px 9px; font-size:12px; font-weight:750; background:#eef4ff; color:#3538cd; }
.tag.green { background:#ecfdf3; color:#027a48; }
.tag.gray { background:#f2f4f7; color:#475467; }
.tag.orange { background:#fff7ed; color:#c2410c; }
.model-list { display:grid; gap:9px; margin-top:14px; }
.model-item { border:1px solid var(--line); border-radius:12px; padding:12px 13px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.model-name { font-weight:750; }
.model-meta { color:var(--muted); font-size:12px; margin-top:3px; }

.key-list { display:grid; gap:10px; }
.key-row { flex-direction:column; align-items:stretch; gap:10px; }
.key-row .key-box { margin-top:0; }
.key-actions { display:flex; justify-content:flex-end; }
.linklike { border:0; background:none; padding:0; color:var(--accent); font-weight:750; text-decoration:underline; cursor:pointer; font:inherit; }

.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; }
table { width:100%; border-collapse:collapse; background:white; min-width:760px; }
th, td { padding:13px 14px; border-bottom:1px solid var(--line); text-align:left; font-size:13px; white-space:nowrap; }
th { background:#f8fafc; color:#475467; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
tr:last-child td { border-bottom:0; }
.cost { font-weight:750; }

.notice { border-radius:13px; padding:13px 15px; background:#fffaeb; border:1px solid #fedf89; color:#93370d; display:flex; justify-content:space-between; gap:14px; align-items:center; margin-bottom:18px; }
.quick-actions { display:flex; gap:9px; flex-wrap:wrap; }

.modal-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.48); display:grid; place-items:center; z-index:30; padding:20px; }
.modal { width:min(500px,100%); background:white; border-radius:18px; padding:24px; box-shadow:0 24px 70px rgba(15,23,42,.3); }
.modal h2 { margin:0 0 7px; }
.amount-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; margin:18px 0; }
.amount { padding:12px; border-radius:10px; background:white; border:1px solid var(--line); font-weight:800; }
.amount.selected { border-color:var(--accent); background:#eff6ff; color:#1d4ed8; }
.modal-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:20px; }

.settings-grid { display:grid; grid-template-columns:1.1fr .9fr; gap:18px; }
.setting-row { padding:14px 0; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:20px; align-items:center; }
.setting-row:last-child { border-bottom:0; }
.toggle { width:42px; height:24px; border-radius:999px; background:#d0d5dd; border:0; padding:2px; }
.toggle::after { content:""; display:block; width:20px; height:20px; border-radius:50%; background:white; box-shadow:0 1px 3px rgba(0,0,0,.2); transform:translateX(0); transition:.15s; }
.toggle.on { background:var(--accent); }
.toggle.on::after { transform:translateX(18px); }

.toast { position:fixed; right:22px; bottom:22px; background:#101828; color:white; border-radius:10px; padding:11px 14px; z-index:50; box-shadow:var(--shadow); font-size:13px; }
.loading-screen { min-height:100vh; display:grid; place-items:center; color:var(--muted); font-size:14px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns:repeat(2,1fr); }
  .grid-3 { grid-template-columns:1fr; }
  .settings-grid { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .auth-shell { grid-template-columns:1fr; }
  .auth-side { display:none; }
  .auth-panel { min-height:100vh; padding:20px; }
  .portal { grid-template-columns:1fr; }
  .sidebar { position:fixed; inset:auto 0 0 0; height:auto; z-index:20; padding:8px; }
  .sidebar .brand, .sidebar-bottom { display:none; }
  .nav { grid-template-columns:repeat(5,1fr); }
  .nav button { justify-content:center; padding:10px 5px; font-size:0; }
  .nav .icon { font-size:18px; }
  .topbar { padding:0 18px; }
  .content { padding:20px 16px 95px; }
  .grid-4, .grid-2 { grid-template-columns:1fr; }
  .amount-grid { grid-template-columns:repeat(2,1fr); }
}

/* Token Relay overview model blocks and token-usage chart */
.overview-models-card {
  min-width: 0;
}

.overview-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.overview-model-block {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
}

.overview-model-block:hover {
  border-color: #c7d7fe;
  background: #f8faff;
}

.model-availability-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px #ecfdf3;
}

.overview-model-copy {
  min-width: 0;
}

.overview-model-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-models-more {
  margin-top: 11px;
  font-size: 12px;
}

.overview-empty {
  margin-top: 14px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.model-usage-section-head {
  align-items: flex-end;
}

.model-usage-subtitle {
  margin-top: 5px;
  font-size: 13px;
}

.model-usage-card {
  padding: 24px;
}

.model-usage-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

.model-usage-donut {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .04);
}

.model-usage-donut-center {
  position: absolute;
  inset: 42px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(16, 24, 40, .08);
  text-align: center;
}

.model-usage-donut-center strong {
  color: var(--text);
  font-size: 25px;
  letter-spacing: -.035em;
}

.model-usage-donut-center span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.model-usage-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.model-usage-legend-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
}

.model-usage-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.model-usage-legend-copy {
  min-width: 0;
}

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

.model-usage-legend-copy strong {
  font-size: 13px;
}

.model-usage-legend-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.model-usage-percent {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.model-usage-empty {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.model-usage-empty-icon {
  width: 64px;
  height: 64px;
  border: 11px solid #e8eef7;
  border-right-color: #c7d7fe;
  border-radius: 50%;
}

@media (max-width: 1100px) {
  .model-usage-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 24px;
  }

  .model-usage-donut {
    width: 190px;
    height: 190px;
  }

  .model-usage-donut-center {
    inset: 37px;
  }

  .model-usage-legend {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .overview-model-grid {
    grid-template-columns: 1fr;
  }

  .model-usage-section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .model-usage-layout {
    grid-template-columns: 1fr;
  }

  .model-usage-card {
    padding: 20px;
  }

  .model-usage-legend {
    grid-template-columns: 1fr;
  }
}



/* Token Relay usage date filter */

.usage-section-head {

  align-items: flex-start;

}



.usage-range-control {

  position: relative;

  z-index: 4;

}



.usage-range-button {

  min-width: 210px;

  display: inline-flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

}



.usage-range-calendar {

  color: var(--accent);

  font-size: 15px;

}



.usage-range-chevron {

  color: var(--muted);

  font-size: 16px;

}



.usage-range-menu {

  position: absolute;

  top: calc(100% + 9px);

  right: 0;

  width: min(360px, calc(100vw - 40px));

  background: var(--surface);

  border: 1px solid var(--line);

  border-radius: 15px;

  padding: 10px;

  box-shadow: 0 20px 45px rgba(16, 24, 40, .16);

  z-index: 25;

}



.usage-range-menu[hidden] {

  display: none;

}



.usage-range-presets {

  display: grid;

  gap: 3px;

}



.usage-range-option {

  width: 100%;

  border: 0;

  border-radius: 9px;

  background: transparent;

  color: var(--text);

  padding: 10px 11px;

  text-align: left;

  font: inherit;

  font-size: 14px;

  font-weight: 650;

  cursor: pointer;

}



.usage-range-option:hover {

  background: var(--surface-2);

}



.usage-range-option.active {

  background: #eff6ff;

  color: var(--accent);

}



.usage-range-custom {

  border-top: 1px solid var(--line);

  margin-top: 9px;

  padding: 14px 5px 5px;

}



.usage-range-custom > strong {

  display: block;

  margin-bottom: 11px;

  font-size: 14px;

}



.usage-range-fields {

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 9px;

  margin-bottom: 11px;

}



.usage-range-field {

  display: grid;

  gap: 6px;

}



.usage-range-field span {

  color: var(--muted);

  font-size: 12px;

  font-weight: 650;

}



.usage-range-field input {

  width: 100%;

  min-width: 0;

  border: 1px solid #cfd6e2;

  border-radius: 9px;

  background: white;

  color: var(--text);

  padding: 9px;

  font: inherit;

  font-size: 13px;

  outline: none;

}



.usage-range-field input:focus {

  border-color: var(--accent);

  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);

}



.usage-range-error {

  min-height: 17px;

  margin-bottom: 7px;

  color: var(--danger);

  font-size: 12px;

}



.usage-range-custom .btn {

  width: 100%;

}



@media (max-width: 760px) {

  .usage-section-head {

    align-items: stretch;

    flex-direction: column;

    gap: 12px;

  }



  .usage-range-control,

  .usage-range-button {

    width: 100%;

  }



  .usage-range-menu {

    left: 0;

    right: auto;

    width: min(100%, calc(100vw - 32px));

  }



  .usage-range-fields {

    grid-template-columns: 1fr;

  }

}

/* TR top-up experience v2 */
.tr-topup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 32px;
  align-items: start;
}
.tr-topup-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.tr-custom-topup-field {
  max-width: 380px;
  margin-top: 18px;
}
.tr-checkout-button {
  margin-top: 22px;
  min-width: 260px;
}
.tr-credit-note {
  max-width: 560px;
  font-size: 12px;
  margin-top: 10px;
}
.tr-topup-summary {
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 20px;
}
.tr-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  color: var(--muted);
}
.tr-summary-row strong { color: #0f172a; }
.tr-summary-total {
  border-top: 1px solid #dbe3ef;
  font-size: 16px;
}
.tr-payment-method-heading {
  border-top: 1px solid #dbe3ef;
  padding-top: 18px;
  margin-top: 4px;
  font-weight: 700;
}
.tr-payment-method-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}
.tr-payment-method {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}
.tr-payment-method img { display: block; flex: 0 0 auto; }
.tr-payment-availability { font-size: 12px; margin-top: 10px; }
.tr-payment-notice {
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 16px;
  font-weight: 700;
}
.tr-payment-notice-success { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.tr-payment-notice-cancel { color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; }
.tr-payment-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
.tr-status-paid { color: #166534; background: #dcfce7; }
.tr-status-pending { color: #92400e; background: #fef3c7; }
.tr-status-failed { color: #991b1b; background: #fee2e2; }
.tr-status-neutral { color: #475569; background: #e2e8f0; }

@media (max-width: 980px) {
  .tr-topup-layout { grid-template-columns: 1fr; }
  .tr-topup-summary { max-width: none; }
}
@media (max-width: 600px) {
  .tr-topup-options .btn { flex: 1 1 calc(50% - 10px); }
  .tr-checkout-button { width: 100%; min-width: 0; }
  .tr-topup-summary { padding: 16px; }
}

/* TR verified checkout methods v1 */
.tr-payment-brand-icon,
.tr-payment-wordmark {
  object-fit: contain;
  object-position: left center;
}
.tr-link-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  background: #00d66f;
  color: #071b12;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.5px;
}

/* TR final China wallet panel v1 */
.tr-apple-pay-method {
  justify-content: flex-start;
}
.tr-apple-pay-wordmark {
  display: block;
  width: 82px;
  height: 28px;
  object-fit: contain;
  object-position: left center;
}
@media (min-width: 701px) {
  .tr-payment-method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* TR exact-amount top-up discounts v1 */
.tr-topup-amount-btn {
  min-width: 92px;
  min-height: 58px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tr-topup-amount-value {
  line-height: 1.1;
}
.tr-topup-bonus-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  background: #ecfdf3;
  color: #027a48;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary .tr-topup-bonus-badge {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
.tr-bonus-note {
  margin-top: 9px;
  font-size: 12px;
}
.tr-summary-bonus strong {
  color: var(--good);
}
@media (max-width: 600px) {
  .tr-topup-amount-btn {
    min-width: 0;
  }
}

/* TR custom top-up validation v1 */
.tr-custom-topup-field input.tr-input-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .08);
}
.tr-topup-validation-error {
  margin-top: 7px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

/* Token Relay public homepage v1 — payment-review friendly */
.public-site {
  min-height: 100vh;
  background: #ffffff;
  color: #172033;
}
.public-site a { color: inherit; text-decoration: none; }
.public-nav-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(228,232,239,.9);
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(14px);
}
.public-nav {
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.public-brand .brand-mark {
  background: #101828;
  color: #fff;
}
.public-nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #475467;
  font-size: 14px;
  font-weight: 700;
}
.public-nav-links a:hover,
.public-footer-links a:hover { color: var(--accent); }
.public-nav-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.public-language select {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 8px 9px;
}
.public-signin-link { min-width: 78px; text-align: center; }

.public-hero {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 84px 0 68px;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, .84fr);
  gap: 66px;
  align-items: center;
}
.public-hero-copy { min-width: 0; }
.public-eyebrow,
.public-kicker {
  color: #475467;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .095em;
  text-transform: uppercase;
}
.public-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #dbe6ff;
  border-radius: 999px;
  background: #f7f9ff;
  color: #3448a5;
}
.public-eyebrow > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px #dcfae6;
}
.public-hero h1 {
  max-width: 760px;
  margin: 20px 0 22px;
  color: #101828;
  font-size: clamp(48px, 6.2vw, 78px);
  line-height: .98;
  letter-spacing: -.062em;
}
.public-hero h1 span { color: #2563eb; }
.public-hero-copy > p {
  max-width: 720px;
  margin: 0;
  color: #5d6b82;
  font-size: 18px;
  line-height: 1.7;
}
.public-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.public-hero-cta { min-height: 48px; padding: 13px 19px; }
.public-proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}
.public-proof-row b { color: #079455; margin-right: 4px; }
.public-provider-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}
.public-provider-strip > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 750;
}
.public-provider-strip i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #101828;
  color: white;
  font-style: normal;
  font-size: 10px;
}
.public-access-card {
  position: relative;
  padding: 22px;
  border: 1px solid #dce4ef;
  border-radius: 26px;
  background: linear-gradient(180deg,#f8fbff 0%,#f3f6fb 100%);
  box-shadow: 0 30px 80px rgba(16,24,40,.12);
}
.public-access-badge {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #027a48;
  font-size: 11px;
  font-weight: 800;
}
.public-auth-card {
  width: 100%;
  margin-top: 18px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(16,24,40,.06);
}
.public-access-note {
  padding: 12px 6px 1px;
  color: #667085;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.public-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 84px 0;
}
.public-trust-section {
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fbfcfe;
}
.public-metric {
  padding: 24px 26px;
  border-right: 1px solid var(--line);
}
.public-metric:last-child { border-right: 0; }
.public-metric strong {
  display: block;
  color: #101828;
  font-size: 28px;
  letter-spacing: -.04em;
}
.public-metric span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}
.public-section-heading {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(300px, .55fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 34px;
}
.public-section-heading h2 {
  margin: 9px 0 0;
  color: #101828;
  font-size: clamp(34px,4vw,52px);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.public-section-heading > p {
  margin: 0;
  color: #667085;
  font-size: 15px;
  line-height: 1.7;
}
.public-subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 24px 0 14px;
}
.public-subsection-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.public-subsection-heading h3 {
  margin: 0;
  color: #172033;
  font-size: 18px;
}
.public-subsection-heading p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}
.public-media-heading { margin-top: 44px; }
.public-modality-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eff4ff;
  color: #3538cd;
  font-size: 13px;
  font-weight: 850;
}
.public-count-badge,
.public-verified {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.public-model-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 13px;
}
.public-model-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(16,24,40,.02);
}
.public-model-card:hover {
  border-color: #c7d7fe;
  box-shadow: 0 12px 30px rgba(16,24,40,.06);
  transform: translateY(-1px);
}
.public-model-topline {
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto;
  gap: 10px;
  align-items: start;
}
.public-provider-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #101828;
  color: white;
  font-weight: 850;
}
.public-provider-mark.small {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  font-size: 10px;
}
.public-model-provider {
  margin-bottom: 2px;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.public-model-card h3 {
  margin: 0;
  color: #172033;
  font-size: 14px;
  line-height: 1.25;
}
.public-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #027a48;
  font-size: 10px;
  font-weight: 800;
}
.public-status-dot > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
}
.public-model-card > p {
  min-height: 38px;
  margin: 13px 0 16px;
  color: #667085;
  font-size: 12px;
  line-height: 1.55;
}
.public-model-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.public-modality-badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 10px;
  font-weight: 750;
}
.public-model-footer code {
  min-width: 0;
  overflow: hidden;
  color: #98a2b3;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-pricing-section {
  width: 100%;
  max-width: none;
  padding-left: max(20px, calc((100% - 1180px)/2));
  padding-right: max(20px, calc((100% - 1180px)/2));
  background: #0f172a;
  color: #e2e8f0;
}
.public-pricing-section .public-kicker { color: #93c5fd; }
.public-pricing-section .public-section-heading h2 { color: white; }
.public-pricing-section .public-section-heading > p,
.public-pricing-section .public-pricing-note { color: #aebbd0; }
.public-rate-callout {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #172033;
}
.public-rate-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #1d4ed8;
  color: #fff;
  font-size: 22px;
  font-weight: 850;
}
.public-rate-callout strong,
.public-rate-callout span { display: block; }
.public-rate-callout span {
  margin-top: 3px;
  color: #aebbd0;
  font-size: 12px;
}
.public-verified { background: #1e293b; color: #cbd5e1; }
.public-pricing-table-wrap {
  overflow: auto;
  border: 1px solid #334155;
  border-radius: 15px;
}
.public-pricing-table {
  min-width: 900px;
  background: #111b2e;
  color: #e2e8f0;
}
.public-pricing-table th,
.public-pricing-table td { border-bottom-color: #2c3a50; }
.public-pricing-table th {
  background: #172033;
  color: #aebbd0;
}
.public-provider-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.public-price-main {
  color: #fff;
  font-size: 15px;
  font-weight: 850;
}
.public-price-unit { color: #94a3b8; font-size: 11px; }
.public-pricing-note {
  max-width: 1050px;
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.65;
}
.public-credit-panel {
  margin-top: 34px;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr);
  gap: 34px;
  align-items: center;
  padding: 24px;
  border: 1px solid #334155;
  border-radius: 17px;
  background: #111b2e;
}
.public-credit-copy h3 {
  margin: 9px 0 8px;
  color: #fff;
  font-size: 24px;
  letter-spacing: -.035em;
}
.public-credit-copy p { margin: 0; color: #aebbd0; font-size: 13px; line-height: 1.6; }
.public-credit-tiers {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
}
.public-credit-tier {
  padding: 14px 12px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #172033;
}
.public-credit-tier strong,
.public-credit-tier span { display: block; }
.public-credit-tier strong { color: #fff; font-size: 14px; }
.public-credit-tier span { margin-top: 5px; color: #86efac; font-size: 11px; font-weight: 750; }

.public-feature-grid,
.public-steps {
  display: grid;
  gap: 13px;
}
.public-feature-grid { grid-template-columns: repeat(3,1fr); }
.public-feature-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}
.public-feature-grid article > span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 850;
}
.public-feature-grid h3,
.public-steps h3 {
  margin: 13px 0 7px;
  color: #172033;
  font-size: 16px;
}
.public-feature-grid p,
.public-steps p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.62;
}
.public-how-section {
  border-top: 1px solid var(--line);
}
.public-steps { grid-template-columns: repeat(4,1fr); }
.public-steps article {
  position: relative;
  padding: 22px 18px 18px 0;
}
.public-steps article > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eff4ff;
  color: #3538cd;
  font-size: 13px;
  font-weight: 850;
}
.public-steps code {
  overflow-wrap: anywhere;
  color: #3448a5;
  font-size: 11px;
}
.public-final-cta {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 70px;
  padding: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-radius: 22px;
  background: #eff4ff;
  border: 1px solid #dbe6ff;
}
.public-final-cta h2 {
  margin: 8px 0 7px;
  color: #101828;
  font-size: 31px;
  letter-spacing: -.04em;
}
.public-final-cta p { margin: 0; color: #5d6b82; font-size: 13px; }
.public-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 34px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--line);
  color: #98a2b3;
  font-size: 11px;
}
.public-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  color: #667085;
  font-weight: 700;
}

@media (max-width: 1080px) {
  .public-nav-links { display: none; }
  .public-hero { grid-template-columns: 1fr; gap: 40px; padding-top: 62px; }
  .public-access-card { max-width: 620px; width: 100%; }
  .public-model-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .public-feature-grid { grid-template-columns: repeat(2,1fr); }
  .public-steps { grid-template-columns: repeat(2,1fr); }
  .public-credit-panel { grid-template-columns: 1fr; }
  .public-credit-tiers { grid-template-columns: repeat(4,1fr); }
  .public-footer { grid-template-columns: 1fr; text-align: center; }
  .public-footer .public-brand { justify-content: center; }
}

@media (max-width: 760px) {
  .public-nav { width: min(100% - 28px,1180px); min-height: 64px; }
  .public-nav-actions .public-language,
  .public-signin-link { display: none; }
  .public-nav-actions .btn-primary { padding: 9px 11px; font-size: 12px; }
  .public-hero,
  .public-section,
  .public-final-cta,
  .public-footer { width: min(100% - 28px,1180px); }
  .public-hero { padding: 44px 0 50px; }
  .public-hero h1 { font-size: clamp(42px,13vw,62px); }
  .public-hero-copy > p { font-size: 16px; }
  .public-proof-row { gap: 10px 16px; }
  .public-access-card { padding: 12px; border-radius: 20px; }
  .public-auth-card { padding: 23px; }
  .public-trust-section { grid-template-columns: repeat(2,1fr); }
  .public-metric:nth-child(2) { border-right: 0; }
  .public-metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .public-section { padding: 60px 0; }
  .public-section-heading { grid-template-columns: 1fr; gap: 14px; }
  .public-section-heading h2 { font-size: 36px; }
  .public-model-grid,
  .public-feature-grid,
  .public-steps { grid-template-columns: 1fr; }
  .public-subsection-heading { align-items: flex-end; }
  .public-pricing-section {
    width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }
  .public-rate-callout { grid-template-columns: 40px 1fr; }
  .public-rate-callout .public-verified { grid-column: 1 / -1; justify-self: start; }
  .public-credit-tiers { grid-template-columns: repeat(2,1fr); }
  .public-final-cta { margin-bottom: 50px; padding: 26px; flex-direction: column; align-items: flex-start; }
  .public-final-cta h2 { font-size: 27px; }
  .public-footer-links { flex-wrap: wrap; }
}


/* Token Relay public homepage v2 — media pricing + legal pages */
.public-media-pricing-block {
  margin-top: 42px;
}
.public-pricing-subhead {
  margin-bottom: 14px;
}
.public-pricing-subhead h3 {
  color: #fff;
}
.public-pricing-subhead p {
  color: #aebbd0;
}
.public-pricing-subhead .public-modality-icon {
  background: #1e3a8a;
  color: #dbeafe;
}

.legal-site {
  min-height: 100vh;
  background: #f8fafc;
  color: var(--text);
}
.legal-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.legal-nav-inner {
  width: min(980px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.legal-back {
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}
.legal-main {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 76px;
}
.legal-hero {
  margin-bottom: 24px;
}
.legal-hero .public-kicker {
  color: var(--accent);
}
.legal-hero h1 {
  margin: 10px 0 10px;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -.05em;
}
.legal-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.legal-card {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(16,24,40,.05);
}
.legal-card section + section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.legal-card h2 {
  margin: 0 0 10px;
  font-size: 21px;
  letter-spacing: -.025em;
}
.legal-card h3 {
  margin: 18px 0 8px;
  font-size: 15px;
}
.legal-card p,
.legal-card li {
  color: #475467;
  font-size: 14px;
  line-height: 1.75;
}
.legal-card p {
  margin: 8px 0;
}
.legal-card ul {
  margin: 10px 0;
  padding-left: 22px;
}
.legal-note {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid #dbe6ff;
  border-radius: 12px;
  background: #f7f9ff;
  color: #475467;
  font-size: 12px;
  line-height: 1.6;
}
.legal-footer {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 36px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: #98a2b3;
  font-size: 11px;
}
.legal-footer-links {
  display: flex;
  gap: 18px;
  color: #667085;
  font-weight: 700;
}

@media (max-width: 760px) {
  .public-nav-actions .public-language {
    display: block;
  }
  .public-language select {
    max-width: 92px;
    padding: 7px 5px;
    font-size: 11px;
  }
  .public-nav-actions .public-signin-link {
    display: none;
  }
  .legal-main,
  .legal-nav-inner,
  .legal-footer {
    width: min(100% - 28px, 900px);
  }
  .legal-main { padding-top: 38px; }
  .legal-card { padding: 23px 19px; }
  .legal-footer { flex-direction: column; }
}

.legal-site a { color: inherit; text-decoration: none; }
.legal-site .legal-back { color: var(--accent); }
