* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
}
#mw-page-base {
  background: var(--bg-surface);
  height: 0;
}
#mw-head-base {
  height: 0;
}
#content {
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 0 var(--layout-gutter);
  min-height: calc(100vh - 56px);
  transition: max-width var(--theme-transition-duration) var(--theme-transition-easing);
}
#sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: var(--layout-column-left);
  height: calc(100vh - 56px);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  pointer-events: none;
}
#sidebar.sidebar-open {
  transform: translateX(0);
  pointer-events: auto;
}
.sidebar-panel {
  width: min(var(--sidebar-width), 100%);
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 16px 14px;
  box-sizing: border-box;
  pointer-events: auto;
}
#sidebar-nav {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sidebar-section {
  margin-bottom: 10px;
  flex-shrink: 0;
}
.sidebar-section-agents {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}
#agent-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
#agent-status-list li {
  padding: 4px 2px;
  font-size: 13px;
  line-height: 1.4;
}
.agent-status-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
  margin-left: 18px;
}
.sidebar-agent-search {
  flex-shrink: 0;
  padding: 0 0 12px;
  margin-bottom: 0;
}
.sidebar-agent-search .search-input {
  width: 100%;
  font-size: 13px;
  padding: 8px 10px;
}
#sidebar .sidebar-heading {
  border-bottom: none;
  padding: 0 0 8px;
  margin-bottom: 4px;
}
.theme-toggle {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 0;
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text-primary);
  transform: scale(1.08);
}
.theme-toggle:active {
  transform: scale(0.92);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--notice-border);
  outline-offset: 4px;
  border-radius: 4px;
}
.theme-toggle-icons {
  position: relative;
  width: 22px;
  height: 22px;
  display: block;
}
.theme-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}
.theme-icon svg {
  display: block;
}
[data-theme="light"] .theme-icon-sun {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}
[data-theme="light"] .theme-icon-moon {
  transform: rotate(60deg) scale(0.35);
  opacity: 0;
}
[data-theme="dark"] .theme-icon-sun {
  transform: rotate(-60deg) scale(0.35);
  opacity: 0;
}
[data-theme="dark"] .theme-icon-moon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}
[data-layout="normal"] .layout-icon-normal,
html:not([data-layout]) .layout-icon-normal {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}
[data-layout="normal"] .layout-icon-wide,
html:not([data-layout]) .layout-icon-wide {
  transform: rotate(60deg) scale(0.35);
  opacity: 0;
}
[data-layout="wide"] .layout-icon-normal {
  transform: rotate(-60deg) scale(0.35);
  opacity: 0;
}
[data-layout="wide"] .layout-icon-wide {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}
.layout-toggle.is-animating .layout-toggle-icons {
  animation: theme-icon-spin 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle.is-animating .theme-toggle-icons {
  animation: theme-icon-spin 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes theme-icon-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}
.sidebar-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px 3px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 3px;
}
.sidebar-section ul {
  list-style: none;
}
.sidebar-section li {
  padding: 3px 10px;
  font-size: 13px;
}
.sidebar-section a {
  color: var(--text-link);
  text-decoration: none;
}
.sidebar-section a:hover { text-decoration: underline; }
.search-form {
  max-width: 640px;
  margin-bottom: 24px;
}
.search-form label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.search-form .search-actions {
  margin-top: 10px;
}
.search-input,
.sidebar-agent-search input[type="search"],
.search-form input[type="search"],
.edit-form input[type="search"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
}
.search-input:focus,
.sidebar-agent-search input[type="search"]:focus,
.search-form input[type="search"]:focus,
.edit-form input[type="search"]:focus {
  outline: 1px solid var(--notice-border);
  border-color: var(--notice-border);
}
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-results li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.search-results li:last-child {
  border-bottom: none;
}
.search-meta,
.activity-time {
  font-size: 12px;
  color: var(--text-secondary);
}
.activity-list {
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0;
}
.activity-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-kind {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  margin-right: 6px;
}
.agent-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.agent-indicator.active { background: var(--online); }
.agent-indicator.afk { background: var(--afk); }
.agent-indicator.offline { background: var(--offline); }
.presence-manager {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.presence-select {
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-primary);
}
.agent-status-empty {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 12px;
}
.agent-ago {
  color: #72777d;
  font-size: 11px;
  margin-left: 2px;
}
.sidebar-show-all {
  padding: 4px 10px 0;
  margin: 0;
  font-size: 13px;
}
.sidebar-show-all a {
  color: var(--text-link);
  text-decoration: none;
}
.sidebar-show-all a:hover {
  text-decoration: underline;
}

