:root {
  color-scheme: light;
  --canvas: oklch(97.2% 0.006 168);
  --surface: oklch(99.2% 0.003 168);
  --surface-2: oklch(94.8% 0.012 168);
  --ink: oklch(21% 0.025 174);
  --muted: oklch(49% 0.02 174);
  --line: oklch(87% 0.014 174);
  --teal: oklch(40% 0.09 174);
  --teal-soft: oklch(91% 0.035 174);
  --amber: oklch(68% 0.14 73);
  --red: oklch(55% 0.17 28);
  --font:
    "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
}
body {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
  transition:
    transform 140ms cubic-bezier(0.25, 1, 0.5, 1),
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  cursor: wait;
  opacity: 0.58;
}
.skip-link {
  position: fixed;
  inset: 10px auto auto 10px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--ink);
  transform: translateY(-150%);
  transition: transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
}
.skip-link:focus {
  transform: translateY(0);
}
.auth-pending .shell {
  visibility: hidden;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}
.rail {
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: oklch(94% 0.01 168);
  background: oklch(20% 0.035 174);
}
.brand {
  height: 44px;
  padding: 0 10px;
  display: flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-size: 18px;
}
.mark {
  width: 23px;
  height: 23px;
  position: relative;
  border: 1px solid oklch(78% 0.07 174);
  transform: rotate(45deg);
}
.mark:after {
  content: "";
  position: absolute;
  inset: 5px;
  background: oklch(72% 0.12 174);
}
.rail-scope {
  margin: 24px 10px 18px;
  color: oklch(64% 0.02 174);
  font-size: 11px;
}
.rail nav {
  display: grid;
  gap: 3px;
}
.rail nav button {
  min-height: 43px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: oklch(76% 0.015 174);
  background: none;
  border: 0;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
}
.rail nav button.active {
  color: oklch(98% 0.005 174);
  background: oklch(29% 0.045 174);
}
.rail nav button.active:before {
  content: "";
  width: 3px;
  height: 18px;
  margin-left: -12px;
  margin-right: -3px;
  background: oklch(72% 0.12 174);
}
.nav-icon {
  width: 18px;
  text-align: center;
}
.rail-foot {
  margin-top: auto;
  padding: 18px 10px 2px;
  border-top: 1px solid oklch(31% 0.025 174);
}
.rail-foot b,
.rail-foot small {
  display: block;
}
.rail-foot b {
  font-size: 12px;
}
.rail-foot small {
  margin-top: 4px;
  color: oklch(60% 0.02 174);
  font-size: 10px;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 74px;
  padding: 0 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.workspace-name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.workspace-name > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 50%;
  font-weight: 700;
}
.workspace-name b,
.workspace-name small {
  display: block;
}
.workspace-name b {
  font-size: 13px;
}
.workspace-name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.top-actions {
  display: flex;
  gap: 22px;
  align-items: center;
}
.top-actions button,
.section-head button {
  padding: 0;
  color: var(--teal);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 11px;
}
.service-state {
  font-size: 11px;
}
.service-state:before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--teal);
}
main {
  padding: 38px 42px 56px;
}
.view {
  display: none;
}
.view.active {
  display: block;
  animation: reveal 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.page-head {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
}
.page-head h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.035em;
}
.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.period,
.primary,
.secondary {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 5px;
}
.period,
.secondary {
  background: var(--surface);
  border: 1px solid var(--line);
}
.primary {
  color: oklch(98% 0.004 174);
  background: var(--teal);
  border: 1px solid var(--teal);
  font-weight: 650;
  cursor: pointer;
}
.primary:hover {
  background: oklch(34% 0.09 174);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
h1:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.ledger {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 230px 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.ledger > div {
  min-height: 142px;
  padding: 24px 26px;
  border-right: 1px solid var(--line);
}
.ledger > div:last-child {
  border: 0;
}
.ledger span {
  color: var(--muted);
  font-size: 11px;
}
.ledger strong {
  display: block;
  margin-top: 24px;
  font-size: 25px;
  letter-spacing: -0.03em;
}
.ledger small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}
.ledger .spend p {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 12px 0 0;
}
.ledger .spend strong {
  display: inline;
  margin: 0;
  font-size: 31px;
}
.ledger em {
  color: var(--muted);
  font-style: normal;
}
.meter {
  height: 7px;
  margin-top: 20px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 10px;
}
.meter i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
.overview-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.72fr);
  gap: 30px;
}
.overview-grid.lower {
  margin-top: 34px;
}
.section-head {
  min-height: 41px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--ink);
}
.section-head h2 {
  margin: 0;
  font-size: 16px;
}
.table-wrap {
  overflow: auto;
}
.table-wrap.full {
  border-top: 1px solid var(--ink);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}
