:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --card: #ffffff;
  --card-strong: #ebebef;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-contrast: #ffffff;
  --success: #30a46c;
  --warning: #e68a00;
  --error: #e5484d;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #f5f5f7;
    --muted: #a1a1a6;
    --card: #1c1c1e;
    --card-strong: #2c2c2e;
    --border: rgba(255, 255, 255, 0.12);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

main {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

header {
  padding: 24px 0 16px;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

h1 {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}

.lang {
  display: inline-flex;
  background: var(--card-strong);
  border-radius: 999px;
  padding: 3px;
  font-size: 12px;
  font-weight: 600;
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.lang-btn.is-active {
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.tagline {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 16px;
}

.links {
  font-size: 14px;
  color: var(--muted);
}

.links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.links a:hover {
  text-decoration: underline;
}

.sep {
  margin: 0 6px;
}

section {
  margin-top: 28px;
}

section h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  padding-left: 4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 16px;
}

.card.status .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}

.card.status .row:last-child {
  border-bottom: none;
}

.card.status .row span {
  color: var(--muted);
}

.card.status .row strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 14px;
}

.card.status .row strong[data-state="yes"] {
  color: var(--success);
}

.card.status .row strong[data-state="no"] {
  color: var(--muted);
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
  padding-left: 4px;
}

.group {
  margin-bottom: 20px;
}

.group[hidden] {
  display: none !important;
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.group-head h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.group-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  text-align: right;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}

button[data-kind] {
  appearance: none;
  -webkit-appearance: none;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

button[data-kind].is-pressed {
  transform: scale(0.96);
  background: color-mix(in oklch, var(--card), var(--fg) 10%);
}

.note {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 4px 0;
  padding: 8px 12px;
  background: var(--card-strong);
  border-radius: 8px;
}

/* Install — tabs */
.install {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--card-strong);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab.is-active {
  color: var(--fg);
  background: var(--card);
  border-bottom-color: var(--accent);
}

.code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 16px;
}

.code-row .code {
  flex: 1;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 14px;
  font-family: var(--mono);
  overflow-x: auto;
}

.copy {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}

.copy.is-pressed {
  transform: scale(0.97);
}

.copy.is-done {
  color: var(--success);
  border-color: var(--success);
}

.code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  margin: 0;
}

.code code {
  font-family: var(--mono);
  white-space: pre;
}

.api-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.api-list li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.api-list li:last-child {
  border-bottom: none;
}

.api-list code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--card-strong);
  padding: 2px 6px;
  border-radius: 4px;
}

footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

footer p {
  margin: 4px 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

pre.error {
  color: var(--error);
  background: var(--card);
  border: 1px solid var(--error);
  border-radius: 12px;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
}
