:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --bg-hover: #f0f0f2;
  --border: #e5e5e8;
  --border-strong: #d2d2d8;
  --text: #0f0f10;
  --text-2: #55555e;
  --text-3: #8a8a94;
  --primary: #0f0f10;
  --primary-hover: #2a2a2e;
  --accent: #10a37f;
  --accent-soft: #e6f6f1;
  --danger: #c8321f;
  --danger-soft: #fdeceb;
  --warn: #a35a00;
  --warn-soft: #fff4e0;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 15, 16, 0.05);
  --shadow-lg: 0 12px 40px rgba(15, 15, 16, 0.14), 0 2px 8px rgba(15, 15, 16, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg-subtle); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a82a19; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 40px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2355555e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input:hover, select:hover, textarea:hover { border-color: #b8b8c0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 163, 127, .18); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type=range] { width: 100%; accent-color: var(--primary); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field, .stack > * + * { margin-top: 16px; }
.field-label { font-weight: 500; font-size: 13px; }
.hint { color: var(--text-3); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: #d2d2d8; transition: background .15s; pointer-events: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .6; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--bg-hover); color: var(--text-2); }
.badge-success { background: var(--accent-soft); color: #0b7a5d; }
.badge-error { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tile { display: grid; place-items: center; border-radius: 9px; font-weight: 600; flex: none; letter-spacing: .01em; }

.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px;
  background: var(--bg-subtle); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand small { font-weight: 500; font-size: 11px; color: var(--text-3); letter-spacing: 0; margin-left: 2px; padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 99px; }
.nav-section { margin-bottom: 18px; }
.nav-label { padding: 0 10px 6px; font-size: 11.5px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 7px;
  color: var(--text-2); font-weight: 500; margin-bottom: 1px;
}
.nav a:hover { background: var(--bg-hover); color: var(--text); }
.nav a.active { background: #e9e9ed; color: var(--text); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.25; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; }
.page { max-width: 1120px; margin: 0 auto; padding: 36px 40px 80px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head p { color: var(--text-2); margin-top: 4px; max-width: 620px; }
.topbar { display: none; }

.card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; }
.section { margin-top: 28px; }
.section-title { margin-bottom: 12px; }

/* ---------- stats & chart ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 16px 20px; }
.stat .label { color: var(--text-2); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.chart { padding: 20px 20px 12px; }
.chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart .bar-ok { fill: #10a37f; }
.chart .bar-err { fill: #e5594a; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart text { font: 11px var(--font); fill: var(--text-3); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(15, 15, 16, .04); }
.chart-empty { height: 220px; display: grid; place-items: center; color: var(--text-3); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.seg { display: inline-flex; padding: 2px; background: var(--bg-hover); border-radius: 8px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--text-2); }
.seg button.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--text-3); padding: 10px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-subtle); }
.card > .table-wrap > table th:first-child, th:first-child { border-top-left-radius: var(--radius-lg); }
td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr:hover td { background: var(--bg-subtle); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-main b { font-weight: 500; }
.cell-sub { color: var(--text-3); font-size: 12.5px; }
.pill-code { font-family: var(--mono); font-size: 12px; background: var(--bg-hover); padding: 2px 7px; border-radius: 5px; }
.copy-inline { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 0; color: inherit; }
.copy-inline:hover { color: var(--accent); }

/* ---------- provider list ---------- */
.list-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta b { font-weight: 600; }
.list-item .meta .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- code ---------- */
.code { position: relative; }
.code pre { margin: 0; padding: 16px 44px 16px 18px; background: #0f0f10; color: #e8e8ec; border-radius: 0 0 10px 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.65; }
.code code { font-family: var(--mono); }
.code-copy { position: absolute; top: 8px; right: 8px; color: #a0a0aa; }
.code-copy:hover { background: rgba(255,255,255,.1); color: #fff; }
.tabs { display: flex; gap: 2px; padding: 6px 6px 0; background: #1c1c1f; border-radius: 10px 10px 0 0; }
.tab { border: 0; background: transparent; color: #9a9aa4; padding: 7px 12px; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 12.5px; font-weight: 500; }
.tab.active { background: #0f0f10; color: #fff; }
.inline-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-subtle); font-family: var(--mono); font-size: 13px; }
.inline-code span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- checklist ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); }
.step { padding: 18px 20px; border-right: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.step:last-child { border-right: 0; }
.step .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); flex: none; margin-top: 1px; }
.step.done .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.step h3 { margin-bottom: 2px; }
.step p { color: var(--text-2); font-size: 13px; }
.step a { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border-strong); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; }
.backdrop { position: absolute; inset: 0; background: rgba(15, 15, 16, .38); animation: fade .15s; }
.modal-wrap { position: relative; margin: auto; max-width: calc(100vw - 32px); animation: pop .16s ease-out; }
.modal { background: var(--bg); border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.modal-head, .drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 0; }
.modal-head p, .drawer-head p { margin-top: 2px; font-size: 13px; }
.modal-body { padding: 18px 22px 22px; overflow-y: auto; }
.modal-foot, .drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 14px 14px; }
.drawer-wrap { position: absolute; top: 0; right: 0; bottom: 0; width: 540px; max-width: 100vw; animation: slide .2s ease-out; }
.drawer { height: 100%; background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.drawer-foot { border-radius: 0; justify-content: space-between; padding: 14px 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--primary); color: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .18s ease-out; transition: opacity .3s; }
.toast.out { opacity: 0; }
.toast-error { background: var(--danger); }

.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--warn-soft); color: #6b3d00; font-size: 13px; }
.notice.error { background: var(--danger-soft); color: #8d2314; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-subtle); font-family: var(--mono); font-size: 13px; word-break: break-all; }

.empty { text-align: center; padding: 56px 24px; }
.empty h3 { font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

/* ---------- model editor ---------- */
.model-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.model-row:last-child { border-bottom: 0; }
.model-row .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.model-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.divider { height: 1px; background: var(--border); margin: 22px 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- playground ---------- */
.pg { display: grid; grid-template-columns: 1fr 300px; height: 100vh; }
.pg-chat { display: flex; flex-direction: column; min-width: 0; }
.pg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.pg-msgs { flex: 1; overflow-y: auto; padding: 28px 24px; }
.pg-inner { max-width: 760px; margin: 0 auto; }
.msg { display: flex; gap: 14px; margin-bottom: 24px; }
.msg .role { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; background: var(--bg-hover); color: var(--text-2); }
.msg.assistant .role { background: var(--primary); color: #fff; }
.msg .body { white-space: pre-wrap; word-break: break-word; padding-top: 3px; min-width: 0; }
.msg.error .body { color: var(--danger); }
.cursor { display: inline-block; width: 7px; height: 15px; background: var(--text); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pg-compose { padding: 0 24px 24px; }
.composer { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 10px 16px; border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-sm); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 163, 127, .18); }
.composer textarea { border: 0; padding: 6px 0; resize: none; max-height: 160px; box-shadow: none !important; }
.composer textarea:focus { box-shadow: none; }
.send { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.send:disabled { opacity: .35; cursor: not-allowed; }
.pg-side { border-left: 1px solid var(--border); background: var(--bg-subtle); padding: 20px; overflow-y: auto; }
.pg-side h3 { margin-bottom: 14px; }
.pg-meta { text-align: center; color: var(--text-3); font-size: 12px; margin-top: -8px; margin-bottom: 8px; }
.pg-empty { text-align: center; margin-top: 12vh; }
.pg-empty h2 { font-size: 20px; margin-bottom: 6px; }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: minmax(380px, 1fr) 1fr; min-height: 100vh; }
.auth-form { display: flex; flex-direction: column; padding: 32px 48px; }
.auth-form .brand { padding: 0; }
.auth-card { margin: auto; width: 100%; max-width: 360px; padding: 40px 0; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .sub { color: var(--text-2); margin-bottom: 28px; }
.auth-card .alt { margin-top: 20px; text-align: center; color: var(--text-2); }
.auth-card .alt a { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.form-error { padding: 10px 12px; border-radius: var(--radius); background: var(--danger-soft); color: #8d2314; font-size: 13px; margin-bottom: 16px; }
.auth-aside { background: var(--bg-subtle); border-left: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 48px; }
.aside-inner { max-width: 520px; width: 100%; }
.aside-inner h2 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 10px; }
.aside-inner > p { color: var(--text-2); margin-bottom: 28px; font-size: 15px; }
.flow { display: flex; align-items: stretch; gap: 0; margin-bottom: 20px; }
.flow .col { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.flow .node { border: 1px solid var(--border-strong); background: var(--bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.flow .node .tile { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; }
.flow .mid { flex: 0 0 120px; display: grid; place-items: center; position: relative; }
.flow .mid::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--border-strong); }
.flow .hub { position: relative; background: var(--primary); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; }

/* ---------- docs ---------- */
.prose { max-width: 760px; }
.prose h2 { margin: 36px 0 10px; font-size: 18px; }
.prose p { color: var(--text-2); margin-bottom: 12px; }
.prose .code { margin: 12px 0 16px; }
.prose .code pre { border-radius: 10px; }
.prose .tabs + div .code pre, .prose .tabs + div pre { border-radius: 0 0 10px 10px; }
.prose table { margin: 12px 0 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.prose td, .prose th { padding: 9px 14px; font-size: 13.5px; }
.prose ul { color: var(--text-2); padding-left: 20px; margin: 0 0 12px; }

.loading { padding: 80px; text-align: center; color: var(--text-3); }
.menu-btn { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--border); }
  .step:last-child { border-bottom: 0; }
  .pg { grid-template-columns: 1fr; }
  .pg-side { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 20; }
  .menu-btn { display: inline-grid; }
  .page { padding: 24px 16px 64px; }
  .page-head { flex-direction: column; }
  .pg { height: calc(100vh - 53px); }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-form { padding: 24px 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  th, td { padding-left: 14px; padding-right: 14px; }
  .list-item { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- billing, usage & admin ---------- */
.chart-tip { position: absolute; display: none; pointer-events: none; background: var(--primary); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 6px)); z-index: 5; }
.credit-banner { display: flex; align-items: center; gap: 24px; padding: 16px 20px; margin-bottom: 24px; }
.credit-banner .label { color: var(--text-2); font-size: 13px; }
.credit-banner .value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.credit-banner > :nth-child(2) { flex: 1; }
.balance-value { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.balance-value.neg { color: var(--danger); }
.link { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.pm { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-subtle); }
.pm-brand { text-transform: capitalize; font-weight: 600; }
.preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset { height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-weight: 600; font-size: 15px; cursor: pointer; }
.preset:hover { background: var(--bg-subtle); }
.preset.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.meter { height: 6px; border-radius: 99px; background: var(--bg-hover); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; }
.costcell { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.costcell .bar { width: 72px; height: 6px; border-radius: 99px; background: var(--bg-hover); overflow: hidden; }
.costcell .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.steps.four { grid-template-columns: repeat(4, 1fr); }
.price-input { width: 96px; height: 30px; text-align: right; padding: 0 8px; font-variant-numeric: tabular-nums; }
.advanced { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.advanced summary { cursor: pointer; font-weight: 500; font-size: 13px; }
.notice.info { background: #eef4ff; color: #274a8f; }
td .switch { vertical-align: middle; }
@media (max-width: 960px) { .steps.four { grid-template-columns: 1fr; } .credit-banner { flex-wrap: wrap; } }