th {
  padding: 13px 10px 11px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 10px;
  font-weight: 500;
}
td {
  padding: 17px 10px 17px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.key-name b,
.key-name small {
  display: block;
}
.key-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
.key-permission b,
.key-permission small {
  display: block;
}
.key-permission b {
  font-weight: 500;
}
.key-permission small {
  max-width: 260px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}
.key-spend b,
.key-spend small,
.key-spend button {
  display: block;
}
.key-spend small,
.key-spend .unpriced-link {
  margin-top: 3px;
  color: var(--red);
  font-size: 9px;
}
.key-spend .unpriced-link {
  max-width: 150px;
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--red) 45%, transparent);
  cursor: pointer;
  line-height: 1.45;
  text-align: left;
}
.key-spend .unpriced-link:hover,
.key-spend .unpriced-link:focus-visible {
  border-bottom-color: currentColor;
}
.tag {
  display: inline-flex;
  padding: 4px 7px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 3px;
  font-size: 9px;
}
.tag.active {
  color: var(--teal);
  background: var(--teal-soft);
}
.tag.warn {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 12%, transparent);
}
.tag.info {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 10%, transparent);
}
.row-actions {
  display: flex;
  gap: 10px;
}
.row-actions button {
  padding: 0;
  color: var(--teal);
  background: none;
  border: 0;
  font-size: 10px;
  cursor: pointer;
}
.row-actions button.danger {
  color: var(--red);
}
.row-actions button.reveal-key {
  color: var(--surface);
  padding: 5px 8px;
  background: var(--teal);
  border-radius: 3px;
}
.row-actions .secret-unavailable {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.budget-value-button {
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.budget-value-button > small {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 9px;
}
.budget-value-button:hover > small,
.budget-value-button:focus-visible > small {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.project-list {
  display: grid;
}
.project {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.project-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.project b,
.project small {
  display: block;
}
.project b {
  font-size: 11px;
}
.project small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}
.project strong {
  font-size: 11px;
}
.project-amount {
  flex: none;
  text-align: right;
}
.project-amount small {
  margin: 0 0 5px;
}
.project .meter {
  height: 4px;
  margin-top: 12px;
}
.project.warn .meter i {
  background: var(--amber);
}
.invoice-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr 130px 90px;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.invoice-row b,
.invoice-row small {
  display: block;
}
.invoice-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}
.audit-list > div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.audit-list i {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--teal);
}
.audit-list b,
.audit-list small {
  display: block;
  font-size: 10px;
}
.audit-list small,
.audit-list time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}
.empty {
  padding: 34px 0;
  color: var(--muted);
  font-size: 11px;
}
.project-ledger {
  border-top: 1px solid var(--ink);
}
.project-ledger .project {
  padding: 24px 0;
}
.billing-summary {
  padding: 24px 0 34px;
  border-top: 1px solid var(--ink);
}
.billing-summary span,
.billing-summary small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.billing-summary strong {
  display: block;
  margin: 12px 0 7px;
  font-size: 34px;
}
.usage-panel {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--ink);
}
.usage-head {
  align-items: end;
}
.pricing-note {
  margin: -8px 0 20px;
  padding: 11px 13px;
  color: var(--muted);
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
  border-left: 2px solid var(--amber);
  font-size: 10px;
  line-height: 1.6;
}
.pricing-note b {
  color: var(--ink);
}
.usage-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 18px;
  margin: 8px 0 18px;
}
.usage-filters label {
  display: grid;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}