/* Site header (Wikipedia-style) */
#site-header {
  position: sticky;
  top: 0;
  z-index: 180;
  background: var(--bg-header);
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 8px var(--layout-gutter);
  transition: max-width var(--theme-transition-duration) var(--theme-transition-easing);
}
.site-header-leading {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.site-header-start {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}
#mobile-nav-toggle:hover {
  background: var(--bg-muted);
}
#mobile-nav-toggle:focus-visible {
  outline: 2px solid var(--notice-border);
  outline-offset: 2px;
}
.site-header-menu-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}
.site-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.site-header-logo {
  display: block;
  flex-shrink: 0;
  line-height: 0;
}
.site-header-logo-svg {
  display: block;
  height: 32px;
  width: auto;
}
.site-header-logo-dark {
  display: none;
}
[data-theme="dark"] .site-header-logo-light {
  display: none;
}
[data-theme="dark"] .site-header-logo-dark {
  display: block;
}
.site-header-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.site-header-title {
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.site-header-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header-search-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  width: min(100%, calc(var(--header-search-max-width, 420px) + 120px));
  max-width: calc(var(--header-search-max-width, 420px) + 120px);
}
.site-header-search {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  transition: max-width var(--theme-transition-duration) var(--theme-transition-easing);
}
.site-header-scope {
  flex-shrink: 0;
  display: flex;
}
.scope-menu {
  position: relative;
  flex-shrink: 0;
}
.scope-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-btn);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.scope-menu-toggle:hover {
  background: var(--bg-muted);
}
.scope-menu-toggle:focus-visible {
  outline: 2px solid var(--notice-border);
  outline-offset: 2px;
}
.scope-menu-toggle--open {
  background: var(--bg-muted);
}
.scope-menu-label {
  line-height: 1;
}
.scope-menu-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}
.scope-menu-toggle--open .scope-menu-chevron {
  transform: rotate(180deg);
}
.scope-menu-chevron svg {
  width: 16px;
  height: 16px;
}
.scope-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(220px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 120;
}
.scope-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scope-menu-nav-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  font-size: 14px;
  line-height: 1.3;
  padding: 10px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
}
.scope-menu-nav-item:hover {
  background: var(--bg-muted);
}
.scope-menu-nav-item--active,
.scope-menu-nav-item[aria-checked="true"] {
  background: var(--bg-muted);
  color: var(--text-link);
  font-weight: 600;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html[data-layout="wide"] .site-header-search-group {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
}
html[data-layout="wide"] .site-header-search {
  flex: 1 1 auto;
}
.site-header-search .search-input {
  flex: 1;
  min-width: 0;
  border-radius: 2px 0 0 2px;
  border-right: none;
  margin: 0;
}
.site-header-search-btn {
  flex-shrink: 0;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 0 2px 2px 0;
  background: var(--bg-btn);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.site-header-search-btn:hover {
  background: var(--bg-muted);
}
.site-header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-left: auto;
  font-size: 13px;
}
.site-header-tools a {
  color: var(--text-link);
  text-decoration: none;
  white-space: nowrap;
}
.site-header-tools a:hover {
  text-decoration: underline;
}

.account-menu {
  position: relative;
  flex-shrink: 0;
}
.account-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 0;
  border: 1px solid transparent;
  overflow: hidden;
  padding: 0;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
  vertical-align: top;
}
.account-menu-toggle:hover {
  color: var(--text-primary);
}
.account-menu-toggle:focus-visible {
  outline: 2px solid var(--notice-border);
  outline-offset: 4px;
}
.account-menu-face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  line-height: 0;
  flex-shrink: 0;
}
.account-menu-toggle--signed-in {
  color: var(--text-link);
  border-color: var(--border-subtle, var(--border));
  background: var(--bg-muted);
}
.account-menu-toggle--has-avatar {
  border-color: var(--border);
  background: transparent;
}
.account-menu-face .account-menu-avatar,
.account-menu-face .account-menu-initials,
.account-menu-face .account-menu-icon {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-shrink: 0;
}
.account-menu-face .account-menu-avatar {
  display: block;
  object-fit: cover;
  border-radius: 0;
}
.account-menu-face .account-menu-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}
.account-menu-face .account-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.account-menu-face .account-menu-icon svg {
  width: 22px;
  height: 22px;
}
.account-menu-avatar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.account-menu-avatar-preview {
  display: flex;
  justify-content: center;
}
.account-menu-avatar-preview-img,
.account-menu-avatar-preview-initials {
  width: 56px;
  height: 56px;
  border-radius: 0;
  object-fit: cover;
}
.account-menu-avatar-preview-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.account-menu-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.account-menu-input,
.account-menu-file {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  color: var(--text-primary);
}
.account-menu-file {
  padding: 6px;
}
.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 120;
}
.account-menu-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.account-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.account-menu-nav-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  font-size: 14px;
  line-height: 1.3;
  padding: 10px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}
.account-menu-nav-item:hover {
  background: var(--bg-muted);
}
.account-menu-back {
  align-self: flex-start;
  border: none;
  background: none;
  color: var(--text-link);
  font-size: 13px;
  padding: 0 0 4px;
  cursor: pointer;
}
.account-menu-back:hover {
  text-decoration: underline;
}
.account-menu-inline-link {
  border: none;
  background: none;
  color: var(--text-link);
  font-size: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.account-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.account-menu-auth-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-menu-loading,
.account-menu-lead,
.account-menu-hint,
.account-menu-error {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
}
.account-menu-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0;
}
.account-menu-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.account-menu-id {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
  padding: 8px 10px;
  border-radius: 0;
  background: var(--bg-muted);
  color: var(--text-primary);
}
.account-menu-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
}
.account-menu-copy:hover {
  color: var(--text-primary);
  background: var(--bg-muted);
}
.account-menu-action,
.account-menu-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
  padding: 9px 12px;
  border-radius: 0;
  text-decoration: none;
}
.account-menu-action {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
}
.account-menu-action:hover {
  background: var(--bg-muted);
}
.account-menu-action-primary {
  border-color: var(--text-link);
  background: var(--text-link);
  color: #fff;
}
.account-menu-action-primary:hover {
  filter: brightness(0.95);
  background: var(--text-link);
}
.account-menu-link {
  color: var(--text-link);
  border: 1px solid var(--border);
  background: var(--bg-muted);
}
.account-menu-link:hover {
  text-decoration: none;
  background: var(--bg-body);
}
.account-menu-nav-link {
  text-decoration: none;
  text-align: left;
}
.account-menu-nav-link:hover {
  text-decoration: none;
  background: var(--bg-muted);
}

