:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
  color: #000;
  background: #fff;
}

* {
  box-sizing: border-box;
}

.site-notice {
  width: 100%;
  padding: 9px 20px;
  background: #000;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

[hidden] {
  display: none !important;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  background: #fff;
  color: #000;
}

a {
  color: inherit;
}

button,
input,
select {
  border-radius: 0;
  font: inherit;
}

.portal-header {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 28px;
  gap: 10px;
  border-bottom: 1px solid #ccc;
  font-size: 14px;
}

.portal-brand {
  font-weight: 700;
  text-decoration: none;
}

.portal-site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: 22px;
  font-size: 13px;
  font-weight: 700;
}

.portal-site-nav a {
  text-decoration: none;
}

.portal-site-nav a:hover,
.portal-site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.portal-header-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-left: auto;
}

#signed-out-actions,
.account-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-actions > span {
  font-weight: 700;
}

.portal-header-actions label {
  display: grid;
  gap: 3px;
}

.portal-header-actions label span {
  color: #555;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-header-actions input {
  width: 170px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid #aaa;
}

#api-key {
  width: 210px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.portal-header-actions button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.button-primary,
.button-secondary,
.manual-connect-row button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.button-secondary,
.portal-header-actions .button-secondary {
  background: #fff;
  color: #000;
}

button:disabled {
  cursor: wait;
  opacity: 0.5;
}

main {
  width: min(1280px, calc(100% - 40px));
  flex: 1;
  margin: 0 auto;
  padding: 42px 0 72px;
}

.portal-footer {
  width: 100%;
  border-top: 1px solid #ccc;
  font-size: 13px;
}

.portal-footer-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 28px;
  line-height: 1.45;
}

.portal-footer-inner p {
  margin: 0;
}

.portal-footer-inner p + p {
  margin-top: 6px;
}

.portal-footer a {
  color: inherit;
  text-underline-offset: 3px;
}

.onboarding {
  max-width: 790px;
  padding: 58px 0 90px;
}

.onboarding h1 {
  max-width: 720px;
  font-size: 58px;
}

.onboarding-copy {
  max-width: 720px;
  margin: 25px 0 30px;
  font-size: 22px;
  line-height: 1.45;
}

.onboarding > .button-primary {
  min-height: 42px;
}

.manual-connect {
  max-width: 500px;
  margin-top: 32px;
  border-top: 1px solid #ccc;
  padding-top: 18px;
}

.manual-connect summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.manual-connect-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.manual-connect-row input {
  flex: 1;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #999;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.portal-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: start;
  gap: 42px;
}

.portal-sidebar {
  position: sticky;
  top: 28px;
  min-width: 0;
  padding-right: 28px;
  border-right: 1px solid #ddd;
}

.workspace-picker {
  display: grid;
  gap: 5px;
  margin-bottom: 20px;
}

.workspace-picker span {
  color: #555;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace-picker select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #999;
  background: #fff;
}

.portal-nav {
  display: grid;
  gap: 2px;
}

.portal-nav a {
  padding: 9px 10px;
  border-left: 2px solid transparent;
  color: #555;
  font-size: 14px;
  text-decoration: none;
}

.portal-nav a:hover {
  color: #000;
}

.portal-nav a[aria-current="page"] {
  border-left-color: #000;
  background: #f3f3f3;
  color: #000;
  font-weight: 700;
}

.portal-view-column,
.portal-view-panel {
  min-width: 0;
}

.portal-view-panel.portal-section {
  margin-top: 0;
}

.portal-title-row,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.portal-title-row {
  align-items: center;
}

.portal-kicker {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
}

.connection-status {
  margin: 0;
  color: #555;
  font-size: 13px;
}

.portal-context {
  display: flex;
  align-items: end;
  gap: 18px;
}

.portal-context label {
  display: grid;
  gap: 4px;
}

.portal-context label span {
  color: #555;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-context select {
  min-width: 190px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #999;
  background: #fff;
}

.connection-status::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #8c959f;
  color: #8c959f;
  content: "";
}

.connection-status.is-connected::before {
  background: #1a7f37;
  color: #1a7f37;
}

.connection-status.is-error::before {
  background: #cf222e;
  color: #cf222e;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 28px;
  border: 1px solid #ccc;
  background: #f7f7f7;
}

.metrics div {
  min-width: 0;
  padding: 17px 18px 19px;
  border-right: 1px solid #ccc;
}

