:root {
  color-scheme: light;
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #152033;
  background: #f5f7fb;
  --ink: #152033;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #cfd5df;
  --surface: #fff;
  --surface-soft: #f8fafc;
  --accent: #315fce;
  --accent-dark: #254da8;
  --accent-soft: #eef3ff;
  --green: #087443;
  --green-soft: #ecfdf3;
  --orange: #a15c07;
  --orange-soft: #fff7e8;
  --red: #b42318;
  --red-soft: #fff1f0;
  --shadow: 0 10px 28px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; margin: -1px !important; padding: 0 !important; border: 0 !important; white-space: nowrap !important; }
body { min-width: 320px; margin: 0; overflow-x: hidden; background: #f5f7fb; }
body.drawer-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button { border: 0; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(49, 95, 206, .24); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .58; }
.app-shell { min-height: 100vh; }

.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 56px); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 750; }
.brand-name { font-size: 18px; line-height: 1.2; letter-spacing: 0; white-space: nowrap; }
.brand-primary { color: var(--accent); font-weight: 750; }
.brand-suffix { color: #344054; font-weight: 500; }
.topbar-right, .account-nav { display: flex; align-items: center; gap: 15px; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); }
.connection-state.online .connection-dot { background: var(--green); }
.connection-state.offline .connection-dot { background: var(--red); }
.nav-email { max-width: 250px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

main { max-width: 1160px; margin: 0 auto; padding: 48px 32px 72px; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 400px); justify-content: center; align-items: center; min-height: calc(100vh - 192px); margin: 0 auto; }
.auth-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.auth-tabs.registration-closed { grid-template-columns: 1fr; }
.auth-tab { position: relative; padding: 16px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 750; }
.auth-tab::after { position: absolute; right: 18px; bottom: -1px; left: 18px; height: 2px; background: transparent; content: ""; }
.auth-tab.active { color: var(--accent); }
.auth-tab.active::after { background: var(--accent); }
.auth-panel { padding: 30px 32px 27px; }
.auth-secondary-action { margin-top: 14px; text-align: center; }
.text-button { border: 0; padding: 3px 6px; color: var(--accent); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.text-button:hover { color: var(--accent-dark); text-decoration: underline; }
.account-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding: 13px 18px; }
.panel-heading { margin-bottom: 25px; }
.panel-heading h2 { margin: 0; color: var(--ink); font-size: 23px; font-weight: 760; letter-spacing: 0; }
.field { display: block; margin: 0 0 17px; color: #344054; font-size: 12px; font-weight: 700; }
.field input, .field textarea { display: block; width: 100%; margin-top: 8px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 11px 12px; color: var(--ink); background: var(--surface); transition: border-color .16s, box-shadow .16s; }
.field input { height: 44px; }
.field textarea { min-height: 184px; resize: vertical; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.field input::placeholder, .field textarea::placeholder { color: #a5adba; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 95, 206, .12); outline: 0; }
.field input[aria-invalid="true"] { border-color: #d92d20; }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(217, 45, 32, .12); }
.field-error { display: block; margin-top: 6px; color: var(--red); font-size: 11px; font-weight: 500; line-height: 1.4; }
.field-hint, .section-description { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.verification-step { margin: 22px 0 14px; border-top: 1px solid var(--line); padding-top: 20px; }
.verification-step .field { margin-bottom: 8px; }
.registration-submit { margin-top: 10px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; gap: 7px; border: 1px solid transparent; border-radius: 6px; padding: 9px 14px; cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 750; transition: background .16s, border-color .16s, color .16s, box-shadow .16s; }
.button:hover:not(:disabled) { box-shadow: 0 2px 5px rgba(16, 24, 40, .08); }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); }
.button-primary:disabled { border-color: #d0d5dd; color: #7f8998; background: #e4e7ec; opacity: 1; }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.button-secondary:hover:not(:disabled), .button-quiet:hover:not(:disabled) { border-color: #b8c1ce; background: var(--surface-soft); }
.button-quiet { min-height: 32px; border-color: transparent; color: var(--muted); background: transparent; }
.button-danger-quiet { min-height: 32px; border-color: transparent; color: var(--red); background: transparent; }
.button-block { width: 100%; }
.button-small { min-height: 31px; padding: 6px 10px; font-size: 12px; }
.inline-status { min-height: 22px; margin: 0 32px 24px; border-radius: 6px; padding: 9px 11px; color: var(--muted); background: transparent; font-size: 12px; }
.inline-status:empty { display: none; }
.inline-status.success { color: var(--green); background: var(--green-soft); }
.inline-status.error { color: var(--red); background: var(--red-soft); }
.inline-status.info { color: #315b9f; background: var(--accent-soft); }

.dashboard { padding-bottom: 10px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { margin: 0; color: var(--ink); font-size: 32px; font-weight: 780; letter-spacing: 0; line-height: 1.15; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.metric-card { min-height: 124px; border: 1px solid var(--line); border-radius: 8px; padding: 18px 19px; background: var(--surface); box-shadow: var(--shadow); }
.metric-balance { border-color: #c8d5f0; }
.metric-points { border-color: #d8c9ee; }
.metric-label, .metric-meta { display: block; color: var(--muted); font-size: 12px; }
.metric-value { display: block; margin: 14px 0 2px; color: var(--ink); font-size: 27px; font-weight: 780; letter-spacing: 0; }
.metric-health .metric-value { color: var(--green); font-size: 20px; }
.workspace-nav { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 25px; }
.workspace-tab { flex: 0 0 auto; border-bottom: 2px solid transparent; padding: 12px 17px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 750; }
.workspace-tab:hover { color: var(--ink); }
.workspace-tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.workspace-section { display: grid; gap: 16px; }
.section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 22px; background: var(--surface); box-shadow: var(--shadow); }
.form-panel { align-self: start; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-heading h2, .section-heading h3 { margin: 0; color: var(--ink); letter-spacing: 0; }
.section-heading h2 { font-size: 19px; font-weight: 760; }
.section-heading h3 { font-size: 15px; font-weight: 760; }
.page-section-heading { margin-bottom: 1px; align-items: flex-end; }
.page-section-heading h2 { font-size: 24px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 800; line-height: 1.2; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 12px 0; }
.detail-list div:first-child { border-top: 0; padding-top: 0; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { max-width: 70%; margin: 0; color: var(--ink); font-size: 13px; text-align: right; word-break: break-all; }
.mono { font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.shortcut-list { display: grid; gap: 0; }
.shortcut-button { display: flex; align-items: center; justify-content: space-between; width: 100%; border-top: 1px solid var(--line); padding: 14px 0; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.shortcut-button:first-child { border-top: 0; padding-top: 0; }
.shortcut-button b { font-size: 13px; font-weight: 700; }
.shortcut-arrow { color: var(--accent); font-size: 18px; }
.record-list { display: grid; gap: 8px; }
.record-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 13px 14px; background: var(--surface-soft); }
.credential-row { width: 100%; color: inherit; cursor: pointer; text-align: left; }
.credential-row:hover { border-color: #c3d1ec; background: #f5f8ff; }
.record-main { min-width: 0; }
.record-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 750; }
.record-subtitle { overflow: hidden; margin-top: 4px; color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.record-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.record-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 3px; }
.record-actions .button { min-height: 29px; padding: 5px 8px; font-size: 11px; }
.inline-number { width: 76px; height: 29px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 4px 6px; color: var(--ink); background: var(--surface); font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 750; }
.status-active { color: var(--green); background: var(--green-soft); }
.status-disabled, .status-deleted { color: var(--red); background: var(--red-soft); }
.status-pending, .status-unhealthy { color: var(--orange); background: var(--orange-soft); }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 6px; padding: 27px 18px; color: var(--muted); background: var(--surface-soft); font-size: 13px; text-align: center; }
.secret-callout { margin-top: 17px; border-left: 3px solid var(--orange); padding: 12px 13px; color: #73420f; background: var(--orange-soft); font-size: 12px; }
.secret-inline { flex: 1 0 100%; border-top: 1px solid var(--line); padding-top: 9px; }
.secret-value { display: block; overflow-wrap: anywhere; margin-top: 8px; color: var(--ink); font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.form-row { display: flex; align-items: flex-end; gap: 14px; }
.form-row > * { flex: 1; min-width: 0; }
.compact-field { margin-bottom: 0; }
.check-field { display: flex; align-items: center; gap: 8px; min-height: 44px; color: #435067; font-size: 12px; font-weight: 650; }
.check-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.credentials-grid { grid-template-columns: 1fr; align-items: start; }
.selected-summary { margin: -4px 0 20px; border-left: 3px solid var(--accent); padding: 10px 12px; background: var(--accent-soft); }
.selected-summary strong, .selected-summary span { display: block; }
.selected-summary strong { color: var(--ink); font-size: 13px; }
.selected-summary span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.secret-copy { display: inline-flex; margin-top: 9px; }
.credential-upload-key-panel { display: grid; gap: 0; }
.file-upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.file-picker { position: relative; overflow: hidden; }
.file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.credential-file-meta { display: inline-flex; align-items: center; min-height: 24px; border-radius: 4px; padding: 3px 7px; color: #315b9f; background: #edf2ff; font-size: 12px; font-weight: 700; }
.credential-file-meta:empty { display: none; }
.file-name { min-width: 0; flex: 1 1 220px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.file-preview { margin-top: 14px; border: 1px solid #c8d5f0; border-radius: 6px; padding: 10px 12px; color: #315b9f; background: #f6f8ff; font-size: 12px; }
.credential-upload-key-panel { padding-top: 14px; padding-bottom: 14px; }
.operation-key-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 34px; }
.operation-key-label { color: var(--ink); font-size: 13px; font-weight: 750; }
.operation-key-status { color: var(--muted); font-size: 12px; }
.operation-key-actions { display: inline-flex; align-items: center; gap: 6px; }
.one-time-secret { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 12px; min-width: 0; border: 1px solid #c8d5f0; border-radius: 6px; padding: 9px 10px 10px 12px; color: #315b9f; background: #f6f8ff; font-size: 12px; box-shadow: 0 10px 26px rgba(16, 24, 40, .14); }
.one-time-secret .secret-message { min-width: 0; }
.one-time-secret .secret-value { grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere; margin: 0; color: var(--ink); user-select: all; }
.one-time-secret-actions { display: inline-flex; align-items: center; gap: 2px; }
.one-time-secret-actions .icon-button { width: 28px; height: 28px; min-height: 28px; }
.one-time-secret-close { font-size: 20px; font-weight: 400; }
.modal { width: min(410px, calc(100vw - 32px)); margin: auto; border: 1px solid var(--line); border-radius: 8px; padding: 0; color: var(--ink); background: var(--surface); box-shadow: 0 24px 70px rgba(16, 24, 40, .2); }
.modal::backdrop { background: rgba(15, 23, 42, .36); }
.modal form { padding: 24px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.modal-heading h2 { margin: 0; font-size: 19px; font-weight: 760; }
.modal-hint { min-height: 20px; margin: -3px 0 16px; color: var(--muted); font-size: 12px; }
.modal .inline-status { margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast-region { position: fixed; z-index: 10; right: 24px; bottom: 24px; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 12px 14px; color: var(--ink); background: #fff; box-shadow: 0 10px 26px rgba(16, 24, 40, .14); font-size: 13px; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
code { border-radius: 3px; padding: 1px 4px; color: #315b9f; background: var(--accent-soft); font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { height: 62px; padding: 0 16px; }
  .connection-state { display: none; }
  main { width: 100%; max-width: 100%; overflow-x: hidden; padding: 32px 16px 52px; }
  .auth-layout, .auth-card, .auth-tabs, .auth-panel { width: 100%; max-width: 100%; min-width: 0; }
  .auth-layout { display: block; min-height: auto; }
  .auth-card { max-width: none; }
  .auth-panel { padding: 25px 22px 22px; }
  .section-grid, .credentials-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-heading h1 { font-size: 28px; }
  .metrics-grid { gap: 8px; }
  .metric-card { min-height: 106px; padding: 14px; }
  .metric-value { margin-top: 11px; font-size: 23px; }
  .panel { padding: 17px; }
  .record-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .record-meta, .record-actions { width: 100%; justify-content: flex-start; }
  .form-row { align-items: stretch; flex-direction: column; gap: 0; }
  .compact-field { margin-bottom: 17px; }
  .inline-status { margin-right: 22px; margin-left: 22px; }
}
@media (max-width: 430px) {
  .auth-panel { padding: 22px 19px 18px; }
  .inline-status { margin-right: 19px; margin-left: 19px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-label, .metric-meta { font-size: 10px; }
  .metric-value { font-size: 21px; }
}

/* Account workspace layout */
html, body { height: 100%; }
body { overflow: hidden; background: #f3f5f8; color: #172033; }
.app-shell { height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
.topbar { flex: 0 0 58px; height: 58px; padding: 0 24px; background: #fff; }
main { width: 100%; max-width: none; flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; }
.auth-layout { min-height: calc(100dvh - 58px); padding: 28px 16px; }
.dashboard { height: 100%; min-height: 0; display: flex; padding: 0; }
.sidebar { flex: 0 0 188px; min-width: 188px; border-right: 1px solid var(--line); background: #fff; padding: 22px 12px; }
.workspace { min-width: 0; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.mobile-heading { display: none; }
.metrics-strip { flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, minmax(115px, 1fr)); gap: 1px; border-bottom: 1px solid var(--line); background: var(--line); }
.dashboard:not(.section-overview) .metrics-strip { display: none; }
.metrics-strip .metric-card { min-height: 90px; border: 0; border-radius: 0; padding: 14px 18px; background: #fff; box-shadow: none; }
.metrics-strip .metric-value { margin: 8px 0 0; font-size: 21px; }
.metrics-strip .metric-health .metric-value { font-size: 17px; }
.content-viewport { min-height: 0; flex: 1 1 auto; overflow: hidden; padding: 26px 34px 28px; }
.workspace-section { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.page-section-heading { flex: 0 0 auto; margin: 0; align-items: flex-start; }
.page-section-heading h2 { font-size: 23px; line-height: 1.2; }
.page-section-heading .page-subtitle { margin-top: 5px; }
.eyebrow { margin-bottom: 6px; color: var(--accent); font-size: 10px; letter-spacing: .08em; }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.workspace-nav { display: grid; gap: 3px; margin: 0; border: 0; overflow: visible; }
.workspace-tab { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 6px; padding: 10px 11px; color: var(--muted); text-align: left; }
.workspace-tab:hover { color: var(--ink); background: var(--surface-soft); }
.workspace-tab.active { border: 0; color: var(--accent); background: var(--accent-soft); }
.nav-icon { width: 18px; color: currentColor; font-size: 17px; line-height: 1; text-align: center; }
.panel { border-radius: 7px; padding: 18px 20px; box-shadow: none; }
.section-heading { margin-bottom: 14px; }
.section-heading h3 { font-size: 14px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; }
.overview-grid .panel { min-height: 145px; }
.overview-ledger-panel { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.overview-ledger-panel .record-list { overflow: auto; }
.detail-list div { padding: 10px 0; }
.quick-actions { display: grid; gap: 0; }
.quick-action { display: flex; align-items: center; gap: 11px; width: 100%; border-top: 1px solid var(--line); padding: 11px 0; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.quick-action:first-child { border-top: 0; padding-top: 0; }
.quick-action > span:nth-child(2) { min-width: 0; flex: 1; }
.quick-action b, .quick-action small { display: block; }
.quick-action b { font-size: 13px; }
.quick-action small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.quick-action > span:last-child { color: var(--accent); font-size: 21px; }
.quick-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 5px; color: var(--accent); background: var(--accent-soft); font-size: 16px; }
.icon-button { display: inline-grid; width: 31px; height: 31px; place-items: center; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font-size: 18px; line-height: 1; }
.icon-button:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-soft); }
.list-panel { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.list-toolbar { flex: 0 0 auto; min-height: 28px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.list-toolbar h3 { margin: 0; font-size: 14px; }
.list-meta { color: var(--muted); font-size: 11px; }
.list-toolbar-hint { color: var(--subtle); font-size: 11px; }
.list-head { display: grid; grid-template-columns: minmax(180px, 1.7fr) minmax(90px, .65fr) minmax(72px, .5fr) minmax(92px, .6fr) minmax(118px, .8fr) auto; gap: 16px; padding: 0 4px 7px; color: var(--subtle); font-size: 10px; }
.credential-list-panel { --credential-grid-columns: minmax(220px, 1.65fr) minmax(112px, .78fr) minmax(96px, .68fr) minmax(220px, 1.55fr) minmax(82px, .62fr) minmax(104px, .78fr) minmax(104px, .78fr) minmax(104px, .78fr) minmax(118px, .88fr) minmax(108px, .8fr) 64px; }
.credential-head { width: 100%; min-width: 100%; grid-template-columns: var(--credential-grid-columns); gap: 12px; }
.credential-head > span:nth-child(2),
.credential-head > span:nth-child(3),
.credential-head > span:nth-child(5),
.credential-head > span:nth-child(6),
.credential-head > span:nth-child(7),
.credential-head > span:nth-child(8),
.credential-head > span:nth-child(9),
.credential-head > span:nth-child(10) { justify-self: center; text-align: center; }
.credential-policy-heading { position: relative; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.field-help { display: inline-grid; width: 15px; height: 15px; place-items: center; border: 1px solid #c3cad5; border-radius: 50%; padding: 0; color: var(--muted); background: var(--surface); cursor: help; font-size: 10px; font-weight: 800; line-height: 1; }
.field-help:hover, .field-help:focus-visible { border-color: var(--accent); color: var(--accent); outline: 0; }
.field-tooltip { position: absolute; z-index: 20; top: calc(100% + 7px); left: 0; width: 310px; visibility: hidden; border: 1px solid var(--line-strong); border-radius: 5px; padding: 9px 10px; color: var(--ink); background: var(--surface); box-shadow: 0 8px 24px rgba(16, 24, 40, .14); font-size: 11px; font-weight: 500; line-height: 1.55; opacity: 0; pointer-events: none; white-space: normal; transform: translateY(-3px); transition: opacity .14s, transform .14s, visibility .14s; }
.field-help:hover + .field-tooltip, .field-help:focus-visible + .field-tooltip { visibility: visible; opacity: 1; transform: translateY(0); }
.table-scroll { min-height: 0; flex: 1 1 auto; overflow: auto; }
.table-scroll > .list-head { position: sticky; z-index: 2; top: 0; background: var(--surface); }
.table-scroll > .table-list { min-height: 0; overflow: visible; }
.table-list { min-height: 0; }
.table-row { display: grid; grid-template-columns: minmax(180px, 1.7fr) minmax(90px, .65fr) minmax(72px, .5fr) minmax(92px, .6fr) minmax(118px, .8fr) auto; align-items: center; gap: 16px; min-height: 57px; border-top: 1px solid var(--line); padding: 9px 4px; }
.credential-list-panel .table-row { width: 100%; min-width: 100%; grid-template-columns: var(--credential-grid-columns); gap: 12px; }
.ledger-amount { color: var(--ink); font-weight: 700; text-align: right; }
.table-row:first-child { border-top: 0; }
.table-cell { min-width: 0; color: var(--muted); font-size: 12px; }
.table-cell strong { display: block; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.table-cell small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.table-row .record-actions { justify-content: flex-end; }
.credential-actions { min-width: 0; flex-wrap: nowrap; }
.credential-actions .button { flex: 0 0 auto; white-space: nowrap; }
.credential-state-action { min-width: 54px; }
.button-spinner { display: block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .7s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.table-row .button { min-height: 29px; }
.credential-list-row { min-height: 78px; cursor: pointer; transition: background .16s, border-color .16s; }
.credential-list-row:hover { border-color: #c3d1ec; background: #f7f9ff; }
.credential-list-row:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 95, 206, .12); outline: 0; }
.credential-identity { display: grid; align-content: center; gap: 2px; }
.credential-identity strong { font-size: 13px; }
.credential-identity .credential-provider { margin-top: 0; color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.15; text-transform: lowercase; }
.credential-identity .credential-name { min-width: 0; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.credential-identity .credential-plan { min-width: 0; overflow: hidden; margin-top: 0; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.credential-identity .credential-plan.has-plan { width: fit-content; max-width: 100%; margin-top: 2px; border: 1px solid #c9d9f7; border-radius: 4px; padding: 0 6px; color: #2455a4; background: #edf4ff; font-size: 11px; font-weight: 650; line-height: 18px; }
.credential-status-cell { min-width: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; text-align: center; }
.credential-status-cell .status-pill { white-space: nowrap; }
.credential-lock-summary { flex: 0 0 100%; overflow: hidden; color: #9b453e; font-size: 10.5px; line-height: 1.4; text-align: center; white-space: pre-line; }
.credential-request-cell { display: grid; justify-items: center; gap: 3px; text-align: center; }
.credential-request-cell strong { color: var(--ink); font-size: 12px; }
.credential-request-cell small { margin: 0; color: var(--muted); font-size: 10px; white-space: nowrap; }
.credential-quota-cell { min-width: 0; display: grid; gap: 6px; }
.credential-factor-cell { justify-self: center; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.usage-money { color: #244d39; font-variant-numeric: tabular-nums; font-weight: 720; text-align: center; white-space: nowrap; }
.credential-excluded-cell { overflow: hidden; color: var(--muted); font-size: 11px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.credential-policy-cell { min-width: 0; display: flex; align-items: center; justify-content: center; text-align: center; }
.credential-policy-label { display: none; color: var(--subtle); font-size: 10px; }
.credential-policy-value { display: inline-flex; min-width: 34px; min-height: 23px; align-items: center; justify-content: center; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 750; }
.credential-policy-value.is-enabled { color: #8a5b12; background: var(--orange-soft); }
.credential-policy-value.is-disabled { color: var(--muted); background: var(--surface-soft); }
.credential-admin-lock { display: grid; gap: 0; margin: -4px 0 12px; overflow: hidden; border: 1px solid #e1aaa4; border-radius: 6px; padding: 0 11px; color: #863b34; background: #fff2f0; font-size: 11px; line-height: 1.45; }
.credential-admin-lock[hidden] { display: none; }
.credential-admin-lock-row { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #efcbc7; }
.credential-admin-lock-row:first-child { border-top: 0; }
.credential-admin-lock-row strong { min-width: 0; font-size: 11px; }
.credential-admin-lock-row span { flex: 0 0 auto; color: #9b5d57; font-size: 10px; white-space: nowrap; }
.quota-compact-window { min-width: 0; }
.quota-compact-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.quota-compact-header strong { color: var(--ink); font-size: 11px; white-space: nowrap; }
.quota-progress-track { position: relative; height: 19px; display: grid; grid-template-columns: minmax(0, 1fr) clamp(88px, 45%, 126px) minmax(0, 1fr); align-items: center; gap: 4px; overflow: hidden; border-radius: 5px; padding: 0 7px; background: #e9edf3; }
.quota-progress-fill { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: hidden; border: 0; border-radius: inherit; appearance: none; background: transparent; }
.quota-progress-fill::-webkit-progress-bar { border-radius: inherit; background: transparent; }
.quota-progress-fill::-webkit-progress-value { border-radius: inherit; background: #a7d8bc; }
.quota-progress-fill::-moz-progress-bar { border-radius: inherit; background: #a7d8bc; }
.quota-progress-fill.is-low::-webkit-progress-value { background: #ead39f; }
.quota-progress-fill.is-low::-moz-progress-bar { background: #ead39f; }
.quota-progress-label, .quota-progress-reset, .quota-progress-value { position: relative; z-index: 1; min-width: 0; height: 100%; display: flex; align-items: center; overflow: hidden; box-sizing: border-box; margin: 0; color: #263a30; font-size: 9.5px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.quota-progress-label { justify-self: start; max-width: 100%; font-weight: 750; }
.quota-progress-reset { justify-self: stretch; justify-content: center; margin: 0 !important; color: #344054 !important; text-align: center; }
.quota-progress-value { justify-self: end; justify-content: flex-end; max-width: 100%; font-weight: 800; }
.clipboard-copy-proxy { position: fixed; top: 0; left: -9999px; opacity: 0; pointer-events: none; }
.quota-compact-empty { color: var(--subtle); font-size: 11px; }
.quota-compact-banner { border-radius: 4px; padding: 4px 7px; font-size: 10px; line-height: 1.35; }
.quota-compact-banner-cooldown { color: #8a5b12; background: var(--orange-soft); }
.credential-updated-cell { justify-self: center; color: var(--muted); font-size: 11px; text-align: center; white-space: nowrap; }
.credential-updated-cell small { display: block; margin-top: 2px; color: var(--subtle); font-size: 10px; }
.status-low { color: var(--orange); background: var(--orange-soft); }
.status-exhausted, .status-cooldown { color: var(--red); background: var(--red-soft); }
.status-unhealthy { color: var(--orange); background: var(--orange-soft); }
.record-list { min-height: 0; }
.record-row { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 11px 3px; background: transparent; }
.record-row:first-child { border-top: 0; }
.compact-list .record-row { min-height: 44px; }
.empty-state { margin-top: 5px; border: 1px dashed var(--line-strong); border-radius: 6px; padding: 38px 18px; background: #fafbfc; }
.credential-list-panel:not(.has-rows) .table-scroll { flex: 0 0 auto; overflow: visible; }
.credential-list-panel:not(.has-rows) .credential-head { display: none; }
.credential-list-panel:not(.has-rows) .empty-state { min-height: 112px; display: grid; margin-top: 0; place-items: center; }
.pagination { flex: 0 0 37px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 10px; }
.pagination-info { color: var(--muted); font-size: 11px; }
.pagination-actions { display: flex; gap: 5px; }
.pagination .button { min-height: 29px; padding: 5px 9px; font-size: 11px; }
.upload-panel { flex: 0 0 auto; padding: 13px 16px; }
.upload-panel .inline-status,
.operation-panel .inline-status { margin: 8px 0 0; padding: 8px 10px; }
.upload-toolbar { min-height: 44px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 12px 3px 3px; background: var(--surface); transition: border-color .16s, box-shadow .16s; }
.upload-toolbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 95, 206, .12); }
.upload-toolbar .file-picker { min-height: 36px; flex: 0 0 auto; border-color: transparent; background: var(--surface-soft); }
.upload-toolbar .file-name { min-width: 0; flex: 1 1 auto; }
.credential-upload-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.credential-upload-setting { min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; color: #344054; background: var(--surface-soft); font-size: 12px; font-weight: 700; }
.credential-upload-factor input { width: 116px; height: 34px; flex: 0 0 116px; margin: 0; border: 1px solid var(--line-strong); border-radius: 5px; padding: 6px 9px; color: var(--ink); background: var(--surface); font-variant-numeric: tabular-nums; transition: border-color .16s, box-shadow .16s; }
.credential-upload-factor input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 95, 206, .12); outline: 0; }
.factor-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.routing-options { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.routing-options summary { width: max-content; color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 700; }
.routing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.routing-grid .field { margin: 0; }
.routing-grid textarea { min-height: 64px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.credential-exclusion-section { margin-top: 12px; }
.credential-exclusion-section .setting-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preserve-setting { color: var(--muted); font-size: 10px; font-weight: 650; }
.excluded-model-editor { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfe; }
.excluded-model-toolbar { min-height: 40px; display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 5px 8px; background: #fff; }
.excluded-model-toolbar input { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 9px; color: var(--ink); background: #fff; font-size: 11px; }
.excluded-model-toolbar span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.excluded-model-options { max-height: 160px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 5px; overflow: auto; padding: 7px 8px; }
.excluded-model-option { min-width: 0; min-height: 31px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; color: var(--ink); background: #fff; cursor: pointer; }
.excluded-model-option input { position: absolute; opacity: 0; pointer-events: none; }
.excluded-model-option strong { min-width: 0; overflow: hidden; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.excluded-model-marker { width: 15px; height: 15px; display: grid; flex: 0 0 15px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: transparent; font-size: 13px; font-weight: 800; line-height: 1; }
.excluded-model-option.is-excluded { border-color: #efc7c3; background: var(--red-soft); }
.excluded-model-option.is-excluded .excluded-model-marker { border-color: var(--red); color: var(--red); }
.excluded-model-option.is-excluded strong { color: #8f4a45; }
.excluded-model-advanced { border-top: 1px solid var(--line); padding: 7px 8px 8px; }
.excluded-model-advanced summary { width: max-content; color: var(--accent); cursor: pointer; font-size: 10px; font-weight: 700; }
.excluded-model-advanced textarea { width: 100%; min-height: 58px; margin-top: 7px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 7px 8px; resize: vertical; color: var(--ink); background: #fff; font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.credential-readonly-line { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding: 9px 2px; color: var(--muted); font-size: 11px; }
.credential-readonly-line strong { max-width: 70%; overflow: hidden; color: var(--ink); font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.copyable-value { display: flex; align-items: center; gap: 8px; }
.copyable-value code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-action { position: relative; }
.copy-glyph,
.copy-glyph::after { position: absolute; width: 8px; height: 9px; border: 1px solid currentColor; border-radius: 1px; content: ""; }
.copy-glyph { top: 50%; left: 50%; transform: translate(-65%, -65%); }
.copy-glyph::after { top: 3px; left: 3px; background: #fff; }
.copy-feedback { color: transparent !important; }
.copy-feedback > * { visibility: hidden; }
.copy-feedback::after { position: absolute; top: 50%; left: 50%; display: block; content: ""; }
.copy-feedback-success::after { width: 10px; height: 5px; border-bottom: 2px solid var(--green); border-left: 2px solid var(--green); transform: translate(-50%, -70%) rotate(-45deg); }
.copy-feedback-error::after { color: var(--red); content: "×"; font-size: 17px; font-weight: 750; line-height: 1; transform: translate(-50%, -52%); }
.compact-check { min-height: 31px; margin-left: auto; }
.operation-panel { flex: 0 0 auto; padding: 12px 16px; }
.operation-key-line { min-height: 30px; }
.operation-key-actions:empty { display: none; }
.drawer-backdrop { position: fixed; z-index: 20; inset: 0; background: rgba(15, 23, 42, .14); backdrop-filter: none; opacity: 1; transition: opacity .18s ease; }
.drawer-backdrop[hidden] { display: block !important; visibility: hidden; opacity: 0; pointer-events: none; }
.drawer { position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); overflow: auto; border-left: 1px solid var(--line); padding: 30px 27px 28px; background: #fff; box-shadow: -18px 0 44px rgba(16, 24, 40, .16); transform: translateX(0); transition: transform .2s ease, opacity .2s ease; }
.drawer[hidden] { display: block !important; visibility: hidden; opacity: 0; pointer-events: none; transform: translateX(24px); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.drawer-header h3 { margin: 0; font-size: 17px; }
.quota-summary { min-width: 0; }
.quota-heading, .quota-row { display: flex; align-items: center; gap: 10px; }
.quota-heading > span, .quota-row small, .quota-empty { color: var(--muted); font-size: 11px; }
.quota-cooldown { margin: 0 0 8px; border-radius: 4px; padding: 7px 8px; color: #8a5b12; background: #fff6df; font-size: 11px; line-height: 1.45; }
.quota-row { border-top: 1px solid var(--line); padding: 8px 0; }
.quota-row:first-of-type { border-top: 0; }
.quota-row > span { min-width: 0; flex: 1; color: var(--ink); font-size: 12px; }
.quota-row strong { color: var(--ink); font-size: 12px; white-space: nowrap; }
.quota-row small { min-width: 98px; text-align: right; }
.quota-empty { margin: 0; line-height: 1.5; }
.quota-summary .quota-compact-window + .quota-compact-window { margin-top: 6px; }
.quota-credit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.quota-credit-row span { color: var(--muted); font-size: 11px; }
.quota-credit-row strong { color: var(--ink); font-size: 12px; }
.drawer > .inline-status { margin: 13px 0 0; padding: 9px 11px; }
.modal { width: min(560px, calc(100vw - 32px)); }
.modal form { padding: 23px; }
.modal-heading h2 { font-size: 18px; }
.toast-region { right: 20px; bottom: 20px; }

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100dvh; }
  main { min-height: calc(100dvh - 58px); }
  .dashboard { min-height: calc(100dvh - 58px); display: block; }
  .sidebar { min-width: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; }
  .workspace-nav { display: flex; overflow-x: auto; gap: 3px; }
  .workspace-tab { width: auto; flex: 0 0 auto; padding: 8px 12px; }
  .metrics-strip { grid-template-columns: repeat(3, 1fr); }
  .content-viewport { overflow: visible; padding: 22px 18px 30px; }
  .table-list { overflow: visible; }
  .overview-grid { grid-template-columns: 1fr; }
  .workspace-section { height: auto; min-height: calc(100dvh - 225px); }
  .list-panel { min-height: 0; }
  .drawer { top: 0; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 16px; }
  .nav-email { max-width: 145px; }
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .metrics-strip .metric-card { min-height: 78px; padding: 11px 13px; }
  .metrics-strip .metric-value { font-size: 18px; }
  .content-viewport { padding: 18px 12px 24px; }
  .page-section-heading { gap: 10px; }
  .page-section-heading h2 { font-size: 21px; }
  .page-section-heading .page-subtitle { max-width: 250px; }
  .panel { padding: 15px; }
  .table-row, .credential-list-panel .table-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .list-head { display: none; }
  .table-row .table-cell:nth-child(2), .table-row .table-cell:nth-child(3), .table-row .table-cell:nth-child(4), .table-row .table-cell:nth-child(5) { grid-column: 1; }
  .table-row .record-actions { grid-column: 2; grid-row: 1 / span 5; }
  .credential-list-row { min-height: 0; padding: 13px 2px; }
  .credential-list-row .credential-status-cell,
  .credential-list-row .credential-request-cell,
  .credential-list-row .credential-quota-cell,
  .credential-list-row .credential-policy-cell,
  .credential-list-row .credential-updated-cell { grid-column: 1; }
  .credential-list-row .credential-actions { grid-column: 2; grid-row: 1 / span 5; align-self: center; }
  .credential-quota-cell { max-width: 100%; }
  .credential-policy-cell { display: flex; align-items: center; gap: 7px; }
  .credential-policy-label { display: inline; }
  .upload-toolbar { align-items: center; }
  .credential-upload-options { grid-template-columns: 1fr; gap: 10px; }
  .routing-grid { grid-template-columns: 1fr; }
  .drawer { top: 0; width: 100%; padding: 22px 18px 24px; }
}

/* Usage analytics */
.usage-total-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 10px 0; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.usage-total-strip > div { min-width: 0; padding: 9px 11px; background: #fff; }
.usage-total-strip span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.usage-total-strip strong { display: block; overflow: hidden; color: #244d39; font-size: 12px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.usage-page { min-width: 0; }
.usage-toolbar { display: grid; grid-template-columns: 116px 142px 112px minmax(145px, 1fr) minmax(145px, 1fr) minmax(145px, 1fr) auto; align-items: center; gap: 7px; margin-bottom: 8px; }
.usage-toolbar select, .usage-toolbar input, .usage-panel-heading select { width: 100%; min-height: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; color: var(--ink); background: #fff; font-size: 11px; }
.usage-toolbar select:disabled { color: var(--subtle); background: var(--surface-soft); }
.usage-freshness { min-height: 20px; margin-bottom: 6px; color: var(--muted); font-size: 10.5px; text-align: right; }
.usage-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-bottom: 8px; }
.usage-metrics article { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; background: #fff; }
.usage-metrics span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.usage-metrics strong { display: block; overflow: hidden; color: #244d39; font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.usage-analysis-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 8px; min-height: 330px; }
.usage-analysis-grid > .panel { min-width: 0; margin: 0; padding: 14px; }
.usage-panel-heading { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.usage-panel-heading strong { color: var(--ink); font-size: 12px; }
.usage-panel-heading > div { display: flex; gap: 6px; }
.usage-panel-heading select { width: auto; min-width: 118px; }
#billing-request-source { width: auto; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; color: var(--ink); background: #fff; font: inherit; }
.usage-bars { height: 270px; display: flex; align-items: stretch; gap: 3px; overflow-x: auto; border-top: 1px solid var(--line); padding: 12px 4px 0; }
.usage-bars > .empty-state { width: 100%; flex: 1 0 100%; }
.usage-bar { min-width: 10px; flex: 1 0 10px; display: grid; grid-template-rows: 1fr 18px; align-items: end; gap: 5px; }
.usage-bar i { width: 100%; min-height: 2px; display: block; border-radius: 3px 3px 1px 1px; background: #a9d3bc; }
.usage-bar:hover i { background: #589574; }
.usage-bar span { overflow: hidden; color: var(--muted); font-size: 8px; text-align: center; white-space: nowrap; }
.usage-ranking { max-height: 270px; overflow: auto; }
.usage-ranking > div:not(.empty-state) { min-height: 38px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 5px 4px; }
.usage-ranking > div > span { color: var(--subtle); font: 700 10px ui-monospace, monospace; text-align: center; }
.usage-ranking > div > strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.usage-ranking > div > em { color: #367353; font-size: 11px; font-style: normal; font-weight: 750; }

@media (max-width: 1200px) {
  .usage-toolbar { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .usage-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .usage-analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .usage-toolbar, .usage-metrics, .usage-total-strip { grid-template-columns: 1fr 1fr; }
  .usage-toolbar button { grid-column: 1 / -1; }
  .usage-panel-heading { align-items: stretch; flex-direction: column; }
  .usage-panel-heading > div { display: grid; grid-template-columns: 1fr 1fr; }
  .usage-panel-heading select { width: 100%; min-width: 0; }
}

/* Dense AI management surfaces */
.key-head,
.key-row { grid-template-columns: minmax(230px, 340px) 82px 68px 116px 112px minmax(150px, 240px) 125px 132px 136px 90px; justify-content: space-between; }
.key-head { min-width: 1395px; gap: 12px; }
.key-head > span:nth-child(2),
.key-head > span:nth-child(3),
.key-head > span:nth-child(4),
.key-head > span:nth-child(5),
.key-head > span:nth-child(10) { justify-self: center; text-align: center; }
.key-row { min-width: 1395px; gap: 12px; min-height: 52px; padding-top: 7px; padding-bottom: 7px; cursor: pointer; }
.key-row > .table-cell:nth-child(2),
.key-row > .table-cell:nth-child(3),
.key-row > .table-cell:nth-child(4),
.key-row > .table-cell:nth-child(5) { justify-self: center; text-align: center; }
.key-row:hover { background: #f7f9ff; }
.key-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); outline: 0; }
.key-row .record-actions { flex-wrap: nowrap; }
.key-row > .record-actions,
.credential-list-row > .record-actions { justify-self: center; justify-content: center; }
.ellipsis-cell,
.key-limit-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-icon-button { width: 29px; height: 29px; min-height: 29px; font-size: 14px; }

@media (min-width: 1501px) {
  .key-head > span:last-child,
  .credential-head > span:last-child,
  .key-row > .record-actions,
  .credential-list-row > .record-actions {
    position: sticky;
    z-index: 3;
    right: 0;
    background: var(--surface);
    border-left: 1px solid var(--line);
  }
  .key-head > span:last-child,
  .credential-head > span:last-child {
    display: flex;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    justify-self: stretch;
  }
  .key-row > .record-actions,
  .credential-list-row > .record-actions {
    min-height: 100%;
    justify-content: center;
    justify-self: stretch;
    padding-left: 8px;
  }
  .key-row:hover > .record-actions,
  .credential-list-row:hover > .record-actions { background: #f7f9ff; }
}

.business-drawer { width: min(610px, 100vw); padding: 0 20px 26px; background: #f7f9fc; }
.business-drawer > .drawer-header { min-height: 74px; align-items: center; gap: 18px; margin: 0 -20px 14px; border-bottom: 1px solid var(--line); padding: 14px 20px; color: var(--ink); background: #fff; }
.business-drawer > .drawer-header > div { width: 0; min-width: 0; flex: 1 1 0; overflow: hidden; }
.business-drawer > .drawer-header .eyebrow { color: var(--accent); }
.business-drawer > .drawer-header h3 { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.business-drawer > .drawer-header .icon-button { flex: 0 0 38px; width: 38px; height: 38px; color: var(--muted); background: transparent; border-color: var(--line); }
.detail-tabs { width: fit-content; display: flex; gap: 3px; padding: 3px; margin: 0 0 14px; background: #e7ebf2; border-radius: 7px; }
.detail-tabs button { min-height: 31px; height: 31px; border-radius: 5px; padding: 0 14px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }
.detail-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(16,24,40,.1); }
.detail-tab-panel { min-width: 0; }
.key-status-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px; background: #fff; }
.key-status-main { display: flex; align-items: center; gap: 9px; }
.key-secret-row { min-height: 54px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 9px; border: 1px solid #b9d9c6; border-radius: 7px; padding: 9px 12px; color: #23543e; background: #e9f5ee; }
.key-secret-value { min-width: 0; display: block; }
.key-secret-value code { display: block; min-width: 0; overflow: hidden; border: 0; border-radius: 0; padding: 0; color: #173c2a; background: transparent; font-size: 13px; font-weight: 650; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.key-secret-actions { display: flex; align-items: center; gap: 7px; }
.key-secret-actions .button { min-width: 76px; }
.key-secret-actions .copy-icon-button { background: #fff; border-color: #b9d9c6; }
.key-usage-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.key-metadata-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.key-metadata-grid > div { min-width: 0; display: grid; align-content: start; gap: 6px; border: 1px solid var(--line); border-radius: 7px; padding: 11px 12px; background: #fff; }
.key-metadata-grid span { color: #4c5e54; font-size: 10.5px; font-weight: 700; }
.key-metadata-grid code { overflow: hidden; border: 0; padding: 0; color: #243b2f; background: transparent; font-size: 11px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.key-setting-section { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 7px; padding: 12px; background: #fff; }
.key-setting-section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.key-setting-section > header strong { color: var(--ink); font-size: 12px; }
.key-setting-section > header span { color: var(--subtle); font-size: 10px; }
.key-setting-section .routing-grid { margin-top: 0; }
.key-expiry-field { width: min(280px, 100%); margin-top: 2px; }
.credential-status-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px; background: var(--surface); }
.credential-status-main,
.credential-status-actions,
.credential-state-group { display: flex; align-items: center; gap: 8px; }
.credential-status-main { min-width: 0; }
.credential-status-actions { flex: 0 0 auto; }
.credential-section-label { color: var(--muted); font-size: 11px; }
.credential-status-actions .button { min-width: 54px; }
.button-danger-outline { border-color: #e0aaa6; color: var(--red); background: #fff; }
.button-danger-outline:hover:not(:disabled) { border-color: #cf817b; background: var(--red-soft); }
.credential-detail-section { margin-top: 9px; border: 1px solid var(--line); border-radius: 7px; padding: 12px; background: var(--surface); }
.credential-detail-section > header { min-height: 31px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.credential-detail-section > header > div:first-child { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.credential-detail-section h4 { margin: 0; color: var(--ink); font-size: 13px; }
.credential-detail-section > header span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.credential-section-actions { display: flex; align-items: center; gap: 7px; }
.credential-section-actions .button { min-width: 76px; }
.credential-info-section .credential-readonly-line { min-height: 35px; border-top: 1px solid var(--line); padding: 9px 1px 0; }
.credential-info-section > header { margin-bottom: 9px; }
.credential-fact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.credential-fact-grid > div { min-width: 0; min-height: 58px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; background: #fff; }
.credential-fact-grid span { color: var(--muted); font-size: 10px; }
.credential-fact-grid strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.credential-request-metrics { margin-bottom: 0; }
.credential-money-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 9px; margin-bottom: 0; }
.credential-money-metrics strong { color: #244d39; }
.credential-metadata-grid { margin: 0; }
.credential-policy-section { gap: 10px; }
.credential-policy-basic-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(180px, .65fr); align-items: stretch; gap: 9px; }
.credential-policy-basic-grid > .switch-setting,
.credential-policy-basic-grid > .credential-factor-field { min-height: 52px; height: 100%; margin: 0; }
.credential-factor-field { grid-template-columns: auto minmax(96px, 120px); align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface-soft); }
.credential-factor-field > span { white-space: nowrap; }
.credential-factor-field input { height: 34px; margin-top: 0; }
.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fact-grid > div { min-width: 0; min-height: 64px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; background: var(--surface-soft); }
.fact-grid span { color: var(--muted); font-size: 10px; }
.fact-grid strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.detail-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); margin-top: 15px; padding-top: 13px; }
.settings-form { display: grid; gap: 14px; }
.field-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(100px, .55fr) minmax(130px, .7fr); gap: 10px; }
.limit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.setting-section { display: grid; gap: 9px; border-top: 1px solid var(--line); padding-top: 12px; }
.compact-setting-section { margin-top: 14px; }
.setting-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.setting-section-head strong { color: var(--ink); font-size: 12px; }
.setting-section-head span { color: var(--subtle); font-size: 10px; }
.settings-footer { position: sticky; bottom: -28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 2px; padding: 16px 0 0; background: linear-gradient(to bottom, rgba(247,249,252,0), #f7f9fc 24%); }
.settings-hint { color: var(--muted); font-size: 11px; }
.model-picker { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfe; }
.model-picker-toolbar { min-height: 42px; display: grid; grid-template-columns: auto minmax(130px, 1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 6px 8px; background: #fff; }
.model-scope-control { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; padding: 2px; background: var(--surface-soft); }
.model-scope-control label { position: relative; cursor: pointer; }
.model-scope-control input { position: absolute; opacity: 0; pointer-events: none; }
.model-scope-control span { min-height: 27px; display: inline-flex; align-items: center; border-radius: 3px; padding: 4px 10px; color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.model-scope-control input:checked + span { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.model-scope-control input:focus-visible + span { box-shadow: 0 0 0 2px rgba(49, 95, 206, .18); }
.model-picker-search { width: 100%; height: 31px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 9px; color: var(--ink); background: #fff; font-size: 11px; }
.model-picker-search::placeholder { color: var(--subtle); }
.model-picker-tools { min-height: 31px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 4px 9px 0; }
.model-picker-count { margin-right: auto; color: var(--muted); font-size: 10px; }
.model-picker-tool { padding: 3px 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.model-picker-tool:disabled { color: var(--subtle); }
.model-picker-options { max-height: 168px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 6px; overflow: auto; padding: 6px 8px 8px; }
.model-option { position: relative; min-width: 0; cursor: pointer; }
.model-option input { position: absolute; opacity: 0; pointer-events: none; }
.model-option span { min-height: 32px; display: flex; align-items: center; gap: 7px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; color: var(--muted); background: #fff; }
.model-option strong, .model-option small { overflow: hidden; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.model-option strong { min-width: 0; flex: 1 1 auto; font-size: 11px; font-weight: 650; }
.model-option small { flex: 0 0 auto; color: var(--subtle); font-size: 9px; }
.model-option input:checked + span { border-color: #9ab3ed; color: #244ea5; background: var(--accent-soft); }
.model-option.is-unconfigured span { border-color: #efd2d2; color: #9f3a38; background: var(--red-soft); }
.model-option.is-unconfigured input:not(:checked) + span { border-style: dashed; color: var(--subtle); background: #f7f8fa; }
.model-option:has(input:disabled) { cursor: default; }
.model-option input:focus-visible + span { box-shadow: 0 0 0 2px rgba(49, 95, 206, .15); }
.model-picker-empty { padding: 6px; color: var(--subtle); font-size: 11px; }

.model-price-panel { min-height: 0; display: flex; flex-direction: column; }
.model-price-toolbar { gap: 14px; }
.model-price-toolbar-main { min-width: 0; display: flex; flex: 1 1 auto; align-items: center !important; gap: 12px !important; }
.model-price-search { position: relative; width: min(300px, 45vw); }
.model-price-search input { width: 100%; height: 32px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 5px 30px 5px 10px; color: var(--ink); background: #fff; font-size: 11px; }
.search-icon { position: absolute; top: 9px; right: 10px; width: 11px; height: 11px; border: 1.5px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { position: absolute; right: -4px; bottom: -3px; width: 5px; height: 1.5px; background: var(--muted); content: ""; transform: rotate(45deg); }
.model-price-hint { min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.model-price-settlement-hint { color: var(--orange); font-weight: 650; }
.model-price-head,
.model-price-row { min-width: 1040px; grid-template-columns: minmax(220px, 1fr) 76px repeat(4, minmax(100px, 150px)) minmax(360px, 1.5fr); gap: 12px; }
.model-price-head { font-size: 11px; font-weight: 650; }
.model-price-head > span:nth-child(n+3):nth-child(-n+6),
.model-price-number { justify-self: stretch; text-align: center; }
.model-price-row { min-height: 60px; padding-top: 7px; padding-bottom: 7px; }
.model-price-row > .table-cell { font-size: 13px; }
.model-price-identity strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }
.model-price-identity small { font-size: 12px; }
.model-price-number { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.model-price-rules { width: fit-content; max-width: 100%; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 7px; }
.model-price-rule { min-width: 0; grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; border: 1px solid #c8ded2; border-radius: 6px; padding: 3px 7px; color: #315343; background: #f1f7f4; }
.model-price-rule strong, .model-price-rule small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-price-rule strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.model-price-rule small { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.icon-button.is-loading { animation: button-spin .7s linear infinite; }
.switch-setting { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; background: var(--surface-soft); }
.switch-setting > div { display: grid; gap: 3px; }
.switch-setting strong { color: var(--ink); font-size: 12px; }
.switch-setting span { color: var(--muted); font-size: 10px; }
.switch-control { position: relative; width: 34px; height: 20px; display: inline-flex; flex: 0 0 34px; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; }
.switch-control i { width: 100%; border-radius: 999px; background: #c7ced8; transition: background .15s; }
.switch-control i::after { width: 14px; height: 14px; display: block; border-radius: 50%; margin: 3px; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.25); content: ""; transition: transform .15s; }
.switch-control input:checked + i { background: var(--accent); }
.switch-control input:checked + i::after { transform: translateX(14px); }
.switch-control:has(input:disabled) { cursor: not-allowed; opacity: .58; }
.switch-control.is-loading i::after { opacity: 0; }
.switch-control.is-loading::after { position: absolute; top: 5px; left: 12px; width: 10px; height: 10px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; content: ""; animation: button-spin .7s linear infinite; }
#credential-state-toggle { width: 42px; height: 24px; flex-basis: 42px; }
#credential-state-toggle i::after { width: 18px; height: 18px; }
#credential-state-toggle input:checked + i::after { transform: translateX(18px); }
#credential-state-toggle.is-loading::after { top: 7px; left: 16px; }

@media (max-width: 560px) {
  .credential-status-head { align-items: center; }
  .credential-status-main { align-items: flex-start; flex-direction: column; gap: 5px; }
  .credential-detail-section > header { align-items: flex-start; }
  .credential-detail-section > header > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .credential-section-actions .button { min-width: 68px; padding-right: 8px; padding-left: 8px; }
  .business-drawer { padding-right: 18px; padding-left: 18px; }
  .business-drawer > .drawer-header { margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  .key-secret-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-right: 9px; padding-left: 10px; }
  .key-secret-value code { font-size: 12px; }
  .key-secret-actions { gap: 4px; }
  .key-secret-actions .button { min-width: 68px; padding-right: 8px; padding-left: 8px; }
  .key-usage-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-metadata-grid { grid-template-columns: 1fr; }
  .credential-fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credential-policy-basic-grid { grid-template-columns: 1fr; }
  .credential-money-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credential-money-metrics > div:last-child { grid-column: 1 / -1; }
}

.credential-upload-dialog { width: min(680px, calc(100vw - 32px)); }
.credential-upload-dialog { max-height: min(90dvh, 860px); overflow: auto; }
.credential-upload-dialog form { padding: 22px; }
.credential-upload-dialog .inline-status { margin: 14px 0 0; }
.credential-upload-actions { justify-content: center; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.credential-upload-actions .button { min-width: 104px; }
.credential-export-dialog { width: min(440px, calc(100vw - 32px)); }
.credential-export-dialog form { padding: 22px; }
.export-credential-name { overflow: hidden; margin: 2px 0 16px; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.password-reset-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.password-reset-dialog::backdrop { background: rgba(15, 23, 42, .26); backdrop-filter: blur(2px); }
.password-reset-dialog form { padding: 24px; }
.password-reset-dialog .modal-heading { align-items: center; margin-bottom: 22px; }
.password-reset-dialog .modal-heading h2 { font-size: 20px; }
.password-reset-dialog .modal-heading .icon-button { flex: 0 0 32px; width: 32px; height: 32px; }
.password-reset-dialog .field { margin-bottom: 18px; font-size: 13px; }
.password-reset-dialog .field input { height: 46px; margin-top: 7px; font-size: 14px; }
.password-reset-account-email { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; margin-bottom: 20px; border-bottom: 1px solid var(--line); padding-bottom: 16px; font-size: 13px; }
.password-reset-account-email span { color: var(--muted); }
.password-reset-account-email strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 650; }
.password-reset-dialog .verification-step { margin: 0; border: 0; padding: 0; }
.password-reset-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 136px; align-items: start; gap: 10px; }
.password-reset-code-row .field { min-width: 0; }
.password-reset-resend { width: 136px; min-height: 46px; margin-top: 27px; padding: 8px; font-size: 12px; white-space: nowrap; }
.password-reset-resend:disabled { opacity: 1; color: var(--muted); background: var(--surface-soft); }
.password-reset-dialog .inline-status { margin: 0 0 16px; padding: 9px 11px; font-size: 12px; line-height: 1.45; }
.password-reset-dialog .inline-status:empty { display: none; }
.password-reset-actions { justify-content: flex-end; margin-top: 8px; }
.password-reset-actions .button { min-width: 104px; min-height: 44px; font-size: 13px; }
.password-reset-actions .button-primary { min-width: 132px; }
.credential-toolbar-primary,
.credential-toolbar-actions { display: flex; align-items: center; gap: 7px; }
.credential-toolbar-primary .operation-key-line { min-height: 30px; border-right: 1px solid var(--line); padding-right: 9px; }
.credential-toolbar-primary .inline-status { margin: 0; padding: 0; }
.credential-toolbar-primary .one-time-secret { position: fixed; z-index: 50; right: 22px; bottom: 22px; width: min(560px, calc(100vw - 44px)); }

.segmented-control { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; padding: 2px; background: var(--surface-soft); }
.segmented-control button { min-height: 28px; border-radius: 3px; padding: 4px 11px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.segmented-control button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.billing-head.balance-head,
.ledger-row { grid-template-columns: 140px 105px 80px 110px 110px 110px minmax(220px, 1fr) 110px minmax(220px, 1fr) minmax(220px, 1fr); }
.billing-head.point-head,
.point-row { grid-template-columns: 140px 90px 180px minmax(280px, 480px) minmax(280px, 480px); }
.billing-head,
.billing-row { justify-content: start; gap: 12px; }
.billing-head.balance-head > span:nth-child(4), .billing-head.balance-head > span:nth-child(5), .billing-head.balance-head > span:nth-child(6) { text-align: right; }
.ledger-row .amount-cell { text-align: right; }
.billing-row { min-height: 54px; }
.amount-cell { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 750; }
.amount-cell.positive { color: var(--green); }
.amount-cell.negative { color: var(--red); }
.billing-id-cell { display: flex; align-items: center; gap: 5px; }
.billing-id-cell code { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.billing-model-cell { display: grid; min-width: 0; gap: 3px; }
.billing-model-cell strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.billing-model-cell small { color: var(--muted); font-size: 10px; }
.mini-copy-button { width: 25px; height: 25px; min-height: 25px; flex: 0 0 25px; font-size: 12px; }

@media (max-width: 1200px) {
  .billing-head { display: none; }
  .billing-row,
  .ledger-row,
  .point-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 14px; padding: 12px 2px; }
  .billing-row > .table-cell { min-width: 0; grid-column: auto !important; grid-row: auto !important; text-align: left; }
  .billing-row > .table-cell::before { display: block; margin-bottom: 3px; color: var(--subtle); font-family: inherit; font-size: 9px; font-weight: 600; line-height: 1.2; content: attr(data-label); }
  .billing-row > .billing-id-cell { grid-column: 1 / -1 !important; }
}

@media (max-width: 1500px) {
  .key-row [data-label]::before,
  .credential-list-row [data-label]::before { display: block; margin-bottom: 3px; color: var(--subtle); font-family: inherit; font-size: 9px; font-weight: 600; line-height: 1.2; content: attr(data-label); }
}

@media (min-width: 901px) and (max-width: 1500px) {
  .key-head,
  .credential-head { display: none; }
  .key-row { min-width: 0; grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(92px, .7fr)) 94px; grid-template-rows: repeat(3, auto); gap: 7px 14px; padding: 11px 4px; }
  .key-row > .table-cell:nth-child(1) { grid-column: 1; grid-row: 1 / span 3; align-self: center; }
  .key-row > .table-cell:nth-child(2) { grid-column: 2; grid-row: 1; }
  .key-row > .table-cell:nth-child(3) { grid-column: 3; grid-row: 1; }
  .key-row > .table-cell:nth-child(4) { grid-column: 4; grid-row: 1; }
  .key-row > .table-cell:nth-child(5) { grid-column: 5; grid-row: 1; }
  .key-row > .table-cell:nth-child(6) { grid-column: 2 / span 2; grid-row: 2; }
  .key-row > .table-cell:nth-child(7) { grid-column: 4 / span 2; grid-row: 2; }
  .key-row > .table-cell:nth-child(8) { grid-column: 2 / span 2; grid-row: 3; }
  .key-row > .table-cell:nth-child(9) { grid-column: 4 / span 2; grid-row: 3; }
  .key-row > .record-actions { grid-column: 6; grid-row: 1 / span 3; align-self: center; }
  .key-row > [data-label] { min-width: 0; display: grid; align-content: center; justify-self: stretch !important; text-align: left !important; }
  .key-row > .record-actions { justify-self: end; justify-content: flex-end; }

  .credential-list-panel .credential-list-row { min-width: 0; grid-template-columns: minmax(210px, 1.2fr) minmax(150px, .95fr) repeat(4, minmax(82px, .7fr)) 64px; grid-template-rows: repeat(3, auto); gap: 7px 12px; padding: 11px 4px; }
  .credential-list-row > .credential-identity { grid-column: 1; grid-row: 1 / span 3; align-self: center; }
  .credential-list-row > .credential-status-cell { grid-column: 2; grid-row: 1; }
  .credential-list-row > .credential-request-cell { grid-column: 3; grid-row: 1; }
  .credential-list-row > .credential-quota-cell { grid-column: 2 / span 5; grid-row: 2; }
  .credential-list-row > .credential-factor-cell { grid-column: 4; grid-row: 1; }
  .credential-list-row > .credential-standard-cell { grid-column: 5; grid-row: 1; }
  .credential-list-row > .credential-settled-cell { grid-column: 6; grid-row: 1; }
  .credential-list-row > .credential-excluded-cell { grid-column: 2 / span 2; grid-row: 3; }
  .credential-list-row > .credential-policy-cell { grid-column: 4; grid-row: 3; display: flex; align-items: center; gap: 7px; }
  .credential-list-row > .credential-updated-cell { grid-column: 5 / span 2; grid-row: 3; }
  .credential-list-row > .credential-actions { grid-column: 7; grid-row: 1 / span 3; align-self: center; }
  .credential-list-row > [data-label] { justify-self: stretch; text-align: left; }
  .credential-list-row > .credential-status-cell,
  .credential-list-row > .credential-policy-cell { justify-content: flex-start; text-align: left; }
  .credential-list-row > .credential-status-cell .credential-lock-summary { text-align: left; }
  .credential-list-row > .credential-request-cell { justify-items: start; text-align: left; }
  .credential-list-row > .credential-actions { justify-self: end; justify-content: flex-end; }
  .credential-policy-label { display: inline; }
}

@media (max-width: 900px) {
  .key-head { display: none; }
  .key-row { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding: 12px 2px; }
  .key-row > .table-cell:not(:first-child):not(:last-child) { grid-column: 1; }
  .key-row > [data-label] { justify-self: stretch !important; text-align: left !important; }
  .key-row .record-actions { grid-column: 2; grid-row: 1; align-self: start; }
  .key-row .record-actions { justify-self: end; justify-content: flex-end; }
  .credential-head { display: none; }
  .credential-list-panel .credential-list-row { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding: 12px 2px; }
  .credential-list-row .credential-status-cell,
  .credential-list-row .credential-request-cell,
  .credential-list-row .credential-quota-cell,
  .credential-list-row .credential-factor-cell,
  .credential-list-row .credential-standard-cell,
  .credential-list-row .credential-settled-cell,
  .credential-list-row .credential-excluded-cell,
  .credential-list-row .credential-policy-cell,
  .credential-list-row .credential-updated-cell { grid-column: 1; }
  .credential-list-row .credential-actions { grid-column: 2; grid-row: 1; align-self: start; }
  .credential-list-row .credential-status-cell,
  .credential-list-row .credential-policy-cell { justify-content: flex-start; text-align: left; }
  .credential-list-row .credential-request-cell { justify-items: start; text-align: left; }
  .credential-list-row .credential-actions { justify-self: end; justify-content: flex-end; }
  .credential-factor-cell { justify-self: start; text-align: left; }
  .credential-excluded-cell { text-align: left; }
  .credential-policy-cell { display: flex; align-items: center; gap: 7px; }
  .credential-policy-label { display: inline; }
  .credential-toolbar-primary,
  .credential-toolbar-actions { flex-wrap: wrap; }
  .excluded-model-options { grid-template-columns: 1fr; }
  .excluded-model-toolbar { grid-template-columns: 1fr auto; }
  .excluded-model-toolbar input { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid,
  .limit-grid { grid-template-columns: 1fr 1fr; }
  .credential-toolbar-primary { width: 100%; }
  .credential-toolbar-primary .operation-key-line { border-right: 0; padding-right: 0; }
  .list-toolbar { align-items: flex-start; }
  .settings-footer { bottom: -24px; }
}

/* C2C workspace information architecture */
.topbar-right { margin-left: auto; }
.dashboard { background: #f4f6f9; }
.workspace { background: #f4f6f9; }
.workspace-nav { gap: 5px; }
.workspace-tab { min-height: 40px; }
.workspace-tab .nav-icon { display: inline-grid; width: 22px; height: 22px; place-items: center; border-radius: 5px; color: #667085; background: #f2f4f7; font-size: 10px; font-weight: 800; }
.workspace-tab.active .nav-icon { color: #fff; background: var(--accent); }

.topbar:has(#account-nav:not([hidden])) { flex: 0 0 auto; height: auto; min-height: 62px; gap: 28px; padding-top: 8px; padding-bottom: 8px; }
.topbar .brand { flex-shrink: 0; }
.topbar-right { min-width: 0; }
.account-nav { min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 10px 24px; }
.header-account-data { display: grid; grid-template-columns: repeat(4,max-content); grid-template-rows: auto auto; align-items: baseline; gap: 2px 24px; }
.header-metric { min-width: 0; display: grid; grid-row: 1 / span 2; grid-template-rows: subgrid; align-items: baseline; }
.header-metric small { color: var(--muted); font-size: 12px; line-height: 18px; white-space: nowrap; }
.header-metric strong { color: var(--ink); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.header-metric.balance-metric strong, .header-metric.points-metric strong { font-weight: 750; }
.points-metric { border-left: 1px solid var(--line); padding-left: 24px; }
.header-identity { min-width: 0; display: flex; align-items: center; gap: 20px; border-left: 1px solid var(--line); padding-left: 24px; }
.header-session { min-width: 0; display: flex; align-items: center; gap: 16px; }
.header-session .nav-email { max-width: 200px; color: var(--ink); font-size: 14px; }
.header-session .button { flex-shrink: 0; font-size: 13px; }
.header-user-id { min-width: 0; display: grid; gap: 2px; }
.header-user-id small { color: var(--muted); font-size: 12px; line-height: 18px; }
.header-user-id-value { max-width: 100%; min-width: 0; display: flex; align-items: center; gap: 7px; }
.header-user-id code { width: 150px; max-width: 100%; min-width: 0; flex: 0 1 auto; overflow: hidden; padding: 0; color: var(--ink); background: transparent; font-size: 12px; line-height: 22px; text-overflow: ellipsis; white-space: nowrap; }
.header-copy-button { position: relative; width: 22px; height: 22px; min-height: 22px; flex: 0 0 22px; color: var(--muted); }
.header-copy-button:hover { color: var(--accent); }
.ai-status { flex: 0 0 auto; min-width: 0; margin: 12px 28px 0; border-radius: 5px; padding: 8px 11px; color: var(--muted); background: var(--surface-soft); font-size: 12px; }
.ai-status.error { color: var(--red); background: var(--red-soft); }

.ai-tabs { flex: 0 0 47px; display: flex; align-items: flex-end; gap: 26px; border-bottom: 1px solid var(--line); padding: 0 34px; background: #fff; }
.ai-tab { position: relative; height: 47px; padding: 0 2px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 750; }
.ai-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; content: ""; }
.ai-tab:hover { color: var(--ink); }
.ai-tab.active { color: var(--accent); }
.ai-tab.active::after { background: var(--accent); }

.content-viewport { padding: 22px 28px 26px; }
.workspace-section { gap: 12px; }
.account-page { width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.account-details { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr) minmax(0, .6fr); margin: 0; }
.account-details > div { min-width: 0; min-height: 78px; display: grid; align-content: center; gap: 7px; border-left: 1px solid var(--line); padding: 15px 24px; }
.account-details > div:first-child { border-left: 0; }
.account-details dt { color: var(--muted); font-size: 12px; }
.account-details dd { min-width: 0; margin: 0; color: var(--ink); font-size: 13px; }
.account-details .copyable-value { justify-content: flex-start; }
.account-details code { max-width: min(100%, 480px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-icon-button { width: 29px; height: 29px; min-height: 29px; flex: 0 0 29px; font-size: 15px; }

.list-panel { padding-top: 14px; }
.list-toolbar { min-height: 34px; margin-bottom: 5px; }
.list-toolbar > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.list-toolbar h3 { font-size: 13px; }
.heading-actions .button { white-space: nowrap; }
.empty-state { display: grid; min-height: 120px; place-items: center; margin: 0; }
.ledger-row { min-height: 58px; }
.ledger-amount { font-size: 13px; }
.eyebrow { letter-spacing: 0; }

@media (max-width: 900px) {
  .dashboard { display: flex; min-height: calc(100dvh - 58px); flex-direction: column; }
  .sidebar { flex: 0 0 auto; border-bottom: 1px solid var(--line); }
  .workspace-nav { justify-content: center; }
  .workspace-tab { min-width: 112px; justify-content: center; }
  .workspace { min-height: 0; }
  .ai-status { margin: 0 18px; }
  .ai-tabs { padding: 0 20px; }
  .content-viewport { min-height: 0; overflow: visible; padding: 18px; }
  .workspace-section { min-height: 0; }
  .account-page { width: 100%; }
}

@media (max-width: 1200px) {
  .header-identity { border-left: 0; padding-left: 0; }
}

@media (max-width: 900px) {
  .topbar:has(#account-nav:not([hidden])) { flex-wrap: wrap; gap: 10px; padding: 8px 16px; }
  .topbar:has(#account-nav:not([hidden])) .topbar-right { flex: 1 0 100%; margin-left: 0; }
  .account-nav { justify-content: flex-start; width: 100%; }
  .header-account-data { flex: 1 0 100%; grid-template-columns: repeat(4,max-content); justify-content: space-between; column-gap: 18px; }
  .header-identity { width: 100%; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 8px; }
}

@media (max-width: 560px) {
  .header-account-data { display: flex; flex-wrap: wrap; gap: 10px 16px; }
  .header-metric { flex: 1 0 auto; min-width: calc(50% - 8px); max-width: 100%; grid-template-rows: 18px auto; gap: 2px; }
  .balance-metric { order: 1; }
  .points-metric { order: 2; border-left: 0; padding-left: 0; }
  .balance-total { order: 3; }
  .balance-reserved { order: 4; }
  .header-metric strong { white-space: normal; overflow-wrap: anywhere; }
  .header-identity { flex-wrap: wrap; gap: 8px; }
  .header-user-id { flex: 1 0 100%; }
  .header-user-id code { width: 230px; }
  .header-session { width: 100%; justify-content: space-between; }
  .header-session .nav-email { max-width: none; }
}

@media (max-width: 560px) {
  .nav-email { max-width: 120px; }
  .workspace-tab { min-width: 96px; }
  .ai-status { flex-basis: 100%; margin: 8px 12px; }
  .ai-tabs { justify-content: space-around; gap: 0; padding: 0 12px; }
  .ai-tab { min-width: 76px; }
  .content-viewport { padding: 12px; }
  .account-details { padding: 2px 18px; }
  .account-details { grid-template-columns: 1fr; }
  .account-details > div { min-height: 0; grid-template-columns: 1fr; gap: 5px; border-top: 1px solid var(--line); border-left: 0; padding: 12px 0; }
  .account-details > div:first-child { border-top: 0; }
  .account-details dd { text-align: left; }
  .account-details code { max-width: calc(100vw - 112px); }
  .list-toolbar { align-items: center; }
  .billing-row,
  .ledger-row,
  .point-row { grid-template-columns: 1fr; }
  .billing-row > .table-cell,
  .billing-row > .billing-id-cell { grid-column: 1 !important; }
}

@media (max-width: 1100px) {
  .model-price-head { display: none; }
  .model-price-row { min-width: 0; grid-template-columns: minmax(190px, 1.2fr) repeat(2, minmax(100px, .7fr)); grid-template-rows: repeat(3, auto); gap: 8px 14px; padding: 11px 3px; }
  .model-price-row > .table-cell { justify-self: stretch; text-align: left; }
  .model-price-row > .table-cell::before { display: block; margin-bottom: 3px; color: var(--subtle); font-family: inherit; font-size: 10px; font-weight: 650; line-height: 1.2; content: attr(data-label); }
  .model-price-row > .model-price-identity { grid-column: 1; grid-row: 1 / span 3; align-self: center; }
  .model-price-row > .table-cell:nth-child(3) { grid-column: 2; grid-row: 1; }
  .model-price-row > .table-cell:nth-child(4) { grid-column: 3; grid-row: 1; }
  .model-price-row > .table-cell:nth-child(5) { grid-column: 2; grid-row: 2; }
  .model-price-row > .table-cell:nth-child(6) { grid-column: 3; grid-row: 2; }
  .model-price-row > .model-price-rule-cell { grid-column: 2 / span 2; grid-row: 3; }
}

@media (max-width: 700px) {
  .model-picker-toolbar { grid-template-columns: 1fr; }
  .model-scope-control { justify-self: start; }
  .model-price-toolbar { align-items: stretch; flex-wrap: wrap; }
  .model-price-toolbar-main { width: 100%; flex: 1 0 100%; align-items: stretch !important; flex-direction: column; gap: 6px !important; }
  .model-price-toolbar .heading-actions { margin-left: auto; }
  .model-price-search { width: 100%; }
  .model-price-row { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .model-price-row > .model-price-identity { grid-column: 1 / -1; grid-row: auto; }
  .model-price-row > .table-cell:nth-child(n+3):nth-child(-n+6) { grid-column: auto; grid-row: auto; }
  .model-price-row > .model-price-rule-cell { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 560px) {
  .ai-tab { min-width: 0; flex: 1 1 25%; padding-right: 1px; padding-left: 1px; font-size: 12px; }
  .model-picker-options { grid-template-columns: 1fr; }
  .model-picker-tools { gap: 8px; }
  .model-picker-tool { font-size: 9px; }
  .model-price-row > .table-cell { grid-column: auto !important; grid-row: auto !important; }
  .model-price-row > .model-price-identity,
  .model-price-row > .model-price-rule-cell { grid-column: 1 / -1 !important; }
}

/* Authentication */
.auth-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 424px);
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
  padding: 36px 18px;
  background: #f3f5f8;
}
.auth-card {
  width: 100%;
  overflow: hidden;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 24, 40, .09);
}
.auth-tabs { min-height: 50px; background: #fbfcfe; }
.auth-tab { min-height: 50px; padding: 14px 18px; font-size: 13px; }
.auth-tab::after { right: 28px; left: 28px; height: 2px; }
.auth-panel { padding: 34px 36px 30px; }
.auth-panel .panel-heading { margin-bottom: 26px; }
.auth-panel .panel-heading h2 { font-size: 22px; line-height: 1.25; }
.auth-panel .field { margin-bottom: 18px; font-size: 13px; }
.auth-panel .field input {
  height: 46px;
  margin-top: 7px;
  border-color: #cbd2dc;
  padding: 11px 13px;
  background: #fff;
  font-size: 14px;
}
.auth-panel .field input:hover:not(:focus) { border-color: #aeb8c6; }
.auth-panel .field-error,
.auth-panel .field-hint { min-height: 17px; margin-top: 6px; font-size: 11px; line-height: 1.45; }
.auth-panel .button-block { min-height: 44px; font-size: 14px; }
.auth-panel .button-block + .button-block { margin-top: 10px; }
.auth-panel .verification-step { margin: 20px 0 12px; padding-top: 19px; }
.auth-card > .inline-status { margin: -8px 36px 26px; padding: 10px 12px; font-size: 12px; line-height: 1.45; }

@media (max-width: 560px) {
  .auth-layout { align-items: start; padding: 20px 14px; }
  .auth-panel { padding: 27px 22px 24px; }
  .auth-card > .inline-status { margin-right: 22px; margin-left: 22px; }
}

/* Independent detection action and result, shared with the C2C layout. */
.credential-detection-row { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; gap: 10px 12px; margin-top: 9px; border: 1px solid var(--line); border-radius: 7px; padding: 11px 12px; background: var(--surface); }
.credential-detection-row > h3 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 750; line-height: 1.3; white-space: nowrap; }
.credential-detection-row > select { min-width: 0; width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 10px; color: var(--ink); background: #fff; font-size: 12px; outline: none; }
.credential-detection-row > select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 95, 206, .12); }
.credential-detection-row > .detection-feedback { grid-column: 1 / -1; grid-row: 2; }
.credential-detection-row > button { grid-column: 3; grid-row: 1; min-width: 60px; min-height: 34px; height: 34px; }
.detection-feedback { min-width: 0; display: flex; align-items: center; gap: 7px; color: #28563d; font-size: 14px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.detection-feedback:empty { display: none; }
.detection-feedback::before { content: "✓"; flex: 0 0 17px; align-self: flex-start; font-size: 17px; line-height: 1.3; text-align: center; }
.detection-feedback[data-kind="error"] { color: #973f35; }
.detection-feedback[data-kind="error"]::before { content: "!"; font-weight: 800; }
.detection-feedback[data-kind="info"] { color: #53635a; }
.detection-feedback[data-kind="info"]::before { content: ""; flex: 0 0 14px; width: 14px; height: 14px; margin-top: 4px; border: 2px solid #a7c9b4; border-right-color: transparent; border-radius: 50%; animation: detection-spin .7s linear infinite; }
@keyframes detection-spin { to { transform: rotate(360deg); } }
@media(max-width:600px) {
  .credential-detection-row { column-gap: 10px; }
  .credential-detection-row { grid-template-columns: minmax(0, 1fr) auto; }
  .credential-detection-row > select { grid-column: 1 / -1; grid-row: 2; }
  .credential-detection-row > button { grid-column: 2; grid-row: 1; }
  .credential-detection-row > .detection-feedback { grid-row: 3; }
}
@media (prefers-reduced-motion: reduce) { .detection-feedback[data-kind="info"]::before { animation: none; } }

.model-availability { display:inline-flex; align-items:center; padding:3px 8px; border-radius:6px; font-size:12px; font-weight:600; }
.model-availability.available { color:#207650; background:#eef9f1; }
.model-availability.unavailable { color:#ac4538; background:#fff0ed; }
.model-price-status { text-align:center; }
@media (max-width: 1100px) { .model-price-row > .model-price-status { grid-column:1; grid-row:4; text-align:left; } }
@media (max-width: 700px) { .model-price-row > .model-price-status { grid-column:1 / -1 !important; grid-row:auto !important; } }

.model-price-head > span:nth-child(2) {text-align:center;}

/* Password fields keep the reveal control inside the existing input frame. */
.password-input-wrap { position: relative; display: block; margin-top: 8px; }
.field > .password-input-wrap > input { margin-top: 0; padding-right: 46px; }
.auth-panel .field > .password-input-wrap { margin-top: 7px; }
.password-reset-dialog .field > .password-input-wrap { margin-top: 7px; }
.password-reset-dialog .field > .password-input-wrap > input { margin-top: 0; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 32px; height: 32px; min-height: 32px; place-items: center; border: 1px solid transparent; border-radius: 5px; padding: 0; color: var(--muted); background: transparent; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-soft); }
.password-toggle:focus-visible { outline: 3px solid rgba(49, 95, 206, .24); outline-offset: 1px; }
.password-toggle-glyph { display: block; width: 18px; height: 18px; line-height: 0; }
.password-toggle-glyph svg { display: block; width: 18px; height: 18px; }