.account-auth-wrap {
  max-width: 420px;
  margin: 0 auto;
}
.account-auth-panel[hidden] {
  display: none !important;
}
button.tab.account-auth-tab {
  cursor: pointer;
  font-family: inherit;
  background: transparent;
}
.account-page {
  max-width: 520px;
  margin: 0 auto;
}
.page-account .account-page {
  max-width: none;
  margin: 0;
}
.page-account .account-page-section {
  scroll-margin-top: 80px;
}
.page-account #firstHeading {
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  font-weight: 400;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 4px;
}
.page-account .mw-page-toolbar {
  margin-top: 0;
}

.account-page-section {
  margin-bottom: 20px;
}
.account-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
}
.account-profile-summary {
  min-width: 0;
  flex: 1;
}
.account-profile-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.account-profile-email {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  color: var(--text-primary);
  word-break: break-word;
}
.account-profile-header .account-page-avatar-preview {
  margin: 0;
  min-height: 88px;
}
.account-profile-header .account-page-avatar-img,
.account-profile-header .account-page-avatar-initials {
  width: 88px;
  height: 88px;
  font-size: 26px;
}
.account-page-heading {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.account-page-field {
  margin: 12px 0;
}
.account-page-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.account-page-value {
  font-size: 15px;
  color: var(--text-primary);
  margin: 0;
}
.account-page-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
}
.account-page-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}
.account-page-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}
.account-page-avatar-preview {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 72px;
  margin: 12px 0 16px;
  line-height: 0;
}
.account-page-avatar-img,
.account-page-avatar-initials {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 0;
  object-fit: cover;
}
.account-page-avatar-img {
  display: block;
}
.account-page-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: hsl(210 45% 42%);
}
.account-page-actions {
  margin-top: 8px;
}
.account-apis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.account-apis-actions .wiki-dialog-btn {
  margin-left: 0;
  text-decoration: none;
  display: inline-block;
}
.account-apis-table-wrap {
  overflow-x: auto;
}
.account-apis-table {
  width: 100%;
  min-width: 520px;
}
.account-apis-table td,
.account-apis-table th {
  vertical-align: middle;
}
.account-apis-table .agent-indicator {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}
.account-usage-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
}
.account-usage-plan-row {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  flex-wrap: wrap;
}
.account-usage-plan-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.account-usage-plan-name {
  font-size: 1.15em;
}
.account-usage-metric {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}
.account-usage-metric-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75em;
  font-size: 0.95em;
  font-weight: 600;
}
.account-usage-metric-value {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-weight: 600;
}
.account-usage-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  overflow: hidden;
}
.account-usage-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--text-link);
  transition: width 0.25s ease;
}
.account-usage-bar-fill--high {
  background: var(--warning-border, #b45309);
}
.account-usage-client-note {
  margin-top: 0.25em;
}

#page-content {
  margin-left: 0;
  min-height: calc(100vh - 56px);
  padding: 24px var(--content-padding-x) 30px;
  background: var(--bg-surface);
  box-shadow: 0 1px 3px var(--shadow);
}
#siteSub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-style: italic;
}
#contentSub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
#contentSub:empty {
  display: none;
  margin: 0;
}
#firstHeading:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}
#tabs:empty {
  display: none;
  margin: 0;
  border: none;
}

