:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #d8dbe2;
  --text: #1c2330;
  --muted: #5d6675;
  --accent: #2457d6;
  --accent-soft: #e8eefc;
  --ok: #18794e;
  --ok-soft: #e6f4ec;
  --wait: #8a5a00;
  --wait-soft: #fdf1da;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --code: #f0f2f6;
  --radius: 12px;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

h1,
h2 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}

h2 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 0.9em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--code);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.page {
  width: min(920px, 100% - 2rem);
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.page--narrow {
  width: min(560px, 100% - 2rem);
  padding-top: 5rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.hero--view {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.hero--view > div {
  flex: 1 1 320px;
  min-width: 0;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
}

.card--warn {
  border-color: #e7c48a;
  background: #fffaf0;
}

.card--error {
  text-align: left;
  border-color: #e7b4af;
  background: var(--danger-soft);
}

.error-code {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--danger);
  margin: 0 0 0.25rem;
}

.steps,
.limits {
  margin: 0;
  padding-left: 1.3rem;
}

.steps li,
.limits li {
  margin-bottom: 0.5rem;
}

.steps li:last-child,
.limits li:last-child {
  margin-bottom: 0;
}

.code {
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0 0 0.9rem;
}

.code code {
  background: none;
  padding: 0;
  font-size: 0.92rem;
  white-space: pre;
}

.link {
  font-weight: 600;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.status--ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.status--wait {
  color: var(--wait);
  background: var(--wait-soft);
}

.status--error {
  color: var(--danger);
  background: var(--danger-soft);
}

.copy-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.copy-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
}

.copy-input:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 1px;
  border-color: var(--accent);
}

.button {
  flex: 0 0 auto;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.06);
}

.button:active {
  transform: translateY(1px);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0;
}

.facts div {
  min-width: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.facts dd {
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
}

.feed {
  margin-top: 1.75rem;
}

.feed__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.feed__head h2 {
  margin: 0;
}

.feed__count {
  color: var(--muted);
  font-size: 0.9rem;
}

.empty {
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.events {
  display: grid;
  gap: 0.9rem;
}

.hook {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.hook__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.method {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.method--get {
  background: var(--ok-soft);
  color: var(--ok);
}

.hook__time {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
}

.hook__meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: auto;
  overflow-wrap: anywhere;
}

.hook__note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
}

.hook__pre {
  margin: 0 0 0.7rem;
  padding: 0.8rem 0.9rem;
  background: var(--code);
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 26rem;
  overflow-y: auto;
}

.hook__table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.7rem;
  font-size: 0.88rem;
}

.hook__table th,
.hook__table td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.hook__table th {
  width: 34%;
  color: var(--muted);
  font-weight: 600;
}

.hook__table code {
  background: none;
  padding: 0;
  font-size: 0.86rem;
}

.headers {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}

.headers summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
}

.headers dl {
  display: grid;
  grid-template-columns: minmax(120px, 32%) 1fr;
  gap: 0.3rem 0.8rem;
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
}

.headers dt {
  font-family: var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.headers dd {
  margin: 0;
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.foot {
  width: min(920px, 100% - 2rem);
  margin: 0 auto;
  padding: 0 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .page {
    padding-top: 1.5rem;
  }

  .copy-row {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hook__meta {
    margin-left: 0;
  }
}