.usage-filters input,
.usage-filters select {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.usage-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
}
.usage-numeric {
  text-align: right;
}
#usage-rows small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.audit-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}
.audit-timeline li {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.audit-timeline time,
.audit-timeline small {
  color: var(--muted);
}
.login {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 6vw;
  display: grid;
  grid-template-columns: 0.6fr 1fr;
  gap: 10vw;
  align-items: center;
  background: var(--canvas);
}
.login[hidden] {
  display: none;
}
.login-brand {
  align-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
}
.login-brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.login form {
  max-width: 560px;
  padding: 48px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.login form > p {
  margin: 0 0 22px;
  color: var(--teal);
  font-size: 11px;
}
.login h1 {
  margin: 0 0 32px;
  font-size: 38px;
}
.login label,
dialog label {
  display: grid;
  gap: 8px;
  font-size: 11px;
}
.login input,
dialog input,
dialog select {
  min-height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.form-help {
  display: block;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 10px;
}
.field-help {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.budget-context,
.budget-limits {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.budget-context small,
.budget-limits small {
  color: var(--muted);
  font-size: 9px;
}
.budget-limits span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 10px;
}
.budget-limits b {
  color: var(--ink);
}
.form-error {
  color: var(--red);
  font-size: 10px;
}
.password-guidance {
  margin: 0;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
  font-size: 10px;
  line-height: 1.6;
}
.login .primary {
  width: 100%;
}
dialog {
  width: min(570px, calc(100vw - 32px));
  padding: 0;
  background: var(--canvas);
  border: 1px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 20px 80px color-mix(in oklch, var(--ink) 22%, transparent);
}
dialog::backdrop {
  background: color-mix(in oklch, var(--ink) 56%, transparent);
}
dialog form,
dialog > div {
  padding: 30px;
  display: grid;
  gap: 20px;
}
dialog header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
dialog header span {
  color: var(--teal);
  font-size: 10px;
}
dialog h2 {
  margin: 5px 0 0;
  font-size: 24px;
}
dialog header button {
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--line);
  font-size: 22px;
  cursor: pointer;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
fieldset {
  display: flex;
  gap: 16px;
  border: 0;
  padding: 0;
  margin: 0;
}
fieldset legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}
fieldset label {
  display: flex;
  align-items: center;
  gap: 7px;
}
fieldset input {
  min-height: auto;
}
.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;
}
.scope-picker,
.key-model-picker {
  display: grid;
  gap: 10px;
}
.scope-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scope-options label {
  cursor: pointer;
}
.scope-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.scope-options span {
  padding: 8px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
}
.scope-options input:checked + span {
  color: var(--surface);
  background: var(--teal);
  border-color: var(--teal);
}
.scope-picker > small,
.key-model-picker > small {
  color: var(--muted);
  font-size: 9px;
}
.all-models-option {
  min-height: 56px;
  padding: 10px 12px;
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}
.all-models-option input,
.model-option input {
  width: 16px;
  accent-color: var(--teal);
}
.all-models-option b,
.all-models-option small,
.model-option b,
.model-option small {
  display: block;
}
.all-models-option small,
.model-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
#key-model-controls {
  display: grid;
  gap: 8px;
}
#key-model-controls[hidden] {
  display: none;
}
.model-search input {
  width: 100%;
}
.model-options {
  max-height: 220px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.model-option {
  min-height: 52px;
  padding: 9px 11px;
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.model-option:last-child {
  border-bottom: 0;
}
.model-option:hover {
  background: var(--surface-2);
}
.model-empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.secret-dialog code {
  overflow-wrap: anywhere;
  color: var(--teal);
  font-size: 11px;
  line-height: 1.6;
}
.secret-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.secret-value {
  min-width: 0;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 3px;
}
.secret-value button {
  padding: 7px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
}
.secret-value button:hover,
.secret-value button:focus-visible {
  color: var(--teal);
  border-color: var(--teal);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  padding: 12px 18px;
  color: var(--surface);
  background: var(--ink);
  border-bottom: 3px solid var(--teal);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.18s ease,
    transform 0.24s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }
  .brand b,
  .rail-scope,
  .rail nav button:not(.active) {
    font-size: 0;
  }
  .rail nav button {
    justify-content: center;
    padding: 0;
  }
  .nav-icon {
    font-size: 16px;
  }
  .rail-foot {
    display: none;
  }
  .ledger {
    grid-template-columns: 1fr 1fr;
  }
  .ledger .spend {
    grid-column: 1/-1;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .topbar,
  main {
    padding-left: 28px;
    padding-right: 28px;
  }
}
@media (max-width: 680px) {
  .shell {
    display: block;
  }
  .rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    height: 118px;
    padding: 6px 10px;
    display: block;
  }
  .brand,
  .rail-scope,
  .rail-foot {
    display: none;
  }
  .rail nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .rail nav button,
  .rail nav button:not(.active) {
    min-height: 52px;
    display: grid;
    place-items: center;
    gap: 0;
    font-size: 8px;
  }
  .rail nav button.active:before {
    display: none;
  }
  .topbar {
    height: 64px;
    padding: 0 18px;
  }
  .service-state {
    display: none;
  }
  main {
    padding: 26px 18px 144px;
  }
  .page-head {
    align-items: start;
  }
  .page-head h1 {
    font-size: 24px;
  }
  .ledger {
    grid-template-columns: 1fr;
  }
  .ledger .spend {
    grid-column: auto;
  }
  .ledger > div {
    min-height: 120px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .overview-grid {
    gap: 24px;
  }
  .login {
    padding: 24px 18px;
    grid-template-columns: 1fr;
    align-content: start;
  }
  .login-brand {
    margin-top: 12px;
  }
  .login form {
    padding: 34px 0;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .usage-filters {
    grid-template-columns: 1fr 1fr;
  }
  .secret-value {
    grid-template-columns: 1fr 1fr;
  }
  .secret-value code {
    grid-column: 1 / -1;
  }
}
.empty-row {
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (forced-colors: active) {
  .service-state::before,
  .audit-list i {
    border: 1px solid currentColor;
  }
}
.nav-icon {
  height: 18px;
  display: grid;
  place-items: center;
}
.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
dialog header button {
  width: auto;
  min-width: 52px;
  padding: 0 10px;
  font-size: 10px;
}
@media (max-width: 1050px) {
  .rail nav button {
    font-size: 0;
  }
}
@media (max-width: 680px) {
  .rail nav button,
  .rail nav button:not(.active) {
    font-size: 8px;
  }
}

.button-link {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.integration-strip,
.endpoint-bar {
  min-height: 76px;
  margin-bottom: 26px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 4px;
}
.integration-strip > div:first-child,
.endpoint-bar > div {
  min-width: 0;
  flex: 1;
}
.integration-strip span,
.endpoint-bar span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
}
.integration-strip code,
.endpoint-bar code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.integration-strip p {
  margin: 0;
  font-size: 11px;
}
.endpoint-bar.unconfigured {
  border-left-color: var(--amber);
}
.contract-warning {
  margin: -14px 0 26px;
  padding: 10px 13px;
  color: oklch(42% 0.09 73);
  background: oklch(95% 0.035 73);
  border: 1px solid oklch(86% 0.07 73);
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.6;
}
.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
.docs-config {
  position: sticky;
  top: 24px;
  padding: 20px;
  display: grid;
  gap: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
}
.docs-config h2,
.reference-section h2,
.reference-grid h2 {
  margin: 0;
  font-size: 14px;
}
.docs-config label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}
.docs-config select {
  width: 100%;
  min-height: 40px;
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.docs-config small {
  margin-top: -10px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.scope-summary {
  margin-top: 2px;
  padding-top: 15px;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
}
.scope-summary span,
.scope-summary small {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}
.scope-summary b {
  font-size: 11px;
}
.docs-content {
  min-width: 0;
}
.protocol-tabs {
  min-height: 42px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--ink);
}
.protocol-tabs button {
  padding: 0 13px;
  flex: none;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 10px;
}
.protocol-tabs button.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}
.code-panel {
  margin-top: 14px;
  overflow: hidden;
  color: oklch(91% 0.012 168);
  background: oklch(18% 0.025 174);
  border-radius: 5px;
}
.code-panel header {
  min-height: 64px;
  padding: 13px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: oklch(22% 0.028 174);
  border-bottom: 1px solid oklch(31% 0.025 174);
}
.code-panel header span {
  color: oklch(70% 0.08 174);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}
.code-panel h2 {
  margin: 4px 0 0;
  font-size: 13px;
}
.code-panel button {
  padding: 7px 10px;
  color: oklch(91% 0.012 168);
  background: none;
  border: 1px solid oklch(42% 0.025 174);
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
}
.code-panel pre {
  min-height: 300px;
  max-height: 560px;
  margin: 0;
  padding: 20px;
  overflow: auto;
  white-space: pre;
  tab-size: 2;
}
.code-panel code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
}
.code-panel footer {
  padding: 11px 17px;
  color: oklch(65% 0.02 174);
  border-top: 1px solid oklch(31% 0.025 174);
  font-size: 9px;
  line-height: 1.5;
}
.tool-section {
  margin-top: 32px;
}
.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tool-section .section-head h2 {
  margin: 0;
  font-size: 18px;
}
.tool-section .section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.tool-setup {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
}
.tool-setup > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}
.tool-setup header span,
.config-path span,
.launch-command span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}
.tool-setup h3 {
  margin: 4px 0 0;
  font-size: 15px;
}
.tool-setup header a {
  flex: none;
  color: var(--teal);
  font-size: 9px;
  text-decoration: none;
}
.tool-setup p {
  margin: 14px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}