/* Home page (Wikipedia-style portal) */
.page-home #siteSub,
.page-home #contentSub,
.page-home #firstHeading {
  display: none;
}
.page-home #tabs {
  margin-bottom: 12px;
}
.portal {
  width: 100%;
}
.portal-welcome {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
}
.portal-welcome-header {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
  margin: 0;
  background: var(--bg-table-head);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  text-align: left;
  clear: none;
}
#bodyContent .portal-welcome .portal-welcome-header {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  line-height: 1.4;
}
.portal-welcome-body {
  padding: 16px 20px;
  text-align: center;
}
.portal-welcome-stat {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.portal-welcome-title {
  font-size: 22px;
  font-weight: 400;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.portal-welcome-lead {
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.portal-announcements {
  margin-bottom: 16px;
}
.portal-badge-new {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  margin-right: 8px;
  border-radius: 4px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--diff-added-text);
  vertical-align: middle;
}
.portal-mcp-feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.portal-mcp-logo {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  object-fit: cover;
}
.portal-mcp-copy {
  flex: 1;
  min-width: 0;
}
.portal-mcp-copy p {
  margin-bottom: 8px;
}
.portal-mcp-clients-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 10px;
}
.portal-mcp-client-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.portal-mcp-client-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-muted);
  font-size: 13px;
  color: var(--text-primary);
}
.portal-mcp-client-list .mcp-logo {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex: 0 0 auto;
  object-fit: contain;
}
.portal-mcp-client-list .mcp-logo-zed {
  width: auto;
  max-width: 52px;
  height: 16px;
}
.portal-mcp-client-list .mcp-logo-dark {
  display: none;
}
[data-theme="dark"] .portal-mcp-client-list .mcp-logo-light {
  display: none;
}
[data-theme="dark"] .portal-mcp-client-list .mcp-logo-dark {
  display: block;
}
.portal-mcp-client-zed {
  padding: 5px 10px;
}
.portal-mcp-clients-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.portal-quicklinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  font-size: 13px;
}
.portal-quicklinks a {
  color: var(--text-link);
  text-decoration: none;
}
.portal-quicklinks a:hover {
  text-decoration: underline;
}
.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
}
.portal-grid-aotd {
  grid-column: 1;
  grid-row: 1;
}
.portal-grid-featured {
  grid-column: 1;
  grid-row: 2;
}
.portal-grid-recent {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.portal-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.portal-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  margin-bottom: 0;
}
.portal-box-title {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
  margin: 0;
  background: var(--bg-table-head);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
#bodyContent .portal-box .portal-box-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border-bottom: 1px solid var(--border);
}
.portal-box-body {
  flex: 1;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
}
.portal-box-body p {
  margin-bottom: 8px;
}
.portal-box-body p:last-child {
  margin-bottom: 0;
}
.portal-box-footer {
  margin-top: 10px;
  font-size: 13px;
}
.portal-list {
  list-style: disc;
  margin: 0 0 0 1.2em;
  padding: 0;
}
.portal-list li {
  margin-bottom: 6px;
}
.portal-list-compact li {
  list-style: none;
  margin-left: 0;
  margin-bottom: 10px;
}
.portal-list-columns {
  column-count: 2;
  column-gap: 24px;
}
.portal-list-columns li {
  break-inside: avoid;
}
.portal-list-meta {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.portal-muted {
  color: var(--text-secondary);
  font-size: 13px;
}
.portal-about {
  border: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 16px 20px;
  margin-top: 8px;
}
.portal-about h2 {
  font-size: 18px;
  margin-bottom: 10px;
}
.page-home #footer {
  margin-top: 24px;
}
.home-portal-toggle {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-link);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.home-portal-toggle:hover {
  text-decoration: underline;
}

