:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e0e0e0;
  --accent: #2a5bd7;
  --accent-hover: #1e46a8;
  --danger: #c0392b;
  --warn-bg: #fff7d6;
  --warn-border: #e5c572;
  --code-bg: #f0f1f3;
}

* { box-sizing: border-box; }

/* The UA's `[hidden] { display: none }` loses to any author rule that sets
   `display:` on the same element. Force it back with `!important` so the
   `hidden` attribute always wins. Also expose an `.is-hidden` class for JS. */
[hidden],
.is-hidden { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--border);
  background: white;
}

header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.tabs {
  display: flex;
  gap: 4px;
}
.tabs a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.tabs a:hover { background: var(--code-bg); color: var(--fg); }
.tabs a.active { color: var(--fg); background: var(--code-bg); }

.auth-area {
  margin-left: auto;
  display: flex;
  align-items: center;
}

#user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
#user-email { color: var(--fg); }

.btn-link {
  display: inline-block;
  font: inherit;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  color: var(--fg);
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s;
}
.btn-link:hover { background: var(--code-bg); }
.btn-link.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-link.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.tier {
  background: var(--code-bg);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 36px 80px;
}

h2 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 600;
}
h2.sp-top { margin-top: 40px; }

.signed-in-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.signed-in-head h2 { margin-bottom: 0; }

.free-tier-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 16px 0 24px;
}
.free-tier-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.free-tier-head h3 { margin: 0; font-size: 16px; }
.free-tier-card ul {
  margin: 12px 0;
  padding-left: 20px;
}
.free-tier-card li {
  padding: 2px 0;
  font-size: 14px;
}

.lead {
  font-size: 18px;
  color: var(--fg);
}

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

button {
  font: inherit;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
button:hover { background: var(--code-bg); }

button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

button.link {
  background: transparent;
  border: none;
  padding: 4px 0;
  color: var(--accent);
  text-decoration: underline;
}
button.link:hover { background: transparent; color: var(--accent-hover); }

button.danger {
  color: var(--danger);
  border-color: transparent;
}
button.danger:hover { background: #fdeeec; }

input[type="text"] {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.create-row {
  display: flex;
  gap: 8px;
  margin: 16px 0 24px;
}
.create-row input { flex: 1; }

.ticker-search {
  font: inherit;
  width: 100%;
  max-width: 480px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  margin-top: 8px;
}
.ticker-search:focus { outline: none; border-color: var(--accent); }

input[type="email"],
input[type="password"] {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
}
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  margin-top: 16px;
}
.auth-row {
  display: flex;
  gap: 8px;
}
.auth-row button { flex: 1; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-btn { max-width: 340px; width: 100%; }

/* Docs tables — less dense than the tokens table */
table.docs th, table.docs td { font-size: 14px; }
table.docs td:first-child { white-space: nowrap; }

/* Pricing grid */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
@media (max-width: 640px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

.plan {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.plan-plus { border-color: var(--accent); }
.plan h3 { margin: 0 0 8px; font-size: 16px; }
.plan .price {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 16px;
}
.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  flex: 1;
}
.plan li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.plan li:last-child { border-bottom: none; }

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
th {
  background: var(--code-bg);
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}
tbody tr:last-child td { border-bottom: none; }

td.token-cell code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.status-active { color: #1b8f3a; }
.status-revoked { color: var(--muted); text-decoration: line-through; }

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.code {
  background: var(--code-bg);
  padding: 12px 14px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

code {
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.error {
  margin: 16px 0;
  padding: 12px;
  border-radius: 6px;
  background: #fdeeec;
  color: var(--danger);
  border: 1px solid #f3c0b9;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal-box {
  background: white;
  padding: 32px;
  border-radius: 8px;
  max-width: 640px;
  width: calc(100% - 48px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-box h3 { margin-top: 0; }
.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  padding: 10px 12px;
  border-radius: 6px;
  color: #754c00;
  font-size: 14px;
}
.token-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  align-items: center;
}
.token-row code {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 13px;
  word-break: break-all;
}
