:root {
  color-scheme: light;
  --bg: #eef2ff;
  --bg-alt: linear-gradient(135deg, #eef2ff 0%, #fef3c7 100%);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: rgba(148, 163, 184, 0.35);
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b91c1c;
  --success: #0f766e;
  --warning: #b45309;
  --shadow: 0 24px 64px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-alt);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.2;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease,
    transform 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 0.95rem;
  background: rgba(255, 255, 255, 0.92);
}

textarea {
  resize: vertical;
  min-height: 8rem;
}

.page-shell {
  width: min(1480px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.topbar h1,
.panel h2 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.topbar p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.topbar-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.6rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--accent-strong);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.55);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease,
    transform 160ms ease;
}

.topbar-nav a:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 118, 110, 0.18);
  transform: translateY(-1px);
}

.topbar-nav a.active,
.topbar-nav a[aria-current="page"] {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, #4338ca 100%);
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(67, 56, 202, 0.2);
}

.content-shell {
  display: grid;
  gap: 1.25rem;
}

.panel {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.highlight-panel {
  border-color: rgba(15, 118, 110, 0.35);
}

.auth-panel {
  width: min(520px, 100%);
  margin: 4rem auto 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stats-grid,
.two-column-grid,
.tools-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.two-column-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.tools-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.help-section-stack,
.help-code-grid {
  display: grid;
  gap: 1rem;
}

.help-quick-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.help-quick-card,
.help-callout,
.help-code-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.help-quick-card {
  display: grid;
  gap: 0.35rem;
}

.help-quick-card code {
  word-break: break-all;
}

.help-callout-list,
.help-jump-list,
.help-reference-list,
.help-list,
.help-steps {
  display: grid;
  gap: 0.75rem;
}

.help-callout-list {
  margin-top: 1rem;
}

.help-callout {
  border-left: 4px solid rgba(15, 118, 110, 0.38);
}

.help-jump-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.help-jump-list a {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.help-jump-list a:hover {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(255, 255, 255, 0.92);
}

.help-section {
  scroll-margin-top: 1rem;
}

.help-section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.help-summary {
  margin: 0.5rem 0 0;
}

.help-block + .help-block {
  margin-top: 1rem;
}

.help-block h3 {
  margin: 0 0 0.75rem;
}

.help-list,
.help-steps,
.help-reference-list {
  margin: 0;
  padding-left: 1.25rem;
}

.help-list li,
.help-steps li,
.help-reference-list li {
  padding-left: 0.15rem;
}

.help-list-warning li::marker {
  color: var(--warning);
}

.help-code-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.help-code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.help-code-card pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 16px;
  background: #0f172a;
  color: #e5eef9;
}

.help-reference-list a {
  font-weight: 600;
}

.help-reference-list .cell-secondary {
  display: block;
  margin-top: 0.2rem;
}

.stat-card {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.stat-card span {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
}

.form-grid,
.filters-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-grid label,
.filters-grid label {
  display: grid;
  gap: 0.4rem;
}

.form-grid > button {
  width: auto;
  min-width: 10rem;
  justify-self: start;
  align-self: end;
}

.form-grid .form-field-full {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex !important;
  align-items: center;
  gap: 0.6rem !important;
  align-self: end;
}

.checkbox-field input {
  width: auto;
  margin: 0;
}

.checkbox-field span {
  font-size: 0.95rem;
}

.notification-form {
  align-items: start;
}

.notification-subject-field {
  grid-column: span 2;
}

.notification-subject-input {
  min-height: 3.2rem;
  font-size: 1.02rem;
}

.notification-recipient-field {
  max-width: 22rem;
}

.large-select {
  min-height: 3.2rem;
  min-width: 17rem;
}

.specific-users-fieldset[hidden] {
  display: none;
}

.specific-users-fieldset {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.65);
}

.specific-users-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

.checkbox-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checkbox-option {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.checkbox-option input {
  margin-top: 0.2rem;
}

.power-users-header {
  align-items: flex-start;
}

.power-users-metric-field {
  display: grid;
  gap: 0.4rem;
  min-width: 16rem;
}

.power-users-chart {
  display: grid;
  gap: 1rem;
}

.power-users-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.power-users-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.power-user-row {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.power-user-row-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.power-user-values {
  display: grid;
  gap: 0.12rem;
  justify-items: end;
  white-space: nowrap;
}

.power-user-value {
  font-weight: 700;
}

.power-user-share {
  color: var(--muted);
  font-size: 0.9rem;
}

.power-user-bar {
  height: 0.8rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.power-user-bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e 0%, #4338ca 100%);
}

.setup-stack {
  display: grid;
  gap: 1.5rem;
}

.setup-section {
  display: grid;
  gap: 1rem;
}

.setup-section h3 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.filters-grid > button {
  width: auto;
  min-width: 9rem;
  justify-self: start;
  align-self: end;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.compact-form {
  flex-wrap: wrap;
}

.compact-form select {
  min-width: 9.5rem;
}

.compact-button {
  padding: 0.5rem 0.9rem;
  border-radius: 14px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.button-secondary {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.button-secondary:hover {
  background: rgba(15, 118, 110, 0.18);
  color: var(--accent-strong);
}

.button-danger {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
  border: 1px solid rgba(185, 28, 28, 0.18);
}

.button-danger:hover {
  background: rgba(185, 28, 28, 0.16);
  color: #8f1414;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.stacked-cell {
  display: grid;
  gap: 0.15rem;
}

.cell-primary {
  font-weight: 600;
  word-break: break-word;
}

.cell-secondary {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.cell-tertiary {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.asset-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.asset-badge-docs {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.asset-badge-slides {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
}

.asset-badge-sheets {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.asset-badge-shared {
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.flash-success {
  border-color: rgba(15, 118, 110, 0.35);
}

.flash-error {
  border-color: rgba(185, 28, 28, 0.25);
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-success {
  background: rgba(15, 118, 110, 0.14);
  color: var(--success);
}

.status-error {
  background: rgba(185, 28, 28, 0.12);
  color: var(--danger);
}

.status-warning {
  background: rgba(180, 83, 9, 0.12);
  color: var(--warning);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
}

.secret-block {
  display: block;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 18px;
  background: #0f172a;
  color: #e5e7eb;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}

.definition-list {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}

.definition-list div {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.definition-list dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-weight: 600;
}

.definition-list dd {
  margin: 0;
}

.muted-copy {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-weight: 600;
}

.pagination-link:hover {
  background: rgba(15, 118, 110, 0.14);
}

.pagination-link.is-disabled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  pointer-events: none;
}

.pagination-summary {
  color: var(--muted);
  font-size: 0.95rem;
}

.audit-table {
  min-width: 1120px;
}

.audit-table th,
.audit-table td {
  padding: 1rem 0.65rem;
}

.audit-table .cell-primary {
  overflow-wrap: anywhere;
}

.audit-when {
  min-width: 12rem;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.audit-source-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.audit-details-cell {
  width: 20rem;
}

.audit-details {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.audit-details[open] {
  background: rgba(255, 255, 255, 0.88);
}

.audit-details summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.audit-details summary::-webkit-details-marker {
  display: none;
}

.audit-details summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}

.audit-details[open] summary::after {
  content: "–";
}

.audit-details-body {
  display: grid;
  gap: 0.85rem;
  padding: 0 0.9rem 0.9rem;
}

.audit-meta-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.audit-meta-list div {
  display: grid;
  gap: 0.2rem;
}

.audit-meta-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.audit-meta-list dd {
  margin: 0;
}

.audit-meta-list code,
.audit-json-block pre {
  display: block;
  margin: 0;
  overflow-x: auto;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.7rem 0.8rem;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.84rem;
}

.audit-json-block {
  display: grid;
  gap: 0.4rem;
}

.audit-json-block-error pre {
  border-color: rgba(185, 28, 28, 0.15);
  background: rgba(254, 242, 242, 0.9);
}

.tool-card {
  display: grid;
  gap: 1rem;
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.tool-card-header h2 {
  margin-bottom: 0.4rem;
}

.tool-name {
  display: inline-flex;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.tool-badge-row,
.tool-parameter-badges,
.tool-enum-list {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
}

.tool-badge-secondary {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

.tool-badge-danger {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
}

.tool-badge-required {
  background: rgba(180, 83, 9, 0.1);
  color: var(--warning);
}

.tool-badge-type {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.tool-section {
  display: grid;
  gap: 0.8rem;
}

.tool-section h3 {
  margin: 0;
  font-size: 1rem;
}

.tool-parameter-list,
.tool-parameter-children {
  display: grid;
  gap: 0.75rem;
}

.tool-parameter-row {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
}

.tool-parameter-level-1,
.tool-parameter-level-2,
.tool-parameter-level-3 {
  margin-left: 0.9rem;
}

.tool-parameter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tool-raw-schema {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.tool-raw-schema summary {
  cursor: pointer;
  padding: 0.8rem 1rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.tool-raw-schema pre {
  margin: 0;
  padding: 0 1rem 1rem;
  overflow-x: auto;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.84rem;
}

@media (max-width: 768px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 0.5rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-nav {
    width: 100%;
  }

  .form-grid > button {
    width: 100%;
  }

  .filters-grid > button {
    width: 100%;
  }

  .notification-subject-field {
    grid-column: 1 / -1;
  }

  .notification-recipient-field {
    max-width: none;
  }

  .large-select {
    min-width: 0;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .audit-table {
    min-width: 980px;
  }

  .tool-parameter-level-1,
  .tool-parameter-level-2,
  .tool-parameter-level-3 {
    margin-left: 0.5rem;
  }
}