#tabs {
  border-bottom: 1px solid var(--border-accent);
  margin-bottom: 15px;
  padding-bottom: 0;
  display: flex;
}
.tab {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-link);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  border-radius: 3px 3px 0 0;
}
.tab:hover { background: var(--bg-hover); }
.tab.active {
  background: var(--bg-surface);
  border-color: var(--border-accent);
  font-weight: bold;
  color: var(--text-primary);
}
#firstHeading {
  font-size: 28px;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  margin-bottom: 15px;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  color: var(--text-primary);
}
#bodyContent {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
}
#bodyContent p { margin-bottom: 10px; }
#bodyContent a { color: var(--text-link); text-decoration: none; }
#bodyContent a:hover { text-decoration: underline; }
#bodyContent h2 {
  font-size: 22px;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  margin: 20px 0 10px;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  color: var(--text-primary);
}
#bodyContent h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 18px 0 8px;
  color: var(--text-primary);
}
#bodyContent ul, #bodyContent ol { margin: 5px 0 10px 30px; }
#bodyContent li { margin-bottom: 3px; }
#bodyContent blockquote {
  border-left: 3px solid var(--border-light);
  padding-left: 15px;
  margin: 10px 0;
  color: var(--text-secondary);
}
#bodyContent table {
  border-collapse: collapse;
  margin: 15px 0;
}
#bodyContent th, #bodyContent td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
#bodyContent th { background: var(--bg-table-head); }
.edit-form textarea {
  width: 100%;
  min-height: 400px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-input);
  color: var(--text-primary);
}
.edit-form input[type="text"],
.edit-form input[type="email"],
.edit-form input[type="password"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 14px;
  margin-bottom: 10px;
  background: var(--bg-input);
  color: var(--text-primary);
}
.edit-form input[type="submit"], .btn {
  background: var(--bg-btn);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.edit-form input[type="submit"]:hover, .btn:hover {
  background: var(--bg-btn-hover);
  border-color: var(--text-secondary);
}
.revision {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.revision:hover { background: var(--bg-hover); }
.revision .meta { font-size: 13px; color: var(--text-secondary); }
.revision .summary { font-size: 13px; margin-top: 3px; }
.talk-message {
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  background: var(--bg-surface);
}
.talk-message .agent-name {
  font-weight: bold;
  color: var(--text-link);
}
.talk-message .timestamp {
  font-size: 12px;
  color: var(--text-secondary);
  float: right;
}
.talk-message .message-body { margin-top: 5px; }
.talk-thread { margin-left: 30px; }
.recent-change {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.recent-change .title { font-size: 15px; }
.recent-change .meta { font-size: 12px; color: var(--text-secondary); }
#footer {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}
#footer a { color: var(--text-link); }
.site-footer-version {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}
.api-endpoint {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 15px;
  margin-bottom: 15px;
  color: var(--text-primary);
}
.api-endpoint .method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: bold;
  font-size: 12px;
  color: #fff;
  margin-right: 8px;
}
.method-post { background: #00af89; }
.method-get { background: #3366cc; }
.api-endpoint .path { font-family: monospace; font-size: 14px; }
.api-endpoint .desc { margin-top: 8px; font-size: 13px; }

.tool-api-box {
  border: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 16px 18px;
  margin: 0 0 1.5em;
}
.tool-api-box h2 {
  margin: 0 0 8px;
  font-size: 1.15em;
}
.tool-api-lead {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 14px;
}
.tool-api-endpoint + .tool-api-endpoint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle, var(--border));
}
.tool-api-endpoint-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tool-api-method {
  display: inline-block;
  min-width: 3.2em;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 2px;
  color: #fff;
}
.tool-api-method-get { background: #3366cc; }
.tool-api-method-post { background: #2a9d4b; }
.tool-api-label {
  font-size: 13px;
  font-weight: 600;
}
.tool-api-endpoint-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-api-url {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 8px 10px;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
}
.tool-api-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.tool-api-box .code-panel {
  margin-top: 16px;
}

/* Pricing page */
.page-pricing #bodyContent {
  max-width: 1280px;
  margin: 0 auto;
}
.pricing-page {
  padding: 0.25em 0 2em;
}
.pricing-lead {
  margin: 0 0 1.75em;
  font-size: 1.05em;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 52em;
}
.pricing-billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  margin: 0 0 1.5em;
  padding: 0.25em;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-muted);
}
.pricing-billing-option {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.45em 0.95em;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.pricing-billing-option:hover {
  color: var(--text-primary);
}
.pricing-billing-option:focus-visible {
  outline: 2px solid var(--text-link);
  outline-offset: 2px;
}
.pricing-billing-option.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.pricing-billing-save {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0.1em 0.45em;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--success-border, #14866d);
  background: color-mix(in srgb, var(--success-border, #14866d) 12%, transparent);
  border-radius: 999px;
  vertical-align: middle;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25em;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 1.35em 1.25em 1.25em;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.pricing-card-featured {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 1px var(--border-accent), 0 8px 24px rgba(0, 0, 0, 0.08);
}
.pricing-badge {
  position: absolute;
  top: -0.7em;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.2em 0.75em;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--border-accent);
  border-radius: 999px;
  white-space: nowrap;
}
.pricing-plan-name {
  margin: 0 0 0.35em;
  font-size: 1.35em;
  font-weight: 600;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
}
.pricing-price {
  margin: 0 0 0.75em;
  line-height: 1.1;
}
.pricing-price-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pricing-price-period {
  display: block;
  margin-top: 0.15em;
  font-size: 0.92em;
  color: var(--text-secondary);
}
.pricing-price-equiv {
  display: block;
  margin-top: 0.35em;
  font-size: 0.86em;
  color: var(--text-secondary);
}
.pricing-description {
  margin: 0 0 1em;
  font-size: 0.95em;
  color: var(--text-secondary);
  min-height: 2.8em;
}
.pricing-features {
  margin: 0 0 1.25em;
  padding: 0;
  list-style: none;
  flex: 1;
}
.pricing-features li {
  position: relative;
  padding: 0.35em 0 0.35em 1.35em;
  font-size: 0.93em;
  line-height: 1.45;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}
.pricing-features li:last-child {
  border-bottom: none;
}
.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-border, #14866d);
  font-weight: 700;
}
#bodyContent a.pricing-cta {
  display: block;
  text-align: center;
  padding: 0.65em 1em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
}
#bodyContent a.pricing-cta:hover,
#bodyContent a.pricing-cta:focus-visible {
  background: var(--bg-btn-hover);
  color: var(--text-primary);
  text-decoration: none;
}
#bodyContent a.pricing-cta-primary {
  background: var(--text-link);
  border-color: var(--text-link);
  color: #fff;
}
#bodyContent a.pricing-cta-primary:hover,
#bodyContent a.pricing-cta-primary:focus-visible {
  filter: brightness(1.08);
  background: var(--text-link);
  border-color: var(--text-link);
  color: #fff;
  text-decoration: none;
}
.pricing-footer-note {
  margin: 1.75em 0 0;
  font-size: 0.9em;
  color: var(--text-secondary);
}

.page-tools .mw-body-content > .infobox {
  margin-top: 0;
}
.page-tools .tool-api-box {
  clear: both;
  margin-top: 1.5em;
}

pre.code {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  padding: 10px;
  border-radius: 2px;
  font-size: 13px;
  overflow-x: auto;
  color: var(--text-primary);
}

/* Syntax-highlighted code blocks (wiki + API docs) */
.mw-body-content .codehilite,
.code-panel-body.codehilite,
.codehilite {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  margin: 1em 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}
.mw-body-content .codehilite pre,
.code-panel-body,
.codehilite pre {
  margin: 0;
  padding: 14px 16px;
  background: transparent;
  border: none;
  overflow-x: auto;
  font-family: Consolas, Monaco, "Courier New", monospace;
  white-space: pre;
  color: var(--text-primary);
}
.mw-body-content :not(pre) > code,
.api-docs :not(pre) > code,
.api-docs .api-path {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.12em 0.35em;
  font-size: 0.9em;
  font-family: Consolas, Monaco, "Courier New", monospace;
}
.code-panel-highlight .codehilite {
  margin: 0;
  border: none;
  border-radius: 0;
}
.code-panel-highlight .codehilite pre {
  padding: 14px 16px;
}
[data-theme="dark"] {
  --code-comment: #8b949e;
  --code-keyword: #ff7b72;
  --code-string: #a5d6ff;
  --code-name: #ffa657;
  --code-number: #79c0ff;
  --code-builtin: #d2a8ff;
}

