:root {
  color-scheme: light dark;
  --bg: oklch(1 0 0);
  --surface: oklch(0.97 0.004 264);
  --surface-raised: oklch(0.99 0.002 264);
  --ink: oklch(0.21 0.018 265);
  --muted: oklch(0.46 0.018 265);
  --faint: oklch(0.66 0.012 265);
  --line: oklch(0.88 0.01 264);
  --line-strong: oklch(0.8 0.015 264);
  --primary: oklch(0.55 0.19 264);
  --primary-hover: oklch(0.49 0.2 264);
  --primary-soft: oklch(0.95 0.03 264);
  --tether: #009393;
  --success: oklch(0.58 0.15 154);
  --success-soft: oklch(0.96 0.035 154);
  --danger: oklch(0.59 0.2 28);
  --danger-soft: oklch(0.96 0.035 28);
  --warning: oklch(0.68 0.15 76);
  --warning-soft: oklch(0.96 0.04 76);
  --sidebar: oklch(0.985 0.004 264);
  --shadow: 0 4px 8px oklch(0.2 0.02 264 / .08);
  --z-dropdown: 20;
  --z-sticky: 30;
  --z-backdrop: 40;
  --z-modal: 50;
  --z-toast: 60;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.svg-sprite { width: 0; height: 0; position: absolute; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
#i-overview path { fill: currentColor; stroke: none; }

.brand-mark { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 11px; overflow: hidden; box-shadow: 0 3px 7px oklch(0.35 0.2 264 / .22); }
.brand-mark.small { width: 30px; height: 30px; border-radius: 7px; }
.brand-mark img { display: block; width: 100%; height: 100%; }
.asset-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.asset-label { display: inline-flex !important; align-items: center; gap: 6px; }
.asset-label img { width: 14px; height: 14px; }
.tether-lockup { display: inline-flex; align-items: center; gap: 9px; color: var(--tether); font-weight: 650; }
.tether-lockup img { display: block; width: 92px; height: auto; }
.tether-lockup.compact img { width: 78px; }
.asset-lockup { display: flex; align-items: center; gap: 9px; }
.crypto-avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 750; font-family: system-ui, sans-serif; }
.crypto-avatar.inline { width: 18px; height: 18px; font-size: 7px; vertical-align: middle; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 0; border-radius: 7px; cursor: pointer; font-weight: 600; transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 100ms ease; }
.button:active { transform: translateY(1px); }
.button:focus-visible, .icon-button:focus-visible, .text-button:focus-visible, input:focus-visible, select:focus-visible, .order-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-hover); color: white; }
.button.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line-strong); }
.button.secondary:hover { background: var(--surface); color: var(--ink); }
.button.danger { color: var(--danger); background: var(--danger-soft); border: 1px solid oklch(0.84 0.09 28); }
.button.small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.button.full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 7px; background: transparent; cursor: pointer; color: var(--muted); }
.icon-button:hover { background: var(--surface); color: var(--ink); }
.text-button { border: 0; background: transparent; color: var(--primary); padding: 4px; cursor: pointer; font-weight: 600; }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--faint); }
.status-dot.success { background: var(--success); }
.status-dot.danger { background: var(--danger); }

