@import "tailwindcss";

:root {
  color: #1b1f23;
  background: #f5f1e8;
  font-family:
    ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(30, 41, 59, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(30, 41, 59, 0.06) 1px, transparent 1px),
    #f5f1e8;
  background-size: 32px 32px;
}

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

code,
pre {
  font: inherit;
}

pre {
  overflow: auto;
  border: 1px solid #1b1f23;
  background: #111827;
  color: #e5f4ff;
  padding: 1rem;
  border-radius: 6px;
  line-height: 1.55;
  font-size: 0.86rem;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #1b1f23;
  background: #fffaf0;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 5px 5px 0 #1b1f23;
}

.brand {
  font-weight: 900;
  letter-spacing: 0;
}

.navlinks {
  display: flex;
  gap: 8px;
}

.navlinks a,
.icon-button {
  border: 1px solid #1b1f23;
  background: #d6f36f;
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: 800;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: end;
  padding: 54px 0 30px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #b42318;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.96;
  max-width: 920px;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.12rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.7;
}

.status-panel,
.panel,
.function-card {
  border: 1px solid #1b1f23;
  background: #fffaf0;
  border-radius: 8px;
  box-shadow: 5px 5px 0 #1b1f23;
}

.status-panel {
  display: flex;
  gap: 12px;
  padding: 16px;
}

.status-panel p,
.panel p,
.function-card p {
  color: #3f4650;
  line-height: 1.6;
}

.status-dot {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  background: #10b981;
  border: 1px solid #1b1f23;
  border-radius: 50%;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 18px;
  margin-bottom: 22px;
}

.panel {
  padding: 18px;
}