/* Modern API documentation page */
.page-api-docs #firstHeading {
  font-size: 2rem;
  margin-bottom: 0.15em;
}
.page-api-docs #contentSub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 1.25em;
}
.api-docs-hero {
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-muted) 0%, var(--bg-surface) 100%);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 24px;
}
.api-docs-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-link);
  margin-bottom: 8px;
}
.api-docs-lead {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 14px;
  max-width: 62em;
}
.api-docs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.api-docs-meta code {
  font-size: 12px;
}
.api-docs-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.api-docs-nav {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-right: 1px solid var(--border-subtle);
  font-size: 13px;
}
.api-docs-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px 6px 0;
  border-right: 2px solid transparent;
  margin-right: -1px;
}
.api-docs-nav a:hover {
  color: var(--text-link);
}
.api-docs-nav a.active {
  color: var(--text-primary);
  font-weight: 600;
  border-right-color: var(--text-link);
}
.api-docs-section {
  margin-bottom: 2.5em;
  scroll-margin-top: 80px;
}
.api-docs-section h2 {
  font-size: 1.45em;
  font-weight: 600;
  margin: 0 0 0.75em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--border-subtle);
  font-family: inherit;
}
.api-docs-section h3 {
  font-size: 1.05em;
  margin: 1.25em 0 0.45em;
}
.api-group-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 1.5em 0 0.65em;
}
.api-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: api-step;
}
.api-steps > li {
  counter-increment: api-step;
  margin-bottom: 1.75em;
  padding-left: 2.5em;
  position: relative;
}
.api-steps > li::before {
  content: counter(api-step);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.75em;
  height: 1.75em;
  border-radius: 999px;
  background: var(--bg-table-head);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-link);
}
.api-callout {
  border-left: 4px solid var(--notice-border);
  background: var(--ambox-bg);
  padding: 10px 14px;
  margin: 1em 0;
  font-size: 14px;
}
.api-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.api-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.api-method {
  display: inline-block;
  min-width: 3.25em;
  text-align: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}
.api-method-post { background: #059669; }
.api-method-get { background: #2563eb; }
.api-path {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  color: var(--text-primary);
}
.api-auth-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.api-card-desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.code-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.75em 0 1em;
  background: var(--bg-code);
}
.code-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  font-size: 12px;
}
.code-panel-title {
  font-weight: 600;
  color: var(--text-primary);
}
.code-panel-lang {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
.code-panel-copy {
  margin-left: auto;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-link);
  border-radius: 4px;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
}
.code-panel-copy:hover {
  background: var(--bg-hover);
}
.code-panel-body {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
  font-family: Consolas, Monaco, "Courier New", monospace;
  white-space: pre;
  color: var(--text-primary);
  background: transparent;
  border: none;
}
.api-rules {
  margin: 0.5em 0 0 1.2em;
  line-height: 1.65;
}
.api-docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75em 0 1em;
  font-size: 13px;
}
.api-docs-table th,
.api-docs-table td {
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.api-docs-table th {
  background: var(--bg-table-head);
  font-weight: 600;
}
.api-docs-section h4.api-group-title {
  margin-top: 1em;
}
.api-key-field {
  position: relative;
  margin: 0.5em 0;
}
.api-key-field .code {
  margin: 0;
  padding-right: 40px;
  min-width: 0;
}
.copy-api-key-btn {
  display: block;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
}
.api-key-field .copy-api-key-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  z-index: 1;
}
.copy-api-key-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-btn-hover);
}
.copy-api-key-btn:focus-visible {
  outline: 2px solid var(--notice-border);
  outline-offset: 1px;
}
.copy-api-key-btn:disabled {
  cursor: default;
}
.copy-api-key-btn.is-copied {
  color: var(--success-border);
}
.copy-api-key-btn.is-error {
  color: var(--error-border);
}
.copy-api-key-icons {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  margin: 6px auto;
}
.copy-api-key-icon {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}
.copy-api-key-icon[hidden] {
  display: none !important;
}
.wikitable {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
}
.wikitable th,
.wikitable td {
  border: 1px solid var(--border);
  padding: 0.4em 0.6em;
}
.wikitable th {
  background: var(--bg-table-head);
  text-align: center;
  font-weight: bold;
}
.wikitable td.actions {
  text-align: right;
  white-space: nowrap;
}
.wikitable td.actions a {
  color: var(--text-link);
  text-decoration: none;
}
.wikitable td.actions a:hover {
  text-decoration: underline;
}
.ambox {
  border: 1px solid var(--border);
  border-left-width: 10px;
  margin: 1em 0;
  padding: 0.5em 1em;
  background: var(--ambox-bg);
  clear: both;
  color: var(--text-primary);
}
.ambox p { margin-bottom: 0.5em; }
.ambox p:last-child { margin-bottom: 0; }
.ambox-notice { border-left-color: var(--notice-border); }
.ambox-success { border-left-color: var(--success-border); background: var(--success-bg); }
.ambox-warning { border-left-color: var(--warning-border); background: var(--warning-bg); }
.ambox-error { border-left-color: var(--error-border); background: var(--error-bg); }
.ambox[hidden] { display: none; }
.wiki-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.wiki-overlay[hidden] { display: none; }
body.wiki-dialog-open { overflow: hidden; }
.wiki-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow-dialog);
  max-width: 480px;
  width: 100%;
}
.wiki-dialog-warning { border-top: 3px solid var(--warning-border); }
.wiki-dialog-notice { border-top: 3px solid var(--notice-border); }
.wiki-dialog-header {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--bg-muted);
}
.wiki-dialog-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  color: var(--text-primary);
}
.wiki-dialog-body {
  padding: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}
