:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-subtle: #f6f6f6;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --text: #111111;
  --muted: #666666;
  --muted-strong: #444444;
  --button: #111111;
  --button-text: #ffffff;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.is-hidden {
  display: none !important;
}

.site-shell {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.site-header {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 32px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

.brand img {
  width: 160px;
  display: block;
  filter: invert(1);
}

.site-nav,
.site-actions,
.cta-row,
.button-row,
.filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-actions {
  margin-left: auto;
}

.site-nav a {
  color: var(--muted-strong);
}

.site-nav a:hover {
  color: var(--text);
}

.primary-button,
.ghost-button,
.nav-link,
.tab-button,
.tiny-button {
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.primary-button {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--button);
  padding: 11px 16px;
  font-weight: 600;
}

.primary-button:hover {
  background: #222222;
  border-color: #222222;
}

.ghost-button,
.nav-link,
.tab-button,
select,
input,
.tiny-button {
  background: var(--panel);
  color: var(--text);
  padding: 11px 16px;
}

.ghost-button:hover,
.nav-link:hover,
.tab-button:hover,
.tiny-button:hover {
  background: var(--panel-subtle);
}

.nav-link,
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link.is-active,
.tab-button.is-active {
  background: var(--panel-subtle);
  border-color: var(--text);
}

.wide {
  width: 100%;
}

.marketing-page {
  max-width: 760px;
  margin: 0 auto;
}

.marketing-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.marketing-section:first-child {
  border-top: 0;
  padding-top: 8px;
}

.hero-section {
  padding-top: 24px;
}

.marketing-page h1,
.marketing-page h2 {
  margin: 0 0 16px;
  letter-spacing: -0.03em;
}

.marketing-page h1 {
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  line-height: 0.96;
}

.marketing-page h2 {
  font-size: 1.55rem;
  line-height: 1.15;
}

.lead,
.supporting-line,
.section-note,
.marketing-page p,
.pricing-card p,
.workspace-card p,
.metric-card p,
.empty-state,
.log-meta,
#log-detail p,
#log-detail ul {
  color: var(--muted);
  line-height: 1.7;
}

.lead {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.supporting-line,
.section-note {
  margin: 16px 0 0;
}

.feature-list,
.steps-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.feature-list.compact-list {
  display: grid;
  gap: 6px;
}

.section-label {
  margin: 22px 0 8px;
  font-weight: 600;
  color: var(--text);
}

.pricing-grid-page {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pricing-card,
.workspace-card,
.table-card,
.metric-card,
.onboarding-banner,
.dashboard-sidebar,
.log-detail,
.secret-card,
.auth-card,
.code-shell {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.pricing-card,
.table-card,
.metric-card,
.onboarding-banner,
.secret-card,
.auth-card,
.code-shell {
  padding: 24px;
}

.pricing-card {
  display: flex;
  flex-direction: column;
}

.featured-card {
  border-color: var(--text);
}

.pricing-label,
.metric-label,
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.pricing-card h2,
.metric-card h3,
.workspace-card h2,
.view-header h2,
.secret-card h2,
.auth-card h2 {
  margin: 0 0 12px;
}

.pricing-card h2 {
  font-size: 2rem;
  line-height: 1;
}

.pricing-card h2 span {
  display: block;
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.pricing-card-actions {
  margin-top: auto;
  padding-top: 10px;
}

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}

.site-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.site-footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer-copy {
  margin: 0;
  color: var(--muted);
}

.site-footer-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer-nav a {
  color: var(--muted);
}

.site-footer-nav a:hover {
  color: var(--text);
}

body.is-dashboard .site-header,
body.is-dashboard .site-footer-inner {
  max-width: 1120px;
}

.dashboard-sidebar {
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.dashboard-nav {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.workspace-card {
  padding: 18px;
  background: var(--panel-subtle);
  box-shadow: none;
}

.workspace-card h2 {
  font-size: 1.25rem;
}

.workspace-card #workspace-scope {
  overflow-wrap: anywhere;
}

.dashboard-content {
  min-width: 0;
}

.notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-subtle);
  color: var(--text);
}

.notice.error {
  border-color: #f1c0bc;
  background: #fff4f2;
  color: var(--danger);
}

.view-header {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.8fr 1fr 1fr auto;
  gap: 12px;
  align-items: start;
}

.table-head {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.table-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.key-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tiny-button {
  padding: 8px 10px;
}

.logs-layout,
.billing-grid,
.usage-grid {
  display: grid;
  gap: 18px;
}

.logs-layout {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

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

.logs-list,
.mini-chart,
.bar-chart,
.route-list {
  display: grid;
  gap: 12px;
}

.log-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 16px;
  cursor: pointer;
}

.log-card:hover,
.log-card.is-active {
  border-color: var(--text);
}

.log-card h3,
#log-detail h3,
#log-detail h4 {
  margin: 12px 0 8px;
}

.log-pill,
.docs-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--muted-strong);
  background: var(--panel-subtle);
}

.log-detail {
  padding: 20px;
  min-height: 280px;
}

.log-detail.empty-state,
.empty-state {
  display: block;
}

.mini-item,
.bar-item,
.route-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-subtle);
}

.mini-track,
.bar-track {
  width: 100%;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
}

.mini-fill,
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #111111;
}

.onboarding-banner pre,
.secret-card pre,
.code-shell pre {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-subtle);
  overflow-x: auto;
  white-space: pre-wrap;
}

.code-shell-head,
.auth-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.copy-chip {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.copy-chip:hover,
.ghost-button.is-copied {
  background: var(--panel-subtle);
}

.auth-modal,
.secret-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.auth-card,
.secret-card {
  width: min(100%, 440px);
}

.panel-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
}

input::placeholder {
  color: #9a9a9a;
}

.form-footnote {
  margin: 0;
}

.auth-helper-text {
  margin: 0 0 16px;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.modal-close:hover {
  color: var(--text);
}

@media (max-width: 980px) {
  .site-header,
  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .pricing-grid-page,
  .logs-layout,
  .billing-grid,
  .usage-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 16px;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 10px;
  }

  .brand {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: auto;
  }

  .site-actions {
    grid-column: 2 / 3;
    grid-row: 1;
    width: auto;
    justify-self: end;
    flex-wrap: nowrap;
  }

  .cta-row,
  .button-row,
  .filters-row {
    width: 100%;
  }

  .cta-row > *,
  .button-row > *,
  .filters-row > * {
    width: 100%;
  }

  .site-actions > * {
    width: auto;
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand img {
    width: 144px;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