.metrics div:first-child {
  padding-left: 18px;
}

.metrics div:last-child {
  border-right: 0;
}

.metrics span {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-size: 12px;
}

.metrics strong {
  display: block;
  font-size: 27px;
  line-height: 1;
}

.portal-section {
  margin-top: 48px;
}

.api-keys-section {
  margin-top: 68px;
  padding-top: 28px;
  border-top: 1px solid #000;
}

.settings-kicker {
  margin: 0 0 16px;
  color: #555;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.new-key {
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
}

.new-key > div:first-child,
.new-key-value,
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.new-key > div:first-child span {
  color: #555;
  font-size: 12px;
}

.new-key-value {
  margin-top: 14px;
}

.new-key-value code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.keys-list {
  border-top: 1px solid #ccc;
}

.key-row {
  min-height: 58px;
  border-bottom: 1px solid #ddd;
}

.key-row > div {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

.key-row code {
  color: #555;
  font-size: 12px;
}

.keys-feedback {
  min-height: 18px;
  margin: 12px 0 0;
  color: #555;
  font-size: 13px;
}

.keys-feedback.is-success {
  color: #1a7f37;
}

.keys-feedback.is-error {
  color: #cf222e;
}

.key-row button {
  flex: none;
}

.compact-empty {
  padding: 18px 0;
  border-top: 1px solid #ccc;
  color: #555;
  font-size: 13px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1.08;
}

.section-heading p,
.section-heading > span {
  margin: 0;
  color: #555;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid #000;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: middle;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th {
  color: #555;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

td.operation-cell {
  max-width: 360px;
}

.operation-name {
  display: block;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-callsite {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #666;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-label {
  font-weight: 700;
}

.empty-state {
  padding: 30px 0;
  border-bottom: 1px solid #000;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.empty-state p {
  max-width: 620px;
  margin: 0 0 22px;
  color: #444;
  font-size: 14px;
  line-height: 1.5;
}

.empty-state pre {
  max-width: 680px;
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid #ccc;
  background: #f7f7f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

@media (max-width: 760px) {
  .portal-header {
    flex-wrap: wrap;
    padding: 14px;
  }

  .portal-site-nav {
    order: 3;
    width: 100%;
    margin: 4px 0 0;
    padding-top: 12px;
    border-top: 1px solid #ddd;
  }

  .portal-header-actions {
    display: flex;
    margin-left: auto;
  }

  .portal-header-actions label {
    flex: 1;
    min-width: 0;
  }

  .portal-header-actions input,
  #api-key {
    width: 100%;
  }

  .portal-header-actions button {
    align-self: end;
  }

  main {
    width: calc(100% - 28px);
  }

  .portal-footer-inner {
    width: calc(100% - 28px);
  }

  main {
    padding-top: 34px;
  }

  .portal-shell {
    display: block;
  }

  .portal-sidebar {
    position: static;
    margin-bottom: 30px;
    padding: 0 0 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #ccc;
  }

  .workspace-picker {
    max-width: 260px;
    margin-bottom: 12px;
  }

  .portal-nav {
    display: flex;
    min-width: max-content;
    gap: 0;
  }

  .portal-nav a {
    padding: 10px 12px;
    border-bottom: 2px solid transparent;
    border-left: 0;
  }

  .portal-nav a:first-child {
    padding-left: 0;
  }

  .portal-nav a[aria-current="page"] {
    border-bottom-color: #000;
    border-left-color: transparent;
    background: transparent;
  }

  .portal-title-row,
  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }

  h1 {
    font-size: 34px;
  }

  .onboarding {
    padding-top: 34px;
  }

  .onboarding h1 {
    font-size: 40px;
  }

  .onboarding-copy {
    font-size: 18px;
  }

  .new-key > div:first-child,
  .new-key-value,
  .key-row {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .new-key-value .button-secondary,
  .key-row .button-secondary {
    width: 100%;
  }

  .key-row {
    padding: 14px 0;
  }

  .key-row > div {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics div,
  .metrics div:first-child {
    padding: 16px 12px;
    border-bottom: 1px solid #ddd;
  }

  .metrics div:nth-child(2n) {
    border-right: 0;
  }

  .metrics div:last-child {
    border-bottom: 0;
  }

  .metrics strong {
    font-size: 25px;
  }

  .portal-view-panel.portal-section {
    margin-top: 0;
  }
}