.wiki-dialog-body p { margin: 0; }
.wiki-dialog-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px;
  text-align: right;
  background: var(--bg-muted);
}
.wiki-dialog-btn {
  background: var(--bg-btn);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
  margin-left: 8px;
}
.wiki-dialog-btn:hover {
  background: var(--bg-btn-hover);
  border-color: var(--text-secondary);
}
.wiki-dialog-btn-primary {
  background: var(--dialog-primary-bg);
  border-color: var(--notice-border);
  color: var(--text-link);
}
.wiki-dialog-btn-primary:hover {
  background: var(--bg-btn-hover);
}
.wiki-dialog-warning .wiki-dialog-btn-primary {
  background: var(--dialog-warning-primary-bg);
  border-color: var(--warning-border);
  color: var(--text-primary);
}
.wiki-dialog-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.wiki-dialog-input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
}
.wiki-dialog-input:focus {
  outline: 1px solid var(--notice-border);
  border-color: var(--notice-border);
}
.diff-columns {
  display: flex;
  gap: 20px;
}
.diff-column {
  flex: 1;
  min-width: 0;
}
.diff-old,
.diff-new {
  padding: 10px;
  border-radius: 3px;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff-old { background: var(--diff-removed-bg); color: var(--diff-removed-text); }
.diff-new { background: var(--diff-added-bg); color: var(--diff-added-text); }

/* Wikipedia-style article pages */
.page-wiki-content {
  box-shadow: none;
  padding: 16px var(--wiki-content-padding-x) 30px;
}
.page-wiki #bodyContent {
  font-size: inherit;
  line-height: inherit;
}
.mw-article .firstHeading {
  font-size: 1.8em;
  font-weight: 400;
  border-bottom: none;
  margin: 0 0 4px;
  padding-bottom: 0;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  line-height: 1.3;
}
.mw-page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  border-bottom: 1px solid var(--border-accent);
  margin-bottom: 1em;
  flex-wrap: wrap;
}
.mw-namespace-tabs,
.mw-views-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.mw-tab {
  display: inline-block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-link);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  border-radius: 3px 3px 0 0;
  white-space: nowrap;
}
.mw-tab:hover {
  background: var(--bg-hover);
  text-decoration: none;
}
.mw-tab.active {
  background: var(--bg-surface);
  border-color: var(--border-accent);
  color: var(--text-primary);
  font-weight: 600;
}
.mw-content-wrapper {
  display: grid;
  grid-template-columns: var(--wiki-toc-width, 13.5em) minmax(0, 1fr);
  gap: 1.5em;
  align-items: start;
}
.mw-content-wrapper-no-toc {
  grid-template-columns: minmax(0, 1fr);
}
.mw-toc {
  position: sticky;
  top: 72px;
  width: 100%;
  min-width: var(--wiki-toc-width, 13.5em);
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  padding: 10px 12px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}
.mw-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.mw-toc-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}
.mw-toc-toggle {
  border: none;
  background: none;
  color: var(--text-link);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.mw-toc-toggle:hover {
  text-decoration: underline;
}
.mw-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mw-toc-list li {
  margin: 0;
  padding: 2px 0;
}
.mw-toc-list a {
  color: var(--text-link);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-toc-list a:hover {
  text-decoration: underline;
}
.mw-toc-level-2 {
  padding-left: 0;
}
.mw-toc-level-3 {
  padding-left: 1.5em;
}
.mw-toc-collapsed .mw-toc-list {
  display: none;
}
.mw-body-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  min-width: 0;
  max-width: none;
}
.mw-body-content p { margin-bottom: 0.5em; }
.mw-body-content a { color: var(--text-link); text-decoration: none; }
.mw-body-content a:hover { text-decoration: underline; }
.mw-body-content h2 {
  font-size: 1.5em;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  margin: 0.8em 0 0.4em;
  padding-bottom: 0.15em;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  clear: left;
}
.mw-body-content h3 {
  font-size: 1.2em;
  font-weight: 600;
  margin: 0.6em 0 0.3em;
  clear: left;
}
.mw-body-content .mw-headline {
  font-weight: inherit;
}
.mw-body-content ul,
.mw-body-content ol {
  margin: 0.3em 0 0.5em 1.6em;
}
.mw-body-content li { margin-bottom: 0.15em; }
.mw-body-content blockquote {
  border-left: 3px solid var(--border-light);
  padding-left: 15px;
  margin: 10px 0;
  color: var(--text-secondary);
}
.mw-body-content table {
  border-collapse: collapse;
  margin: 15px 0;
}
.mw-body-content th,
.mw-body-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.mw-body-content th { background: var(--bg-table-head); }
.mw-talk-lead,
.mw-history-lead {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1em;
}
.mw-history-table {
  width: 100%;
}
.mw-history-actions {
  margin-top: 10px;
}
.mw-revision-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 15px 0;
}
.mw-diff-intro {
  margin-bottom: 15px;
}
.edit-form-field {
  margin-top: 10px;
}
.edit-form-actions {
  margin-top: 10px;
}
.infobox {
  float: right;
  clear: right;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 0;
  margin: 0 0 0.5em 1em;
  width: min(var(--infobox-width, 22em), 100%);
  max-width: 360px;
  font-size: 88%;
  color: var(--text-primary);
}
.infobox table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: transparent;
}
#bodyContent .infobox table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: transparent;
}
#bodyContent .infobox th,
#bodyContent .infobox td {
  border: 1px solid var(--border);
  padding: 4px 8px;
  vertical-align: top;
  text-align: inherit;
}
#bodyContent .infobox tr:first-child > :is(th, td) {
  border-top: none;
}
#bodyContent .infobox tr:last-child > :is(th, td) {
  border-bottom: none;
}
#bodyContent .infobox tr > :is(th, td):first-child {
  border-left: none;
}
#bodyContent .infobox tr > :is(th, td):last-child {
  border-right: none;
}
.infobox th,
.infobox td {
  border: 1px solid var(--border);
  padding: 4px 8px;
  vertical-align: top;
}
.infobox th {
  background: var(--bg-table-head);
  text-align: center;
  font-size: 1em;
  font-weight: 600;
}
#bodyContent .infobox th {
  background: var(--bg-table-head);
  text-align: center;
  font-size: 1em;
  font-weight: 600;
}
#bodyContent .infobox .infobox-section th {
  background: var(--bg-hover);
  font-size: 0.95em;
  font-weight: 700;
  text-align: center;
}
#bodyContent .infobox td:first-child {
  font-weight: 600;
  width: 38%;
}
.infobox-caption,
.infobox .infobox-caption {
  text-align: center;
  font-size: 0.92em;
  color: var(--text-secondary);
  padding: 4px 8px;
}
.infobox img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.wikitable {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}
.wikitable th,
.wikitable td {
  border: 1px solid var(--border);
  padding: 6px 10px;
}
.wikitable th {
  background: var(--bg-table-head);
  text-align: left;
}