/* Authentication */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--surface); }
.auth-shell { width: min(920px, 100%); min-height: 580px; display: grid; grid-template-columns: 1.15fr .85fr; background: var(--bg); box-shadow: 0 8px 32px oklch(0.18 0.02 264 / .1); border-radius: 14px; overflow: hidden; }
.auth-brand { padding: 54px; display: flex; flex-direction: column; justify-content: space-between; color: white; background: oklch(0.21 0.035 264); }
.auth-brand h1 { max-width: 13ch; margin: 28px 0 18px; font-size: 34px; line-height: 1.18; letter-spacing: -.025em; }
.auth-brand p { max-width: 43ch; color: oklch(0.82 0.02 264); }
.auth-context { font-size: 13px; font-weight: 600; }
.auth-status { display: flex; align-items: center; gap: 9px; color: oklch(0.88 0.015 264); font-size: 13px; }
.login-panel { padding: 68px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-head h2 { font-size: 24px; letter-spacing: -.015em; }
.login-head p { color: var(--muted); margin: 7px 0 28px; }
.mobile-brand { display: none; }
.login-note { margin-top: 20px; text-align: center; color: var(--muted); font-size: 12px; }

/* Forms and alerts */
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 120px; gap: 14px; }
label { display: flex; flex-direction: column; gap: 7px; color: var(--ink); font-weight: 600; }
label > span { color: var(--muted); font-size: 12px; font-weight: 400; }
input, select { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--bg); padding: 0 11px; transition: border-color 160ms ease, box-shadow 160ms ease; }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }
.alert { border-radius: 8px; padding: 11px 13px; font-size: 13px; margin-bottom: 16px; }
.alert.danger { color: oklch(0.43 0.18 28); background: var(--danger-soft); }
.alert.warning { color: oklch(0.42 0.11 76); background: var(--warning-soft); }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 216px; display: flex; flex-direction: column; padding: 18px 12px 14px; background: var(--sidebar); border-right: 1px solid var(--line); z-index: var(--z-sticky); }
.app-brand { height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 8px; color: var(--ink); font-size: 17px; font-weight: 700; }
.app-brand:hover { color: var(--ink); }
.nav-list { display: flex; flex-direction: column; gap: 3px; margin-top: 30px; }
.nav-list a { min-height: 40px; display: flex; align-items: center; gap: 11px; padding: 0 11px; border-radius: 7px; color: var(--muted); font-weight: 550; }
.nav-list a:hover { background: var(--surface); color: var(--ink); }
.nav-list a.active { background: var(--primary-soft); color: var(--primary); }
.nav-list a b { margin-left: auto; min-width: 19px; height: 19px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--danger); color: white; font-size: 11px; }
.sidebar-foot { margin-top: auto; padding: 10px 0 0; border-top: 1px solid var(--line); }
.owner-entry { min-height: 48px; display: grid; grid-template-columns: 32px minmax(0, 1fr) 18px; gap: 9px; align-items: center; padding: 6px 8px; border-radius: 8px; color: var(--ink); }
.owner-entry:hover { color: var(--ink); background: var(--surface); }
.owner-entry.active { color: var(--primary); background: var(--primary-soft); }
.owner-entry > .icon { width: 16px; height: 16px; color: var(--muted); }
.owner-copy { min-width: 0; display: flex; flex-direction: column; }
.owner-copy strong { font-size: 13px; }
.owner-copy small { color: var(--muted); font-size: 11px; }
.owner-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 12px; }
.owner-entry.active .owner-avatar { background: var(--primary); color: white; }
.workspace { grid-column: 2; min-width: 0; }
.workspace::before { content: ""; position: fixed; z-index: calc(var(--z-toast) + 1); top: 0; left: 216px; right: 0; height: 2px; background: var(--primary); transform: scaleX(0); transform-origin: left; opacity: 0; pointer-events: none; }
.workspace.is-navigating::before { opacity: 1; animation: navigation-progress 900ms cubic-bezier(.2,.7,.2,1) infinite; }
@keyframes navigation-progress { 0% { transform: scaleX(0); } 55% { transform: scaleX(.72); } 100% { transform: scaleX(.94); } }
.topbar { height: 74px; display: flex; align-items: center; gap: 20px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: var(--z-sticky); }
.topbar h1 { font-size: 20px; line-height: 1.2; letter-spacing: -.015em; }
.topbar p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.mobile-menu { display: none; }
.content { padding: 24px 28px 36px; }

