:root {
  --ink: #111827;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e6e9ef;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --primary: #315efb;
  --primary-hover: #234bdc;
  --navy: #0a1224;
  --success: #079455;
  --danger: #d92d20;
  --warning: #b54708;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(16, 24, 40, .08);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--canvas); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); background: white; }
.login-story { position: relative; overflow: hidden; padding: 42px 56px; color: white; background: radial-gradient(circle at 18% 20%, rgba(74, 112, 255, .4), transparent 28%), radial-gradient(circle at 82% 75%, rgba(60, 207, 198, .12), transparent 24%), linear-gradient(145deg, #111d3b, #07101f 70%); display: flex; flex-direction: column; }
.login-story::before, .login-story::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; pointer-events: none; }
.login-story::before { width: 520px; height: 520px; right: -220px; top: -155px; animation: orbit 18s ease-in-out infinite alternate; }
.login-story::after { width: 760px; height: 760px; right: -370px; top: -280px; animation: orbit 24s ease-in-out -7s infinite alternate-reverse; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 720; letter-spacing: -.02em; }
.brand-light { color: white; position: relative; z-index: 1; align-self: flex-start; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; color: white; background: var(--primary); font-weight: 850; box-shadow: 0 6px 18px rgba(49,94,251,.35); transition: transform .35s var(--ease-spring), box-shadow .35s; }
.brand:hover .brand-mark { transform: rotate(-5deg) scale(1.07); box-shadow: 0 9px 24px rgba(49,94,251,.42); }
.story-copy { margin: auto 0; max-width: 590px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 14px; color: #8fa8ff; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.eyebrow.ink { color: var(--primary); }
.story-copy h1 { font-size: clamp(46px, 6vw, 74px); line-height: 1.12; margin: 0; letter-spacing: -.055em; font-weight: 760; }
.story-copy > p:last-child { max-width: 470px; color: #a9b5ca; font-size: 17px; line-height: 1.8; margin: 28px 0 0; }
.story-foot { display: flex; align-items: center; gap: 10px; color: #8390a6; font-size: 12px; position: relative; z-index: 1; }
.story-separator { width: 1px; height: 12px; background: rgba(255,255,255,.18); margin: 0 4px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px rgba(18,183,106,.12); animation: live-pulse 2.4s ease-out infinite; }
.login-panel { display: grid; place-items: center; padding: 48px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 23px; }
.login-card h2 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.login-card .muted { margin: 9px 0 0; }
.mobile-brand { display: none; align-items: center; gap: 10px; font-weight: 750; }
.login-layout .brand-light, .login-layout .story-copy > *, .login-layout .story-foot, .login-layout .login-card > * { opacity: 0; transform: translateY(18px); }
.login-layout.is-ready .brand-light, .login-layout.is-ready .story-copy > *, .login-layout.is-ready .story-foot, .login-layout.is-ready .login-card > * { animation: fade-up .7s var(--ease-out) forwards; }
.login-layout.is-ready .brand-light { animation-delay: .04s; }
.login-layout.is-ready .story-copy .eyebrow { animation-delay: .14s; }
.login-layout.is-ready .story-copy h1 { animation-delay: .22s; }
.login-layout.is-ready .story-copy > p:last-child { animation-delay: .32s; }
.login-layout.is-ready .story-foot { animation-delay: .42s; }
.login-layout.is-ready .login-card > *:nth-child(1) { animation-delay: .06s; }
.login-layout.is-ready .login-card > *:nth-child(2) { animation-delay: .12s; }
.login-layout.is-ready .login-card > *:nth-child(3) { animation-delay: .18s; }
.login-layout.is-ready .login-card > *:nth-child(4) { animation-delay: .24s; }
.login-layout.is-ready .login-card > *:nth-child(n+5) { animation-delay: .3s; }
label { display: flex; flex-direction: column; gap: 8px; }
label > span, fieldset legend { color: #344054; font-size: 13px; font-weight: 650; }
label b { color: var(--danger); }
input, select { min-height: 43px; padding: 0 13px; color: var(--ink); background: #fff; border: 1px solid #d5dae3; border-radius: 9px; outline: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: #a4abb8; }
input:focus, select:focus { border-color: #809cff; box-shadow: 0 0 0 3px rgba(49,94,251,.1); }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 62px; }
.input-action { position: absolute; right: 5px; top: 5px; height: 33px; padding: 0 9px; color: var(--primary); background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 650; }
.input-action:hover { background: #eef2ff; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 650; font-size: 13px; transition: background .2s, border-color .2s, box-shadow .2s, transform .2s var(--ease-out), opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .52; cursor: not-allowed; }
.button-primary { position: relative; overflow: hidden; color: #fff; background: var(--primary); box-shadow: 0 3px 10px rgba(49,94,251,.2); }
.button-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.2) 50%, transparent 65%); transform: translateX(-130%); transition: transform .55s var(--ease-out); pointer-events: none; }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 7px 18px rgba(49,94,251,.25); }
.button-primary:hover:not(:disabled)::after { transform: translateX(130%); }
.button-secondary { color: #344054; background: #fff; border-color: #d5dae3; }
.button-secondary:hover:not(:disabled), .button-quiet:hover:not(:disabled) { background: #f3f5f9; }
.button-quiet { color: #475467; background: transparent; }
.button-large { min-height: 47px; font-size: 14px; }
.form-error { min-height: 18px; margin: -11px 0 -8px; color: var(--danger); font-size: 12px; }
.security-note { display: flex; justify-content: center; gap: 7px; color: var(--subtle); font-size: 11px; margin: -7px 0 0; }
.security-note span { color: var(--success); }
.muted { color: var(--muted); }

.app-shell { min-height: 100vh; }
.app-shell .topbar, .app-shell .hero-row, .app-shell .metric-card, .app-shell .data-panel { opacity: 0; transform: translateY(18px); }
.app-shell.is-ready .topbar, .app-shell.is-ready .hero-row, .app-shell.is-ready .metric-card, .app-shell.is-ready .data-panel { animation: fade-up .62s var(--ease-out) forwards; }
.app-shell.is-ready .topbar { animation-delay: .02s; }
.app-shell.is-ready .hero-row { animation-delay: .08s; }
.app-shell.is-ready .metric-card:nth-child(1) { animation-delay: .14s; }
.app-shell.is-ready .metric-card:nth-child(2) { animation-delay: .19s; }
.app-shell.is-ready .metric-card:nth-child(3) { animation-delay: .24s; }
.app-shell.is-ready .metric-card:nth-child(4) { animation-delay: .29s; }
.app-shell.is-ready .data-panel { animation-delay: .34s; }
.topbar { height: 66px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.topbar-inner { width: min(1440px, calc(100% - 56px)); height: 100%; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.product-label { color: var(--muted); font-size: 12px; font-weight: 600; padding-left: 10px; border-left: 1px solid var(--line); margin-left: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.endpoint-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: #475467; background: white; font-size: 12px; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease-out); }
.endpoint-pill:hover { border-color: #bcc9fa; box-shadow: 0 6px 16px rgba(49,94,251,.09); transform: translateY(-1px); }
.workspace { width: min(1440px, calc(100% - 56px)); margin: 0 auto; padding: 42px 0 64px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero-row h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.hero-row .muted { margin: 9px 0 0; font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px 0 24px; }
.metric-card { min-height: 124px; padding: 21px; display: flex; align-items: center; gap: 16px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,24,40,.02); transition: border-color .25s, box-shadow .25s, transform .25s var(--ease-out); }
.metric-card:hover { border-color: #d3daf0; box-shadow: 0 12px 28px rgba(16,24,40,.08); transform: translateY(-3px); }
.metric-card.metric-accent { border-color: #ccd7ff; box-shadow: 0 8px 22px rgba(49,94,251,.08); }
.metric-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; color: #315efb; background: #eef2ff; border-radius: 11px; font-weight: 800; transition: transform .35s var(--ease-spring); }
.metric-card:hover .metric-icon { transform: scale(1.08) rotate(-3deg); }
.metric-icon.violet { color: #7f56d9; background: #f4f0ff; }
.metric-icon.amber { color: #dc6803; background: #fff6e9; }
.metric-icon.green { color: #079455; background: #eafaf3; }
.metric-card p { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; font-size: 26px; letter-spacing: -.04em; line-height: 1.1; }
.metric-card strong.value-pop { animation: value-pop .45s var(--ease-spring); }
.metric-card span { display: block; margin-top: 6px; color: var(--subtle); font-size: 10px; }

.data-panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(16,24,40,.025); overflow: hidden; }
.panel-head { min-height: 67px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.tabs { display: flex; align-self: stretch; gap: 25px; }
.tab { position: relative; display: inline-flex; align-items: center; padding: 0 2px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 14px; font-weight: 650; text-decoration: none; transition: color .2s; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); }
.tab::after { content: ""; position: absolute; height: 2px; left: 0; right: 0; bottom: -1px; background: var(--primary); border-radius: 2px 2px 0 0; transform: scaleX(0); transition: transform .3s var(--ease-out); }
.tab.is-active::after { transform: scaleX(1); }
.tab-section.section-enter { animation: section-enter .38s var(--ease-out); }
.toolbar { min-height: 69px; padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #eef0f3; }
.filter-row { display: flex; align-items: center; gap: 9px; }
.search-field { position: relative; display: block; }
.search-field span { position: absolute; left: 12px; top: 9px; color: #8992a3; font-size: 18px; line-height: 1; }
.search-field input { width: 270px; padding-left: 35px; }
.filter-row input, .filter-row select { min-height: 38px; }
.filter-row select { min-width: 112px; }
.record-count { margin: 0; color: var(--subtle); font-size: 12px; }
.account-test-actions { display: flex; align-items: center; gap: 10px; }
.default-model-note { color: var(--muted); font-size: 10px; white-space: nowrap; }
.default-model-note code { padding: 4px 7px; color: #3538cd; background: #eef2ff; border-radius: 6px; font-size: 10px; }
.payment-section { min-height: 440px; }
.payment-admin-hero { min-height: 126px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: radial-gradient(circle at 85% 15%, rgba(49,94,251,.1), transparent 28%), linear-gradient(135deg, #f8faff, #fff); border-bottom: 1px solid var(--line); }
.payment-admin-hero h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.payment-admin-hero p:last-child { max-width: 680px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.payment-list-head { min-height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #eef0f3; }
.payment-list-head > div { display: flex; align-items: baseline; gap: 9px; }
.payment-list-head strong { font-size: 13px; }
.payment-list-head span { color: var(--subtle); font-size: 10px; }
.payment-security-note { padding-left: 17px; position: relative; }
.payment-security-note::before { content: "◆"; position: absolute; left: 0; color: var(--success); }
.payment-link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 18px 24px 24px; }
.payment-link-card { min-width: 0; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 5px rgba(16,24,40,.025); animation: row-in .42s var(--ease-out) both; transition: border-color .22s, box-shadow .22s, transform .22s var(--ease-out); }
.payment-link-card:nth-child(2) { animation-delay: .04s; }
.payment-link-card:nth-child(3) { animation-delay: .08s; }
.payment-link-card:nth-child(n+4) { animation-delay: .12s; }
.payment-link-card:hover { border-color: #cbd5f3; box-shadow: 0 10px 24px rgba(16,24,40,.07); transform: translateY(-2px); }
.payment-link-card[data-enabled="false"] { background: #fafafa; opacity: .76; }
.payment-link-top, .payment-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.payment-order { color: #b0b7c3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.payment-amount { margin: 18px 0; }
.payment-amount strong { display: block; color: var(--ink); font-size: 25px; letter-spacing: -.045em; }
.payment-amount span { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.payment-destination { padding: 10px; background: #f7f8fa; border-radius: 8px; }
.payment-destination span, .payment-destination code { display: block; }
.payment-destination span { margin-bottom: 4px; color: var(--subtle); font-size: 9px; }
.payment-destination code { overflow: hidden; color: #475467; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.payment-card-foot { margin-top: 13px; color: var(--subtle); font-size: 9px; }
.danger-text { color: var(--danger); }
.danger-text:hover { background: #fef3f2; }
.payment-empty { min-height: 260px; }
.payment-card-skeleton { min-height: 210px; pointer-events: none; }
.payment-card-skeleton span { display: block; height: 12px; margin-bottom: 20px; background: linear-gradient(90deg,#f0f2f5,#f8f9fb,#f0f2f5); background-size: 200% 100%; border-radius: 6px; animation: shimmer 1.2s infinite; }
.payment-card-skeleton span:nth-child(2) { width: 62%; height: 28px; }
.payment-card-skeleton span:nth-child(3) { width: 84%; }
.table-wrap { overflow-x: auto; min-height: 350px; position: relative; }
table { width: 100%; min-width: 1050px; border-collapse: collapse; font-size: 12px; }
th { height: 42px; padding: 0 16px; color: #667085; background: #fafbfc; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
td { min-height: 66px; padding: 14px 16px; color: #344054; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr { animation: row-in .42s var(--ease-out) both; }
tbody tr:nth-child(2) { animation-delay: .025s; }
tbody tr:nth-child(3) { animation-delay: .05s; }
tbody tr:nth-child(4) { animation-delay: .075s; }
tbody tr:nth-child(5) { animation-delay: .1s; }
tbody tr:nth-child(6) { animation-delay: .125s; }
tbody tr:nth-child(7) { animation-delay: .15s; }
tbody tr:nth-child(8) { animation-delay: .175s; }
tbody tr:nth-child(9) { animation-delay: .2s; }
tbody tr:nth-child(n+10) { animation-delay: .225s; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
.align-right { text-align: right; }
.identity { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: #315efb; background: #eef2ff; font-weight: 750; text-transform: uppercase; transition: transform .3s var(--ease-spring), background .2s; }
tbody tr:hover .avatar { transform: scale(1.06) rotate(-2deg); background: #e3e9ff; }
.identity strong, .account-name { display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 670; }
.identity small, .cell-subtext { display: block; color: var(--subtle); font-size: 10px; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; color: #475467; background: #f2f4f7; font-size: 10px; font-weight: 680; white-space: nowrap; animation: badge-in .35s var(--ease-spring) both; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #98a2b3; }
.badge.success { color: #067647; background: #ecfdf3; }
.badge.success::before { background: #12b76a; }
.badge.danger { color: #b42318; background: #fef3f2; }
.badge.danger::before { background: #f04438; }
.badge.warning { color: #b54708; background: #fffaeb; }
.badge.warning::before { background: #f79009; }
.badge.info { color: #3538cd; background: #eef4ff; }
.badge.info::before { background: #6172f3; }
.group-pills { display: flex; flex-wrap: wrap; gap: 5px; max-width: 270px; }
.group-pill { display: inline-block; max-width: 130px; padding: 3px 7px; overflow: hidden; color: #475467; background: #f2f4f7; border-radius: 5px; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; transition: color .2s, background .2s, transform .2s var(--ease-out); }
.group-pill:hover { color: #3538cd; background: #eef2ff; transform: translateY(-1px); }
.no-groups { color: var(--subtle); font-size: 10px; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.text-button { padding: 5px 7px; color: var(--primary); background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 650; white-space: nowrap; transition: background .18s, transform .18s var(--ease-out); }
.text-button:hover { background: #eef2ff; }
.text-button:active { transform: scale(.96); }
.test-state { display: inline-flex; align-items: center; gap: 6px; max-width: 210px; }
.test-state span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spinner { display: inline-block; width: 12px; height: 12px; flex: 0 0 auto; border: 2px solid #d5dcff; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { min-height: 56px; padding: 0 14px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); font-size: 11px; padding: 0 8px; }
.empty-state { min-height: 330px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state div { width: 44px; height: 44px; display: grid; place-items: center; color: #7f8aa0; background: #f2f4f7; border-radius: 50%; font-size: 11px; }
.empty-state h3 { margin: 14px 0 4px; font-size: 14px; }
.empty-state p { margin: 0; color: var(--subtle); font-size: 11px; }
.skeleton-row td::after { content: ""; display: block; width: 78%; height: 10px; border-radius: 6px; background: linear-gradient(90deg,#f0f2f5,#f8f9fb,#f0f2f5); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

dialog { border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(10,18,36,.55); backdrop-filter: blur(3px); animation: backdrop-in .25s ease-out; }
.modal { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 28px); border-radius: 16px; box-shadow: 0 24px 80px rgba(10,18,36,.25); }
.modal-wide { width: min(760px, calc(100vw - 28px)); }
.modal-card { background: white; border-radius: 16px; overflow: hidden; }
dialog[open] .modal-card { animation: modal-in .42s var(--ease-out); transform-origin: 50% 100%; }
.modal-head { padding: 23px 24px 19px; display: flex; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.modal-head p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-size: 23px; line-height: 1; transition: background .2s, transform .25s var(--ease-spring); }
.icon-button:hover { background: #f2f4f7; }
.icon-button:hover { transform: rotate(5deg) scale(1.06); }
.modal-body { max-height: calc(100vh - 230px); padding: 22px 24px; overflow-y: auto; }
.modal-foot { min-height: 65px; padding: 12px 24px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; background: #fafbfc; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.span-2 { grid-column: 1 / -1; }
.group-fieldset { margin: 1px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.group-fieldset legend { padding: 0 5px; }
.group-fieldset > p { margin: 10px 0 0; color: var(--subtle); font-size: 10px; }
.field-help { color: var(--subtle); font-size: 10px; line-height: 1.45; }
.switch-field { min-height: 68px; padding: 11px 12px; display: grid; grid-template-columns: 36px 1fr; align-items: center; align-self: end; gap: 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.switch-field > input { width: 36px; min-height: 20px; margin: 0; appearance: none; position: relative; background: #d0d5dd; border: 0; border-radius: 999px; cursor: pointer; transition: background .2s; }
.switch-field > input::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(16,24,40,.25); transition: transform .25s var(--ease-spring); }
.switch-field > input:checked { background: var(--primary); }
.switch-field > input:checked::after { transform: translateX(16px); }
.switch-field strong, .switch-field small { display: block; }
.switch-field strong { color: #344054; font-size: 11px; }
.switch-field small { margin-top: 3px; color: var(--subtle); font-size: 9px; }
.group-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.group-options-large { max-height: 360px; overflow-y: auto; }
.group-option { min-width: 0; min-height: 48px; padding: 8px 10px; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease-out), box-shadow .2s; }
.group-option:hover { border-color: #c7d0ea; transform: translateY(-1px); }
.group-option:has(input:checked) { border-color: #9eb0ff; background: #f7f8ff; }
.group-option:has(input:checked) { box-shadow: 0 4px 12px rgba(49,94,251,.08); }
.group-option input { width: 15px; min-height: 15px; margin: 0; padding: 0; accent-color: var(--primary); }
.group-option strong { display: block; overflow: hidden; color: #344054; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.group-option small { display: block; margin-top: 2px; color: var(--subtle); font-size: 9px; }
.warning-note { margin-top: 14px; padding: 12px; color: #7a2e0e; background: #fff8eb; border: 1px solid #fedf89; border-radius: 9px; }
.warning-note strong { font-size: 11px; }
.warning-note p { margin: 4px 0 0; font-size: 10px; line-height: 1.5; }
.success-card { position: relative; padding: 36px; text-align: center; }
.success-close { position: absolute; right: 14px; top: 14px; }
.success-icon { width: 58px; height: 58px; margin: 0 auto 18px; display: grid; place-items: center; color: white; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 8px #eafaf3; font-size: 25px; animation: success-pop .55s .12s var(--ease-spring) both; }
.success-card h2 { margin: 0; font-size: 25px; }
.success-card > p:not(.eyebrow) { max-width: 410px; margin: 9px auto 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.credential-box { margin: 0 0 18px; padding: 5px 15px; text-align: left; background: #f7f8fa; border: 1px solid var(--line); border-radius: 10px; }
.credential-box div { display: grid; grid-template-columns: 55px 1fr; gap: 12px; padding: 11px 0; align-items: center; }
.credential-box div + div { border-top: 1px solid var(--line); }
.credential-box span { color: var(--muted); font-size: 10px; }
.credential-box code { overflow-wrap: anywhere; color: var(--ink); font-size: 12px; }
.test-run-body { display: grid; gap: 18px; }
.test-target-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #d9e0fb; border-radius: 11px; background: linear-gradient(135deg, #f7f9ff, #fff); }
.test-target-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: var(--primary); border-radius: 10px; box-shadow: 0 7px 16px rgba(49,94,251,.2); animation: target-pulse 2.6s ease-in-out infinite; }
.test-target-card strong, .test-target-card small { display: block; }
.test-target-card strong { color: var(--ink); font-size: 13px; }
.test-target-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.model-select-field { gap: 9px; }
.select-shell { position: relative; }
.select-shell > span { position: absolute; left: 13px; top: 50%; color: var(--primary); transform: translateY(-50%); pointer-events: none; z-index: 1; }
.select-shell select { width: 100%; min-height: 48px; padding-left: 38px; padding-right: 38px; font-weight: 650; }
.model-status { min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--muted); background: #f7f8fa; border-radius: 8px; font-size: 10px; animation: status-in .3s var(--ease-out); }
.model-status.is-success { color: #067647; background: #ecfdf3; }
.model-status.is-warning { color: #9a4b08; background: #fffaeb; }
.mini-spinner { width: 13px; height: 13px; flex: 0 0 auto; border: 2px solid #d5dcff; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.status-check, .status-warn { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; color: white; border-radius: 50%; font-size: 10px; font-weight: 800; }
.status-check { background: var(--success); }
.status-warn { background: #f79009; }
.model-hint { margin: -2px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.65; }
.model-hint code { color: #3538cd; font-weight: 700; }
.test-result-detail { padding: 17px; border: 1px solid var(--line); border-radius: 11px; }
dialog[open] .test-result-detail { animation: result-in .42s .08s var(--ease-out) both; }
.test-result-detail h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; }
.test-result-detail p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.test-meta { display: flex; gap: 14px; margin-top: 14px; color: var(--subtle); font-size: 10px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 390px; padding: 12px 14px; color: #fff; background: #1d2939; border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .4s var(--ease-spring); }
.toast.toast-out { animation: toast-out .32s var(--ease-out) forwards; }
.toast.error { background: #7a271a; }
.toast.success { background: #05603a; }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbit { from { transform: translate3d(-10px, -8px, 0) scale(.96); } to { transform: translate3d(24px, 18px, 0) scale(1.05); } }
@keyframes live-pulse { 0%, 45% { box-shadow: 0 0 0 4px rgba(18,183,106,.12); } 75%, 100% { box-shadow: 0 0 0 9px rgba(18,183,106,0); } }
@keyframes value-pop { from { opacity: .45; transform: translateY(5px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes section-enter { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes row-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes badge-in { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
@keyframes backdrop-in { from { background: rgba(10,18,36,0); backdrop-filter: blur(0); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes success-pop { from { opacity: 0; transform: scale(.55) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes target-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 7px 16px rgba(49,94,251,.2); } 50% { transform: scale(1.04); box-shadow: 0 9px 22px rgba(49,94,251,.28); } }
@keyframes status-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes result-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px) scale(.96); } }

@media (max-width: 1040px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .login-story { padding: 38px; }
  .story-copy h1 { font-size: 52px; }
  .account-toolbar { align-items: flex-end; flex-wrap: wrap; }
  .filter-row { flex-wrap: wrap; }
  .account-test-actions { margin-left: auto; }
  .payment-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  input, select { min-height: 44px; font-size: 16px; }
  .button { min-height: 42px; }
  .login-layout { display: block; background: white; }
  .login-story { display: none; }
  .login-panel { min-height: 100dvh; padding: max(26px, env(safe-area-inset-top)) 24px max(26px, env(safe-area-inset-bottom)); }
  .mobile-brand { display: flex; margin-bottom: 22px; }
  .topbar { height: 62px; }
  .topbar-inner, .workspace { width: min(100% - 24px, 1440px); }
  .topbar-actions { gap: 3px; }
  .product-label, .endpoint-pill span:nth-child(2), .endpoint-pill span:last-child { display: none; }
  .endpoint-pill { padding: 10px; }
  .workspace { padding-top: 26px; padding-bottom: 38px; }
  .hero-row { align-items: flex-start; gap: 14px; }
  .hero-row h1 { font-size: 25px; }
  .hero-row .muted { max-width: 250px; font-size: 12px; line-height: 1.55; }
  #refresh-all { padding: 0 11px; white-space: nowrap; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
  .metric-card { min-height: 105px; padding: 14px; gap: 11px; }
  .metric-icon { width: 36px; height: 36px; }
  .metric-card strong { font-size: 22px; }
  .metric-card span { display: none; }
  .data-panel { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .panel-head, .toolbar { align-items: stretch; background: white; }
  .panel-head { padding: 0 12px; border: 1px solid var(--line); border-radius: 13px 13px 0 0; }
  .tabs { gap: 13px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  #create-user-button { align-self: center; font-size: 11px; padding: 0 9px; }
  .toolbar { min-height: auto; padding: 12px; flex-direction: column; border: 1px solid var(--line); border-top: 0; }
  .account-toolbar { align-items: stretch; }
  .filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .search-field input { width: 100%; }
  .filter-row select, .filter-row .button { width: 100%; min-width: 0; }
  #account-filter-form .button { grid-column: 1 / -1; }
  .record-count { display: none; }
  .account-test-actions { width: 100%; margin: 0; justify-content: space-between; }
  .default-model-note { display: flex; align-items: center; gap: 5px; }
  .table-wrap { min-height: 260px; overflow: visible; padding: 10px; background: #f5f7fb; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  table { min-width: 0; display: block; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 9px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 10px rgba(16,24,40,.035); }
  tbody tr:hover { background: white; }
  td { display: block; min-width: 0; min-height: 0; padding: 8px 9px; border: 0; }
  td::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--subtle); font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
  td.mobile-span-2 { grid-column: 1 / -1; }
  td.mobile-span-2:first-child { margin-bottom: 2px; padding-bottom: 11px; border-bottom: 1px solid #eef0f3; }
  td.mobile-span-2:last-child { margin-top: 2px; padding-top: 10px; border-top: 1px solid #eef0f3; }
  .identity { min-width: 0; }
  .identity > div { min-width: 0; }
  .identity strong, .account-name { max-width: calc(100vw - 108px); }
  .group-pills { max-width: 100%; }
  .test-state { max-width: 100%; }
  .row-actions { justify-content: flex-start; }
  .row-actions .text-button { min-height: 34px; padding: 6px 10px; background: #eef2ff; }
  .skeleton-row { min-height: 118px; display: block; }
  .skeleton-row td { display: none; }
  .skeleton-row td:first-child { display: block; margin: 8px; }
  .pagination { min-height: 58px; justify-content: center; background: white; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 13px 13px; }
  .payment-section { background: white; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 13px 13px; overflow: hidden; }
  .payment-admin-hero { padding: 20px 16px; align-items: stretch; flex-direction: column; gap: 16px; }
  .payment-admin-hero .button { align-self: flex-start; }
  .payment-list-head { min-height: 66px; padding: 12px 16px; align-items: flex-start; flex-direction: column; gap: 5px; }
  .payment-security-note { line-height: 1.5; }
  .payment-link-grid { grid-template-columns: 1fr; gap: 10px; padding: 12px; background: #f5f7fb; }
  .payment-link-card { padding: 15px; }
  .payment-empty { min-height: 300px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .group-options { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: auto auto 8px; border-radius: 18px; }
  .modal-card { max-height: calc(100dvh - 16px); border-radius: 18px; }
  form.modal-card { display: flex; flex-direction: column; }
  .modal-head { padding: 19px 18px 16px; }
  .modal-head h2 { font-size: 19px; }
  .modal-body { max-height: none; padding: 18px; }
  form.modal-card .modal-body { flex: 1 1 auto; min-height: 0; }
  .modal-foot { min-height: 66px; padding: 11px 18px max(11px, env(safe-area-inset-bottom)); }
  .modal-foot .button { flex: 1; }
  .success-card { padding: 32px 20px max(28px, env(safe-area-inset-bottom)); }
  .toast-region { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .toast { width: 100%; min-width: 0; max-width: none; }
}

@media (max-width: 430px) {
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .hero-row .eyebrow { margin-bottom: 10px; }
  .hero-row h1 { font-size: 23px; }
  .hero-row .muted { max-width: 215px; }
  .metric-card { min-height: 98px; padding: 12px; }
  .metric-card p { font-size: 11px; }
  .metric-card strong { font-size: 21px; }
  .tabs { gap: 11px; }
  .tab { font-size: 12px; }
  #create-user-button { max-width: 126px; line-height: 1.25; }
}

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