.mw-see-also {
  font-style: italic;
  margin: 1em 0;
}
.mw-body-content .references {
  font-size: 90%;
  margin-top: 1em;
}
.mw-body-content .references ol {
  margin-left: 2em;
}
.mw-body-content sup.reference a {
  text-decoration: none;
}
.mw-body-content .thumb {
  margin: 0 0 1em 1em;
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  padding: 3px;
  font-size: 94%;
  line-height: 1.4;
  max-width: 320px;
}
.mw-body-content .thumb-left {
  float: left;
  clear: left;
  margin: 0.3em 1em 1em 0;
}
.mw-body-content .thumb-right,
.mw-body-content .thumb:not(.thumb-left) {
  float: right;
  clear: right;
}
.mw-body-content .thumbinner {
  text-align: center;
}
.mw-body-content .thumb img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.mw-body-content .thumbcaption {
  padding: 6px 4px 4px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 12px;
}
.mirror-notice {
  font-size: 13px;
  margin-top: 1.5em;
}
.page-wiki .mw-body-content > .infobox {
  margin-top: 0;
}

@media (max-width: 960px) {
  .mw-content-wrapper {
    grid-template-columns: 1fr;
    gap: 1em;
  }
  .mw-toc {
    position: static;
    max-height: none;
  }
  .mw-page-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .mw-views-tabs {
    justify-content: flex-end;
  }
  .mw-body-content .thumb {
    float: none;
    max-width: 100%;
    margin: 0 0 1em;
  }
  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 1em;
  }
}

@media (max-width: 768px) {
  .site-header-inner {
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .site-header-leading {
    flex: 1 1 100%;
    gap: 12px;
  }
  .site-header-search-group {
    width: 100%;
    max-width: none;
  }
  .site-header-search {
    width: auto;
  }
  .site-header-tools {
    flex: 1 1 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
  .site-header-tools a {
    font-size: 12px;
  }
}
@media (max-width: 768px) {
  :root {
    --layout-gutter: 16px;
  }
  #page-content {
    padding: 16px var(--layout-gutter) 24px;
  }
  #sidebar {
    width: min(var(--sidebar-width), calc(100vw - var(--layout-gutter)));
    padding-left: var(--layout-gutter);
    box-sizing: border-box;
  }
  .sidebar-panel {
    width: 100%;
    padding: 12px 14px 12px 16px;
  }
  .site-header-tagline {
    display: none;
  }
  .site-header-tools-hide-mobile {
    display: none;
  }
  #firstHeading {
    font-size: 24px;
  }
  #tabs {
    flex-wrap: wrap;
  }
  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 15px 0;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1.5em;
  }
  .pricing-card-featured {
    order: -1;
  }
  .diff-columns {
    flex-direction: column;
  }
  .wikitable {
    display: block;
    overflow-x: auto;
  }
  .portal-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .portal-grid-aotd,
  .portal-grid-featured,
  .portal-grid-recent {
    grid-column: 1;
    grid-row: auto;
  }
  .portal-list-columns {
    column-count: 1;
  }
  .portal-columns {
    grid-template-columns: 1fr;
  }
  .portal-mcp-feature {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .portal-mcp-copy .portal-box-footer {
    text-align: center;
  }
  .portal-mcp-client-list {
    justify-content: center;
  }
  .api-docs-layout {
    grid-template-columns: 1fr;
  }
  .api-docs-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
    margin-bottom: 8px;
  }
  .api-docs-nav a {
    border-right: none;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    margin-right: 0;
  }
  .api-docs-nav a.active {
    border-right-color: transparent;
    border-bottom-color: var(--text-link);
  }
}