/* Dashboard */
.metric-strip { min-height: 86px; display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.metric-strip > div { padding: 10px 18px 18px; border-right: 1px solid var(--line); }
.metric-strip > div:first-child { padding-left: 0; }
.metric-strip > div:last-child { border-right: 0; }
.metric-strip span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; }
.metric-strip strong { display: block; margin-top: 10px; font-size: 20px; font-weight: 600; }
.metric-strip .metric-danger strong { color: var(--danger); }
.metric-strip .metric-warning strong { color: var(--warning); }
.operations-layout { display: grid; grid-template-columns: minmax(0, 1fr) 294px; gap: 28px; }
.primary-column { min-width: 0; }
.section-heading { height: 50px; display: flex; align-items: flex-start; justify-content: space-between; }
.section-heading h2 { font-size: 16px; }
.section-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.section-heading a { font-size: 12px; font-weight: 600; }
.webhook-heading { margin-top: 28px; }
.exception-rail { border-left: 1px solid var(--line); padding-left: 20px; }
.exception-title { height: 50px; display: flex; align-items: flex-start; gap: 8px; }
.exception-title h2 { font-size: 16px; }
.exception-title span { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--danger); color: white; font-size: 11px; font-weight: 700; }
.exception-item { padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.exception-item.danger-item { background: var(--danger-soft); }
.exception-item.warning-item { background: var(--warning-soft); }
.exception-item .exception-type { display: block; color: var(--muted); font-size: 11px; }
.exception-item strong { display: block; margin-top: 4px; }
.exception-item p { margin: 7px 0 12px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.scanner-status { display: flex; align-items: flex-start; gap: 10px; padding: 18px 4px 0; margin-top: 16px; border-top: 1px solid var(--line); }
.scanner-status .status-dot { margin-top: 5px; }
.scanner-status strong { font-size: 12px; }
.scanner-status p { margin-top: 2px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { height: 38px; padding: 0 10px; color: var(--muted); font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { height: 48px; padding: 0 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr { transition: background-color 140ms ease; }
tbody tr:hover { background: var(--surface); }
.order-row { cursor: pointer; }
.order-id { color: var(--ink); font-weight: 600; }
.amount { color: var(--ink); }
.amount small { color: var(--tether); font-family: inherit; }
.status-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.status-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status-label.paid::before, .status-label.webhook-delivered::before { background: var(--success); }
.status-label.waiting_payment::before, .status-label.webhook-pending::before, .status-label.webhook-retrying::before { background: var(--primary); }
.status-label.expired::before, .status-label.cancelled::before { background: var(--faint); }
.status-label.webhook-failed { color: var(--danger); }
.status-label.webhook-failed::before { background: var(--danger); }
.status-label.unmatched { color: oklch(0.46 0.13 76); }
.status-label.unmatched::before { background: var(--warning); }
.toolbar { min-height: 56px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar select { width: 150px; }
.searchbox { width: min(430px, 100%); position: relative; }
.searchbox .icon { position: absolute; top: 10px; left: 11px; color: var(--muted); }
.searchbox input { padding-left: 36px; }
.toolbar-count { margin-left: auto; color: var(--muted); font-size: 12px; }

/* Projects/settings */
.project-list { border-top: 1px solid var(--line); }
.project-row { min-height: 64px; display: grid; grid-template-columns: minmax(190px, 1.1fr) minmax(220px, 1.4fr) 70px 120px 80px 92px; gap: 14px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.project-row > div:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-row > div:first-child > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.project-row small { color: var(--muted); }
.project-head { min-height: 38px; color: var(--muted); font-size: 11px; }
.project-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.summary-inline { min-height: 76px; display: flex; align-items: center; gap: 32px; padding-bottom: 18px; }
.summary-inline div { display: flex; flex-direction: column; }
.summary-inline span { color: var(--muted); font-size: 12px; }
.summary-inline strong { font-size: 22px; }
.summary-inline p { color: var(--muted); max-width: 66ch; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 620px) minmax(280px, 1fr); gap: 54px; }
.settings-layout section { padding-top: 4px; }
.settings-layout h2 { font-size: 17px; }
.settings-layout section > p { color: var(--muted); margin: 5px 0 24px; }
.settings-list { margin: 18px 0 0; border-top: 1px solid var(--line); }
.settings-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings-list dt { color: var(--muted); }
.settings-list dd { margin: 0; overflow-wrap: anywhere; }
.settings-list .status-dot { margin-right: 7px; }
.asset-heading { margin-bottom: 16px; }
.asset-list { border-top: 1px solid var(--line); }
.asset-row { min-height: 104px; display: grid; grid-template-columns: minmax(190px, .8fr) minmax(180px, .7fr) minmax(260px, 1.3fr) auto; gap: 22px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.asset-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.asset-identity > img { width: 34px; height: 34px; }
.asset-identity > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.asset-identity small, .asset-contract span, .asset-address { color: var(--muted); font-size: 11px; font-weight: 500; }
.asset-contract { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.asset-contract code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-address { gap: 5px; }
.asset-address input { height: 34px; font-size: 11px; }
.asset-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; max-width: 265px; }
.service-settings { margin-top: 42px; padding-top: 28px; border-top: 1px solid var(--line); }
.code-sample { margin-top: 16px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.account-layout { display: grid; grid-template-columns: minmax(0, 560px) minmax(300px, 1fr); gap: 70px; }
.account-layout section > p, .account-security > p { margin: 6px 0 24px; color: var(--muted); }
.account-security { padding-top: 4px; }
.account-actions { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; }

/* Drawer */
.detail-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 396px; max-width: 100%; background: var(--bg); border-left: 1px solid var(--line); z-index: var(--z-modal); transform: translateX(100%); transition: transform 220ms cubic-bezier(.22,1,.36,1); overflow-y: auto; }
.detail-drawer.open { transform: translateX(0); }
.drawer-backdrop { display: none; position: fixed; inset: 0; z-index: var(--z-backdrop); background: oklch(0.1 0.01 264 / .3); opacity: 0; transition: opacity 180ms ease; }
.drawer-head { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); }
.drawer-head span { color: var(--muted); font-size: 11px; }
.drawer-head h2 { margin-top: 2px; font-size: 15px; font-family: ui-monospace, monospace; }
.drawer-body { padding: 22px; }
.drawer-section { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.drawer-section:last-child { border: 0; }
.drawer-section h3 { margin-bottom: 12px; font-size: 13px; }
.drawer-list { margin: 0; }
.drawer-list div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 7px 0; }
.drawer-list dt { color: var(--muted); }
.drawer-list dd { margin: 0; overflow-wrap: anywhere; }
.drawer-amount { display: inline-flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 5px; }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 15px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline strong { display: block; font-size: 12px; }
.timeline span { color: var(--muted); font-size: 11px; }

/* Modals */
.modal { width: min(520px, calc(100% - 30px)); padding: 0; color: var(--ink); background: transparent; border: 0; overflow: visible; }
.modal::backdrop { background: oklch(0.1 0.01 264 / .42); backdrop-filter: blur(2px); }
.modal-shell { background: var(--bg); border-radius: 11px; box-shadow: var(--shadow); overflow: hidden; }
.modal-shell header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-shell h2 { font-size: 17px; }
.modal-shell header p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.modal-shell > .form-stack, .modal-shell > #secret-content { padding: 20px; }
.modal-shell footer { min-height: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.secret-modal > .alert { margin: 0 20px 18px; }
.secret-field { margin-bottom: 16px; }
.secret-field label { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.secret-value { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 6px; padding: 8px 8px 8px 11px; border-radius: 7px; background: var(--surface); }
.secret-value code { overflow-wrap: anywhere; font-size: 12px; }
.secret-value .icon-button { white-space: nowrap; font-size: 11px; }

/* Empty/toast */
.empty-state { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--muted); margin-bottom: 12px; }
.empty-state strong { font-size: 14px; }
.empty-state p { max-width: 42ch; margin: 5px 0 16px; color: var(--muted); font-size: 12px; }
.empty-state.compact { min-height: 150px; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 240px; max-width: 380px; padding: 11px 13px; border-radius: 8px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); animation: toast-in 180ms ease-out; }
.toast.error { background: oklch(0.4 0.16 28); color: white; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

/* Checkout */
.checkout-page { min-height: 100vh; background: var(--surface); padding: 22px; }
.checkout-shell { width: min(760px, 100%); margin: 0 auto; }
.checkout-header { height: 56px; display: flex; align-items: center; gap: 10px; font-weight: 650; }
.checkout-project { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.checkout-content { background: var(--bg); box-shadow: 0 5px 18px oklch(0.18 0.02 264 / .08); border-radius: 12px; overflow: hidden; }
.checkout-state { padding: 36px 36px 24px; text-align: center; }
.checkout-label { color: var(--muted); }
.checkout-amount { margin: 7px 0 5px; font-size: 34px; letter-spacing: -.025em; font-family: ui-monospace, monospace; }
.checkout-amount .asset-unit { display: inline-flex; align-items: center; gap: 6px; color: var(--tether); font: 650 14px/1 system-ui, sans-serif; vertical-align: middle; }
.checkout-amount .asset-unit img { width: 18px; height: 18px; }
.checkout-state > p:last-child { color: var(--muted); }
.state-symbol { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 22px; }
.status-expired .state-symbol, .status-cancelled .state-symbol { background: var(--surface); color: var(--muted); }
.checkout-grid { display: grid; grid-template-columns: 240px 1fr; gap: 30px; padding: 18px 36px 34px; }
.qr-box { align-self: start; display: grid; place-items: center; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.qr-box img { width: 100%; height: auto; }
.detail-list { margin: 0; }
.detail-list > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { margin: 5px 0 0; }
.copy-line { display: flex; align-items: center; gap: 8px; }
.copy-line code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { margin-left: auto; flex: 0 0 auto; border: 0; background: transparent; color: var(--primary); cursor: pointer; }
.payment-instructions .alert { margin: 16px 0 0; }
.checkout-meta { min-height: 52px; display: flex; justify-content: space-between; align-items: center; padding: 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.11 0.006 264);
    --surface: oklch(0.16 0.01 264);
    --surface-raised: oklch(0.19 0.012 264);
    --ink: oklch(0.94 0.006 264);
    --muted: oklch(0.7 0.015 264);
    --faint: oklch(0.52 0.016 264);
    --line: oklch(0.25 0.012 264);
    --line-strong: oklch(0.34 0.014 264);
    --primary: oklch(0.67 0.17 264);
    --primary-hover: oklch(0.72 0.15 264);
    --primary-soft: oklch(0.22 0.055 264);
    --success-soft: oklch(0.2 0.04 154);
    --danger-soft: oklch(0.21 0.045 28);
    --warning-soft: oklch(0.22 0.04 76);
    --sidebar: oklch(0.135 0.008 264);
  }
  .qr-box { border: 0; }
  .auth-brand { background: oklch(0.16 0.03 264); }
}

@media (max-width: 1040px) {
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
  .metric-strip > div:nth-child(3) { border-right: 0; }
  .metric-strip > div { padding-left: 14px; }
  .operations-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
  .project-row { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 70px 100px 80px; }
  .project-row > :nth-child(5) { display: none; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform 200ms cubic-bezier(.22,1,.36,1); box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .workspace { width: 100%; }
  .workspace::before { left: 0; }
  .mobile-menu { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: var(--surface); border-radius: 7px; }
  .content { padding: 20px; }
  .topbar { padding: 0 20px; }
  .operations-layout { display: block; }
  .exception-rail { margin-top: 28px; padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .exception-item { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; }
  .exception-item .exception-type, .exception-item strong, .exception-item p { grid-column: 1; }
  .exception-item .button { grid-column: 2; grid-row: 1 / 4; align-self: center; }
  .drawer-backdrop.visible { display: block; opacity: 1; }
  .settings-layout { grid-template-columns: 1fr; gap: 36px; }
  .asset-row { grid-template-columns: minmax(180px, .8fr) minmax(220px, 1fr); gap: 14px 24px; }
  .asset-address { grid-column: 1 / -1; }
  .asset-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .account-layout { grid-template-columns: 1fr; gap: 42px; }
}

@media (max-width: 620px) {
  .auth-page { padding: 0; background: var(--bg); }
  .auth-shell { min-height: 100vh; display: block; border-radius: 0; box-shadow: none; }
  .auth-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 38px 24px; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 48px; }
  .topbar { height: 66px; }
  .topbar p { display: none; }
  .topbar h1 { font-size: 18px; }
  .top-actions .secondary { display: none; }
  .content { padding: 16px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip > div:nth-child(2n) { border-right: 0; }
  .metric-strip > div:nth-child(3) { border-right: 1px solid var(--line); }
  .metric-strip > div:nth-child(n+5) { border-top: 1px solid var(--line); }
  .toolbar { flex-wrap: wrap; }
  .searchbox { width: 100%; }
  .toolbar select { width: calc(100% - 70px); }
  .project-row { grid-template-columns: minmax(160px, 1fr) 80px 88px; }
  .project-row > :nth-child(2), .project-row > :nth-child(4), .project-row > :nth-child(5) { display: none; }
  .project-head > :nth-child(3) { grid-column: 2; }
  .summary-inline { align-items: flex-start; flex-direction: column; gap: 10px; }
  .asset-heading { align-items: flex-start; }
  .asset-row { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 0; }
  .asset-contract { padding-left: 45px; }
  .asset-actions { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .checkout-page { padding: 0; background: var(--bg); }
  .checkout-header { padding: 0 18px; }
  .checkout-content { border-radius: 0; box-shadow: none; }
  .checkout-state { padding: 30px 20px 20px; }
  .checkout-amount { font-size: 28px; }
  .checkout-grid { grid-template-columns: 1fr; padding: 16px 22px 28px; }
  .qr-box { width: 220px; justify-self: center; }
  .checkout-meta { padding: 0 22px; }
}

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