.tool-setup p code,
.config-path code,
.launch-command code {
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}
.config-path,
.launch-command {
  display: grid;
  gap: 5px;
}
.mini-code {
  position: relative;
  margin: 10px 0 13px;
  color: oklch(91% 0.012 168);
  background: oklch(18% 0.025 174);
  border-radius: 4px;
}
.mini-code button {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 5px 7px;
  color: oklch(91% 0.012 168);
  background: oklch(22% 0.028 174);
  border: 1px solid oklch(42% 0.025 174);
  border-radius: 3px;
  cursor: pointer;
  font-size: 8px;
}
.mini-code pre {
  min-height: 238px;
  max-height: 330px;
  margin: 0;
  padding: 38px 14px 14px;
  overflow: auto;
  white-space: pre;
}
.mini-code code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  line-height: 1.65;
}
.tool-setup > small {
  display: block;
  margin-top: 13px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
.tool-setup.unavailable {
  border-top-color: var(--line-strong);
}
.tool-unavailable {
  min-height: 120px;
}
.reference-section {
  margin-top: 32px;
}
.endpoint-table {
  min-width: 720px;
}
.endpoint-table code,
.reference-grid code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}
.method {
  color: var(--teal);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-weight: 700;
}
.reference-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.reference-grid > div {
  min-height: 180px;
  padding: 20px 20px 20px 0;
  border-right: 1px solid var(--line);
}
.reference-grid > div + div {
  padding-left: 20px;
}
.reference-grid > div:last-child {
  border-right: 0;
}
.reference-grid p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}
.reference-grid dl {
  margin: 12px 0 0;
}
.reference-grid dl > div {
  margin-bottom: 10px;
}
.reference-grid dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
}
.reference-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1050px) {
  .docs-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 22px;
  }
  .reference-grid {
    grid-template-columns: 1fr;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .mini-code pre {
    min-height: auto;
  }
  .reference-grid > div,
  .reference-grid > div + div {
    min-height: auto;
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .rail {
    height: 72px;
    padding: 7px 8px;
    overflow-x: auto;
  }
  .rail nav {
    min-width: 560px;
    grid-template-columns: repeat(7, minmax(72px, 1fr));
  }
  main {
    padding-bottom: 98px;
  }
  .integration-strip,
  .endpoint-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .integration-strip button,
  .endpoint-bar button {
    width: 100%;
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-config {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
  .docs-config h2,
  .docs-config > small,
  .scope-summary {
    grid-column: 1 / -1;
  }
  .code-panel pre {
    min-height: 260px;
  }
}
