:root {
  --text: #0d1117;
  --muted: #5b6578;
  --line: #dfe4ed;
  --soft: #f8faff;
  --blue: #1489f8;
  --blue-dark: #0758c9;
  --error: #b42318;
  --ok: #16794a;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  min-height: 100vh;
}

.top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: var(--text);
  color: #fff;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--blue);
}

.who {
  margin-left: auto;
  color: #c7cfdd;
  font-size: 0.9rem;
}

.top .link {
  color: #fff;
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

p {
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.narrow {
  max-width: 460px;
  margin: 3rem auto;
}

.button,
button {
  font: inherit;
  cursor: pointer;
}

.button,
button.primary {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button:hover,
button.primary:hover {
  background: var(--blue-dark);
}

button.secondary {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

button.secondary:hover {
  border-color: var(--blue);
}

button.danger {
  padding: 0.3rem 0.7rem;
  border: 1px solid #f1c4bf;
  border-radius: 8px;
  background: #fff;
  color: var(--error);
}

button.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blue-dark);
  text-decoration: underline;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

input,
textarea {
  font: inherit;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.digits {
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-align: center;
}

.fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.stack > * + * {
  margin-top: 0.9rem;
}

.message {
  min-height: 1.4em;
  margin: 0.6rem 0 0;
  color: var(--error);
}

.message.good {
  color: var(--ok);
}

.key {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 1.1rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  word-break: break-all;
}

.code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tabs button {
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
}

.tabs button[aria-selected="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

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

.table {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

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

details.conversation {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 0.5rem;
}

details.conversation > summary {
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  list-style-position: inside;
}

.turns {
  padding: 0 0.9rem 0.9rem;
}

.turn {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.said {
  white-space: pre-wrap;
  margin: 0.3rem 0;
}

.said.question {
  font-weight: 600;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem;
  max-height: 22rem;
  overflow: auto;
}

@media (max-width: 640px) {
  .fields {
    grid-template-columns: 1fr;
  }
}
