:root {
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #24332b;
  background: #f6f7f3;
  font-synthesis: none;
  --green: #285b45;
  --muted: #7b837d;
  --border: #e5e8e1;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
[hidden] { display: none !important; }
.topbar { height: 84px; padding: 0 max(40px, calc((100vw - 1192px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: #fcfcf9; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 600; text-decoration: none; letter-spacing: -.5px; }
.brand strong { font-weight: 400; color: #7e867e; }
.brand-mark { display: flex; align-items: center; width: 33px; height: 33px; padding-left: 5px; border-radius: 10px; color: #fff; background: var(--green); font-size: 29px; line-height: 1; font-weight: 500; letter-spacing: -8px; overflow: hidden; }
.brand-mark span { color: #bfd3a7; }
.connection { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #737c73; }
.status-dot, .footer-dot { flex-shrink: 0; width: 6px; height: 6px; background: #a9afa6; border-radius: 50%; }
.connection.connected .status-dot { background: #5d9467; box-shadow: 0 0 0 4px #edf3e9; }
.connection.disconnected .status-dot { background: #c96c50; }
main { max-width: 1192px; margin: auto; padding: 51px 0 27px; }
.eyebrow { color: #7c8578; font-size: 11px; font-weight: 600; margin: 0 0 13px; letter-spacing: 1.6px; }
h1 { font-weight: 600; font-size: 36px; letter-spacing: -1.3px; margin: 0; line-height: 1.5; }
.heading-dot { color: #7e9a67; margin-left: 3px; }
.intro-copy { font-size: 14px; color: #7b837b; margin: 13px 0 0; line-height: 1.7; }
.workspace { display: grid; grid-template-columns: 1fr 1.06fr; gap: 26px; align-items: start; margin-top: 35px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 5px 22px #24332b03; overflow: hidden; }
.flow { padding: 0 30px; }
.step { padding: 27px 0; transition: opacity .2s; }
.step + .step { border-top: 1px solid #edf0e9; }
.step.muted h2 { color: #929a90; }
.step-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.step-number { display: inline-flex; width: 25px; height: 25px; border: 1px solid #e5e8e1; border-radius: 50%; align-items: center; justify-content: center; font-size: 11px; color: #969d93; font-weight: 600; }
.step-number.active { color: var(--green); background: #edf3e8; border-color: #e3ecda; }
.step-number.complete { background: var(--green); border-color: var(--green); color: white; }
h2 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: .1px; }
label { display: block; font-size: 12px; color: #626e62; font-weight: 500; margin-bottom: 9px; }
input, textarea { width: 100%; border: 1px solid #dfe4dc; background: #fcfdfa; border-radius: 8px; color: #39463b; padding: 13px 14px; font-size: 12px; line-height: 1.7; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { border-color: #87a378; box-shadow: 0 0 0 3px #edf2e8; }
input::placeholder, textarea::placeholder { color: #a0a79c; }
input:disabled, textarea:disabled { background: #f8f9f6; color: #b0b5ad; }
textarea { display: block; resize: vertical; min-height: 70px; }
.input-with-action { position: relative; }
.input-with-action input { padding-right: 62px; font-family: "IBM Plex Mono", Consolas, monospace; }
.input-action { position: absolute; top: 0; right: 5px; height: 100%; border: 0; background: transparent; color: #7d8978; font-size: 11px; padding: 0 10px; }
.help { font-size: 11px; line-height: 1.85; color: #90988b; margin: 10px 0 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 42px; border: 1px solid transparent; border-radius: 8px; padding: 10px 17px; font-size: 12px; font-weight: 500; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:focus-visible, .input-action:focus-visible, .brand:focus-visible { outline: 3px solid #a9c395; outline-offset: 3px; }
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover:not(:disabled) { background: #1c4d36; }
.button.primary:disabled { background: #e8ede5; color: #a0aa99; border-color: #e4e9df; }
.button.secondary { border-color: #dde4d8; color: var(--green); background: #fff; }
.button.secondary:hover:not(:disabled) { background: #f4f7f0; border-color: #bacbb0; }
.button.secondary:disabled { color: #adb4a6; border-color: #e8ece3; }
.button.quiet { background: transparent; color: #66785d; }
.button.quiet:hover { background: #f5f8f1; }
.full-width { width: 100%; justify-content: space-between; }
.proxy-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.proxy-actions .button.primary { justify-content: space-between; }
.proxy-result { border-radius: 8px; padding: 11px 13px; margin: -4px 0 16px; font-size: 11px; line-height: 1.85; overflow-wrap: anywhere; white-space: pre-line; }
.proxy-result.ok { background: #f0f5ea; color: #4f6a43; border: 1px solid #e1ead6; }
.proxy-result.warn { background: #fbf6e9; color: #8c7545; border: 1px solid #eee5c9; }
.proxy-result.error { background: #fcf1eb; color: #a45837; border: 1px solid #f2ddd0; }
.proxy-result.pending { background: #f7f8f4; color: #7f897a; border: 1px solid #eceee8; }
select { font: inherit; font-size: 12px; color: #39463b; border: 1px solid #dfe4dc; background: #fcfdfa; border-radius: 8px; padding: 7px 10px; outline: none; }
select:focus { border-color: #87a378; box-shadow: 0 0 0 3px #edf2e8; }
.proxy-scheme { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.proxy-scheme label { display: inline; margin: 0; font-size: 11px; color: #7f897a; }
.proxy-scheme select { padding: 4px 8px; font-size: 11px; }
.proxy-preview { font-size: 11px; color: #657955; font-family: "IBM Plex Mono", Consolas, monospace; overflow-wrap: anywhere; }
.proxy-preview.warn { color: #a45837; font-family: inherit; }
.tabs { display: flex; gap: 6px; margin-top: 30px; border-bottom: 1px solid var(--border); }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 14px; margin-bottom: -1px; font-size: 13px; color: #7b837d; }
.tab[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.tab:focus-visible { outline: 3px solid #a9c395; outline-offset: 2px; }
.tabs + .workspace { margin-top: 24px; }
.convert { margin-top: 24px; padding: 27px 30px; }
.convert-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.convert-head h2 { font-size: 19px; letter-spacing: -.5px; }
.convert-head .eyebrow { font-size: 10px; margin-bottom: 7px; }
.convert-controls { display: flex; gap: 14px; flex-wrap: wrap; }
.convert-controls label { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.convert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.convert-text { min-height: 260px; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 12px; white-space: pre; overflow: auto; }
#convert-output { background: #f5f8f0; color: #3f5236; }
.convert-summary { font-size: 12px; color: #6e7a68; margin: 14px 0 0; }
.convert-errors { background: #fcf1eb; color: #a45837; border: 1px solid #f2ddd0; border-radius: 8px; margin-top: 10px; padding: 10px 12px; font-size: 11px; line-height: 1.85; max-height: 180px; overflow: auto; white-space: pre-line; overflow-wrap: anywhere; }
.convert-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.convert-note { margin-bottom: 0; }
.step-description { font-size: 12px; line-height: 1.9; color: #7f897a; margin: -3px 0 13px; }
#link-placeholder { margin-bottom: 0; }
.auth-url { min-height: 64px; max-height: 160px; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 10px; word-break: break-all; background: #f5f8f0; color: #6e7e65; }
.button-row { display: flex; gap: 9px; margin-top: 12px; }
.button-row .button { min-height: 36px; font-size: 11px; }
.result { padding: 29px; position: sticky; top: 24px; }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; gap: 12px; }
.result-header .eyebrow { font-size: 10px; margin-bottom: 7px; }
.result-header h2 { font-size: 19px; letter-spacing: -.5px; }
.result-status { font-size: 10px; color: #929a89; background: #f4f6f0; padding: 6px 10px; border: 1px solid #edf0e7; border-radius: 20px; white-space: nowrap; }
.result-status.success { color: #437641; background: #eff6e9; border-color: #e1edda; }
.result-status.loading { color: #7b7547; background: #faf7e8; border-color: #eee9d5; }
.editor { background: #1c2b23; border: 1px solid #21362a; border-radius: 10px; overflow: hidden; }
.editor-toolbar { display: flex; align-items: center; gap: 9px; height: 47px; border-bottom: 1px solid #344235; padding: 0 16px; color: #abb6a7; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 10px; }
.file-icon { color: #b7c995; font-size: 12px; flex-shrink: 0; }
#filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-format { margin-left: auto; color: #74816f; font-size: 9px; }
.empty-state { height: 368px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 25px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 55px; height: 65px; border: 1px solid #506147; color: #8a9c78; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 23px; border-radius: 7px; margin-bottom: 10px; background: #253529; }
.empty-state p { color: #c0c9b9; font-size: 12px; margin: 5px 0 0; }
.empty-state > span:last-child { color: #7b8b73; font-size: 11px; line-height: 1.8; }
.json-output { border: 0; background: transparent; color: #c7d7b5; border-radius: 0; height: 368px; min-height: 240px; max-height: 800px; padding: 19px; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 11px; line-height: 1.9; white-space: pre; overflow: auto; resize: vertical; tab-size: 2; }
.json-output:focus { box-shadow: inset 0 0 0 1px #8ea67b; }
.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.result-note { margin: 16px 0 0; color: #9aa28e; text-align: center; font-size: 10px; line-height: 1.8; }
.account { display: flex; align-items: center; gap: 10px; padding: 13px 0 20px; margin-top: -12px; }
.account-icon { color: #587b43; border: 1px solid #e0ebd6; background: #f2f7ed; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-size: 12px; }
.account > div { min-width: 0; }
.account strong, .account span { display: block; }
.account strong { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
#account-org { color: #8d9784; font-size: 10px; margin-top: 4px; overflow-wrap: anywhere; }
.message { border-radius: 8px; padding: 12px 14px; margin: 0 0 24px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.message.error { background: #fcf1eb; color: #a45837; border: 1px solid #f2ddd0; }
.message.info { background: #f0f5ea; color: #657955; border: 1px solid #e1ead6; }
.result-warnings { background: #fbf6e9; color: #8c7545; border: 1px solid #eee5c9; border-radius: 7px; margin-top: 16px; padding: 12px; font-size: 11px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
footer { display: flex; align-items: center; gap: 7px; color: #919a88; font-size: 10px; padding: 23px 2px 0; line-height: 1.8; }
.footer-dot { width: 4px; height: 4px; background: #9cae8c; }
.footer-right { margin-left: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); border-radius: 8px; padding: 12px 22px; background: #253e2b; box-shadow: 0 6px 24px #24332b22; color: #fff; font-size: 12px; max-width: calc(100vw - 32px); text-align: center; z-index: 5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.spinner { width: 14px; height: 14px; display: inline-block; border: 2px solid #ffffff50; border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1270px) { main { padding-left: 40px; padding-right: 40px; } }
@media (max-width: 850px) {
  .topbar { padding: 0 25px; height: 72px; }
  main { padding: 35px 25px 22px; }
  h1 { font-size: 29px; }
  .workspace { gap: 19px; grid-template-columns: 1fr; margin-top: 26px; }
  .result { position: static; }
  .empty-state { height: 240px; }
  .convert-grid { grid-template-columns: 1fr; }
  .convert-text { min-height: 180px; }
  footer { flex-wrap: wrap; gap: 5px; }
  .footer-right { margin-left: 9px; }
}
@media (max-width: 450px) {
  .topbar { padding: 0 18px; }
  .brand { font-size: 16px; gap: 8px; }
  .connection { font-size: 10px; }
  main { padding: 28px 16px 20px; }
  h1 { font-size: 26px; letter-spacing: -1px; }
  .intro-copy { font-size: 12px; }
  .flow { padding: 0 22px; }
  .result { padding: 23px 21px; }
  .convert { padding: 23px 21px; }
  .footer-right { margin-left: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 0s !important; } }

.login-wrap { max-width: 470px; margin: 10vh auto; padding: 0 20px; }
.login-card { padding: 36px; }
.login-card h1 { font-size: 29px; }
.stack { margin-top: 25px; }
.stack label { margin-bottom: 18px; }
.stack input, .form-grid input, .form-grid select, dialog input, dialog select { margin-top: 7px; }
.error-text { color: #a45837; }
.user-bar, .workspace-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.user-bar { min-width: 0; font-size: 12px; color: #6a7769; }
.workspace-identity { display: flex; align-items: center; gap: 6px; min-width: 0; }
#current-username { max-width: min(24vw, 240px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-identity .badge { margin-left: 0; }
.workspace-actions .balance-label, .workspace-account-actions .button { white-space: nowrap; }
.workspace-account-actions { display: flex; align-items: center; gap: 2px; }
.workspace-account-actions .button { min-height: 36px; padding: 6px 9px; }
.balance-label strong { font-size: 17px; color: var(--green); margin-left: 4px; }
.badge { display: inline-block; font-size: 10px; border-radius: 5px; padding: 4px 7px; background: #edf3e8; color: #4a6b3e; margin-left: 10px; white-space: nowrap; }
.badge.failed { color: #a45837; background: #fcf1eb; }
.badge.pending { color: #8c7545; background: #fbf6e9; }
.management { margin-top: 24px; }
.panel-card { padding: 27px 30px; margin-bottom: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.panel-heading h2 { font-size: 20px; }
.panel-heading .eyebrow { margin-bottom: 8px; font-size: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.stat span { font-size: 11px; color: #7b837d; }
.stat strong { display: block; font-size: 27px; margin-top: 9px; font-weight: 500; }
.filter-bar, .batch-bar, .inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-form { flex: 1; }
.inline-form input { flex: 1; min-width: 140px; width: auto; }
.filter-bar { margin-bottom: 18px; }
.filter-bar > input { width: 160px; flex: 1; min-width: 100px; }
.filter-bar label { margin: 0; }
.batch-bar { padding: 12px; background: #f6f8f2; border-radius: 8px; margin: 18px 0; font-size: 11px; }
.batch-bar select { max-width: 220px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
input[type="checkbox"] { width: 15px; height: 15px; padding: 0; accent-color: var(--green); flex-shrink: 0; }
.table-wrap { overflow-x: auto; margin-top: 15px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
th { font-weight: 500; color: #8a9385; background: #fafbf7; white-space: nowrap; }
th, td { padding: 13px 12px; border-bottom: 1px solid #edf0e9; line-height: 1.7; vertical-align: middle; }
td { color: #4a594a; }
td small { display: block; color: #8a9385; font-size: 10px; max-width: 260px; overflow-wrap: anywhere; }
td .badge { margin: 0; }
.row-actions { display: flex; gap: 4px; white-space: nowrap; }
.row-actions .button { padding: 5px 8px; min-height: 30px; font-size: 11px; }
.danger { color: #ac593d !important; }
.button.quiet:disabled { color: #b0b5ad; opacity: .6; pointer-events: none; }
.empty-row { text-align: center; color: #90988b; padding: 40px; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 15px; color: #8a9385; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: end; }
.form-grid label { margin-bottom: 0; }
.form-grid select, label > select { display: block; width: 100%; min-height: 43px; }
.form-grid > .button { justify-self: start; }
.key-list { margin-top: 25px; }
.key-item { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding: 15px 0; gap: 12px; font-size: 13px; }
.key-item small { display: block; margin-top: 6px; color: #8a9385; }
.points-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.big-balance { color: var(--green); font-size: 12px; }
.big-balance strong { font-size: 38px; font-weight: 500; }
#redeem-quota:empty { display: none; }
#redeem-error { margin: 8px 0 0; }
.query-box { background: #f7f9f3; padding: 18px; border-radius: 9px; margin-top: 22px; }
.query-box textarea { background: #fff; }
.query-box .filter-bar { margin-bottom: 0; margin-top: 15px; }
.kitty-filters { display: grid; grid-template-columns: minmax(144px, 1.15fr) minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); align-items: end; gap: 9px; }
.kitty-date-row { display: flex; align-items: end; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
.kitty-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(100%, 296px); }
.kitty-date-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.kitty-date-presets .button { padding-inline: 10px; }
.kitty-date-presets .button[aria-pressed="true"] { border-color: #87a378; background: #edf3e8; }
.kitty-query-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
#kitty-bill-all[aria-pressed="true"] { border-color: #87a378; background: #edf3e8; }
.kitty-search label { min-width: 0; margin: 0; }
.kitty-search :is(input, select) { margin-top: 4px; min-width: 0; min-height: 42px; padding: 8px 10px; }
.kitty-date-help { margin: 6px 0 0; }
.kitty-disclosure { margin-top: 10px; }
.kitty-disclosure summary { width: fit-content; cursor: pointer; color: var(--green); font-size: 12px; padding: 5px 0; }
.kitty-disclosure .help { margin: 4px 0; }
.kitty-disclosure textarea { background: #fff; }
#kitty-list-error { margin: 8px 0 0; }
@media (max-width: 900px) {
  .kitty-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .kitty-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kitty-key-field { grid-column: 1 / -1; }
  .kitty-dates, .kitty-date-presets { width: 100%; }
}
.kitty-results { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.kitty-result-heading, .kitty-bill-detail-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; }
.kitty-results h3 { margin: 0; font-size: 14px; }
.kitty-result-views { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #f7f9f3; }
.kitty-result-views .button { min-height: 36px; padding: 5px 11px; }
.kitty-result-views .button[aria-pressed="true"] { background: #fff; border-color: var(--border); color: var(--green); }
.kitty-result-body :is(.help, .message, .table-wrap) { margin: 0 0 8px; }
.kitty-result-body .table-wrap { max-height: min(52vh, 420px); overflow: auto; }
.kitty-result-body th { position: sticky; top: 0; }
.kitty-result-body :is(th, td) { padding: 8px 10px; }
.kitty-result-body .data-output { margin: 6px 0 0; }
.kitty-result-pagination { margin-top: 8px; }
#usage-table table { min-width: 780px; }
#usage-table td:nth-child(2) { overflow-wrap: anywhere; }
.data-output { white-space: pre-wrap; overflow-wrap: anywhere; background: #1c2b23; color: #c7d7b5; border-radius: 9px; padding: 20px; max-height: 500px; overflow: auto; font-size: 11px; line-height: 1.8; }
.edit-dialog { width: min(760px, calc(100vw - 30px)); max-height: 90vh; border: 1px solid var(--border); border-radius: 16px; padding: 29px; color: #24332b; background: #fff; box-shadow: 0 20px 100px #13251b33; }
.edit-dialog::backdrop { background: #10291c66; backdrop-filter: blur(3px); }
.small-dialog { max-width: 460px; }
.kitty-bill-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.kitty-bill-summary > div { min-width: 0; padding: 10px 12px; background: #f7f9f3; border: 1px solid var(--border); border-radius: 8px; }
.kitty-bill-summary dt { font-size: 12px; color: #536652; }
.kitty-bill-summary dd { margin: 4px 0 0; color: var(--green); font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kitty-bill-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; }
#kitty-bill-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
#kitty-bill-summary > div { padding: 14px; border-radius: 10px; background: #fff; }
#kitty-bill-summary > div:first-child { background: #f3f7f0; }
#kitty-bill-summary dd { color: inherit; font-size: clamp(18px, 2.3vw, 26px); font-weight: 650; }
#kitty-bill-summary > div:first-child dd { color: var(--green); }
#kitty-bill-summary dd :is(span, small) { color: var(--muted); font-size: 12px; font-weight: 400; }
#kitty-bill-summary dd span { margin-left: 4px; }
#kitty-bill-summary dd small { display: block; margin-top: 4px; }
.kitty-bill-details { overflow: clip; border: 1px solid var(--border); border-radius: 10px; }
.kitty-bill-detail-heading { padding: 10px 12px; margin: 0; border-bottom: 1px solid var(--border); }
#kitty-bill-table { margin: 0; }
#kitty-bill-table table { min-width: 590px; }
#kitty-bill-table td:nth-child(2) { overflow-wrap: anywhere; }
#kitty-bill-table:not([data-view="by_account"]) :is(th, td):last-child,
#kitty-bill-table[data-view="by_account"] :is(th, td):nth-last-child(2) {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kitty-bill-share { display: flex; align-items: center; gap: 8px; min-width: 100px; font-variant-numeric: tabular-nums; }
.kitty-bill-share progress { width: 100%; min-width: 44px; height: 7px; accent-color: var(--green); }
.kitty-bill-share span { min-width: 44px; text-align: right; }
@media (max-width: 720px) {
  #kitty-bill-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#account-dialog {
  --account-dialog-gutter: 24px;
  width: min(1080px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
}
#account-dialog[open], #account-form { display: flex; flex-direction: column; }
#account-form { min-height: 0; }
.account-dialog-header, .account-dialog-footer { flex: none; padding: 10px var(--account-dialog-gutter); }
.account-dialog-header { margin: 0; align-items: center; border-bottom: 1px solid var(--border); }
.account-dialog-body {
  min-height: 0;
  padding: 2px var(--account-dialog-gutter) 10px;
  overflow: auto;
  overscroll-behavior: contain;
}
.account-dialog-footer { border-top: 1px solid var(--border); }
.account-dialog-footer .dialog-actions { align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
.account-dialog-footer .key-selector { min-width: 0; max-width: min(100%, 240px); min-height: 38px; margin: 0 auto 0 0; }
.account-dialog-footer .message { margin: 0 0 8px; padding: 8px 10px; }
#account-dialog h2 { font-size: 21px; }
#account-dialog :is(label, input, select, textarea, legend), #account-dialog .button { font-size: 14px; }
#account-dialog :is(input:not([type="radio"]), textarea) { padding: 9px 12px; line-height: 1.5; }
#account-dialog .button { min-height: 38px; padding: 7px 13px; }
#account-dialog :is(.help, .message) { font-size: 13px; }
#account-dialog .form-grid { gap: 11px 18px; }
#account-dialog .form-grid :is(input, select) { min-height: 40px; margin-top: 4px; }
fieldset { border: 0; padding: 22px 0; margin: 0; border-top: 1px solid var(--border); min-width: 0; }
legend { padding: 0 10px 0 0; font-size: 11px; color: #8a9385; letter-spacing: 1px; }
fieldset > label { margin-top: 15px; }
.model-options { display: flex; flex-wrap: wrap; gap: 10px; }
.model-options label { border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 11px; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.account-fold { border-bottom: 1px solid var(--border); }
.account-fold summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 8px;
  align-items: center;
  gap: 10px;
  min-height: 37px;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.account-fold summary::-webkit-details-marker { display: none; }
.account-fold summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.account-fold[open] summary::after { transform: rotate(225deg); }
.account-fold-value { color: #687568; font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.account-fold-content { padding: 4px 0 14px; }
.account-credentials { border-top: 0; margin-top: 8px; padding: 4px 0 9px; }
.account-credentials > label { margin-top: 4px; }
.paste-actions { margin: 7px 0 12px; }
.paste-actions .help { margin: 0; }
.account-protocol label, .account-protocol select { margin: 0; }
.account-oauth { margin-top: 10px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: #f7f9f3; }
.account-oauth-step { padding: 10px 0; }
.account-oauth-step + .account-oauth-step { border-top: 1px solid var(--border); }
.account-oauth-step h3 { margin: 0 0 9px; font-size: 13px; }
.account-oauth-step h3 label { margin: 0; font: inherit; }
.account-oauth-step textarea { margin: 0 0 10px; }
.account-oauth-step .help { margin-bottom: 7px; }
.account-oauth .message { margin: 0 0 13px; }
.tag-options { margin: 15px 0; }
.tag-options .button + .button { margin-left: 7px; }
.tag-options .button[aria-pressed="true"] { color: #fff; background: var(--green); border-color: var(--green); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
#c-auth-json { font-family: Consolas, monospace; }
#manage-message { margin-top: 20px; }
.tabs { overflow-x: auto; }
.tab { white-space: nowrap; }
.workspace-signed-in .topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 18px;
  min-height: 58px;
  height: auto;
  padding: 6px max(24px, calc((100vw - 1192px) / 2));
}
.workspace-signed-in .topbar .connection { justify-self: end; white-space: nowrap; }
.workspace-signed-in #app-panel { padding-top: 0; }
.workspace-signed-in .tabs { margin-top: 0; overflow-y: hidden; }
@media (max-width: 960px) {
  .workspace-signed-in .topbar { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 25px; }
  .user-bar { grid-column: 1 / -1; padding-top: 4px; border-top: 1px solid var(--border); }
  #current-username { max-width: none; }
  .workspace-account-actions .button { min-height: 44px; }
}
@media (max-width: 480px) {
  .workspace-signed-in .topbar { padding-inline: 16px; }
  .user-bar { flex-wrap: wrap; gap: 2px 8px; }
  .workspace-identity, .workspace-actions { width: 100%; }
  .workspace-actions { flex-wrap: wrap; gap: 0 8px; }
}
.admin-workspace { --admin-gutter: 24px; }
.admin-workspace #app-panel { max-width: 1240px; padding: 0 var(--admin-gutter) 22px; }
.admin-workspace .management { margin-top: 14px; }
.admin-workspace .panel-card { padding: 20px 24px; margin-bottom: 16px; }
.admin-workspace .panel-card .panel-heading { margin-bottom: 14px; }
.admin-workspace .panel-card .panel-heading .eyebrow { display: none; }
.admin-workspace .management :is(.table-wrap, .pagination):empty { display: none; }
.admin-workspace .stats { gap: 10px; margin-bottom: 14px; }
.admin-workspace .stat { padding: 11px 15px; }
.admin-workspace .stat strong { font-size: 23px; margin-top: 4px; }
@media (max-width: 700px) {
  .admin-workspace { --admin-gutter: 14px; }
  .admin-workspace .tabs { gap: 2px; }
  .admin-workspace .tab { min-height: 44px; padding-inline: 7px; font-size: 12px; }
  .admin-workspace .panel-card { padding: 16px; }
}
@media (max-width: 650px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .panel-card { padding: 20px 16px; }
  .panel-heading { align-items: flex-start; }
  .panel-heading h2 { font-size: 17px; }
  .edit-dialog { padding: 23px 18px; }
  #account-dialog {
    --account-dialog-gutter: 14px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }
  #account-dialog .panel-heading { align-items: center; }
  #account-dialog :is(.button, .account-fold summary) { min-height: 44px; }
  #account-dialog :is(input, select, textarea) { font-size: 16px; }
  #account-dialog #c-paste { min-height: 136px; }
  .account-dialog-footer .key-selector { width: 100%; max-width: none; min-height: 44px; }
  #account-dialog .account-dialog-footer .button { padding-inline: 8px; }
  .batch-bar { align-items: stretch; }
  .batch-bar select { max-width: 100%; }
}