.wide {
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.panel-heading .icon-button {
  flex: 0 0 auto;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.function-card {
  padding: 16px;
}

.function-card span {
  display: inline-block;
  margin-bottom: 16px;
  border: 1px solid #1b1f23;
  background: #ffcf56;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.function-card code,
.panel code {
  display: inline-block;
  max-width: 100%;
  background: #ece3d1;
  border: 1px solid #1b1f23;
  border-radius: 4px;
  padding: 2px 5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.page-header {
  padding: 48px 0 24px;
}

.docs-header h1 {
  max-width: 760px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.docs-toc {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  border: 1px solid #1b1f23;
  background: #fffaf0;
  border-radius: 8px;
  box-shadow: 5px 5px 0 #1b1f23;
  padding: 14px;
}

.docs-toc a {
  border: 1px solid #1b1f23;
  background: #fffdf7;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 0.84rem;
  font-weight: 800;
}

.docs-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.docs-section,
.docs-function,
.docs-callout,
.docs-subsection {
  border: 1px solid #1b1f23;
  background: #fffaf0;
  border-radius: 8px;
  box-shadow: 5px 5px 0 #1b1f23;
  min-width: 0;
  padding: 18px;
}

.docs-subsection {
  box-shadow: none;
  background: #fffdf7;
}

.docs-section h2 {
  font-size: 1.35rem;
}

.docs-section h4 {
  margin: 14px 0 8px;
}

.docs-section p,
.docs-section li,
.docs-table td,
.docs-table th {
  color: #3f4650;
  line-height: 1.65;
}

.docs-steps {
  padding-left: 1.4rem;
  line-height: 1.8;
}

.docs-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.docs-columns article {
  border: 1px solid #1b1f23;
  background: #fffdf7;
  border-radius: 6px;
  padding: 14px;
  min-width: 0;
}

.docs-function-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.docs-function {
  box-shadow: none;
  background: #fffdf7;
  min-width: 0;
}

.docs-function span {
  display: inline-block;
  margin-bottom: 12px;
  border: 1px solid #1b1f23;
  background: #ffcf56;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 900;
}

.docs-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 10px;
}

.docs-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fffdf7;
}

.docs-table th,
.docs-table td {
  border: 1px solid #1b1f23;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.docs-table th {
  background: #ece3d1;
  color: #1b1f23;
  font-weight: 900;
}

.scope-list {
  padding-left: 1.2rem;
  line-height: 1.9;
}

.auth-shell {
  min-height: 100vh;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
  padding: 54px 0 30px;
}

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

.auth-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input:not([type]),
.tester-panel input,
.tester-panel select,
.tester-panel textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #1b1f23;
  border-radius: 6px;
  background: #fffdf7;
  color: #1b1f23;
  padding: 10px;
  font: inherit;
}

.tester-panel textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.55;
}

.primary-button {
  border: 1px solid #1b1f23;
  background: #1b1f23;
  color: #fffaf0;
  padding: 10px 12px;
  border-radius: 6px;
  font: inherit;
  font-weight: 900;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.form-error {
  margin: 0;
  border: 1px solid #b42318;
  background: #fff1f0;
  color: #b42318;
  border-radius: 6px;
  padding: 8px 10px;
}

.scope-options {
  display: grid;
  gap: 8px;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 700 !important;
}

.token-result {
  display: grid;
  gap: 10px;
  border: 1px solid #1b1f23;
  background: #d6f36f;
  border-radius: 6px;
  padding: 12px;
}

.token-result code {
  overflow-wrap: anywhere;
  background: #fffaf0;
}

.token-visible {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.token-visible code {
  overflow-wrap: anywhere;
}

.token-unavailable {
  border: 1px dashed #1b1f23;
  background: #fffdf7;
  border-radius: 6px;
  padding: 8px 10px;
}

.token-manager {
  display: grid;
  gap: 22px;
}

.token-list {
  display: grid;
  gap: 12px;
}

.token-table {
  display: grid;
  gap: 10px;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid #1b1f23;
  background: #fffdf7;
  border-radius: 6px;
  padding: 12px;
}

.token-row p {
  margin: 6px 0 10px;
  font-size: 0.82rem;
}

.token-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.danger-button {
  border: 1px solid #1b1f23;
  background: #ffddd6;
  color: #8f1d13;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  font-weight: 900;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.tester-header h1 {
  max-width: 820px;
}

.tester-workbench {
  display: grid;
  grid-template-columns: 260px minmax(0, 1.1fr) minmax(0, 0.9fr);
  grid-template-areas:
    "presets request response"
    "presets request preview";
  gap: 18px;
  align-items: start;
}

.tester-panel {
  border: 1px solid #1b1f23;
  background: #fffaf0;
  border-radius: 8px;
  box-shadow: 5px 5px 0 #1b1f23;
  padding: 16px;
}

.tester-panel label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.tester-presets {
  grid-area: presets;
  position: sticky;
  top: 18px;
}

.tester-request {
  grid-area: request;
  display: grid;
  gap: 14px;
}

.tester-response {
  grid-area: response;
}

.tester-preview {
  grid-area: preview;
}

.preset-grid,
.tester-actions {
  display: grid;
  gap: 8px;
}

.preset-button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #1b1f23;
  background: #fffdf7;
  border-radius: 6px;
  padding: 9px 10px;
  color: #1b1f23;
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.preset-button span {
  min-width: 52px;
  border: 1px solid #1b1f23;
  background: #ffcf56;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.72rem;
  text-align: center;
}

:where(
  .navlinks a,
  .icon-button,
  .primary-button,
  .danger-button,
  .preset-button
) {
  cursor: pointer;
  box-shadow: 3px 3px 0 #1b1f23;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  will-change: transform;
}

:where(
  .navlinks a,
  .icon-button,
  .primary-button,
  .danger-button,
  .preset-button
):not(:disabled):where(:hover, :focus-visible) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #1b1f23;
  filter: brightness(1.03);
}

:where(
  .navlinks a,
  .icon-button,
  .primary-button,
  .danger-button,
  .preset-button
):not(:disabled):focus-visible {
  outline: 2px solid #b42318;
  outline-offset: 2px;
}

:where(
  .navlinks a,
  .icon-button,
  .primary-button,
  .danger-button,
  .preset-button
):not(:disabled):active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1b1f23;
  filter: brightness(0.96);
}

:where(.icon-button, .primary-button, .danger-button, .preset-button):disabled {
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.request-line {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
}

.auth-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid #1b1f23;
  background: #ece3d1;
  border-radius: 6px;
  padding: 9px 10px;
}

.status-pill {
  border: 1px solid #1b1f23;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill.ok {
  background: #d6f36f;
}

.status-pill.fail {
  background: #ffddd6;
  color: #8f1d13;
}

.empty-state {
  margin: 0;
  border: 1px dashed #1b1f23;
  border-radius: 6px;
  padding: 14px;
  color: #3f4650;
}

@media (max-width: 820px) {
  .hero-grid,
  .panel-grid,
  .library-grid,
  .login-layout,
  .docs-layout,
  .docs-function-grid,
  .docs-columns {
    grid-template-columns: 1fr;
  }

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

  .navlinks {
    width: 100%;
  }

  .navlinks a {
    flex: 1;
    text-align: center;
  }

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

  .token-visible {
    grid-template-columns: 1fr;
  }

  .tester-workbench {
    grid-template-columns: 1fr;
    grid-template-areas:
      "presets"
      "request"
      "response"
      "preview";
  }

  .tester-presets {
    position: static;
  }

  .request-line {
    grid-template-columns: 1fr;
  }

  .docs-toc {
    position: static;
  }
}
