:root {
  --bg: #0F0F0F;
  --panel: #1f1f1f;
  --panel-2: #2a2a2a;
  --border: #3a3a3a;
  --text: #F9FAFB;
  --muted: #A1A1AA;
  --primary: #3B82F6;
  --primary-2: #60A5FA;
  --violet: #8B5CF6;
  --danger: #DC2626;
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary-2); text-decoration: none; }
.logo { width: 34px; height: 34px; flex: none; }
.wordmark { font-weight: 800; letter-spacing: -0.02em; color: #ffffff; }
.wordmark .tie {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em; font-weight: 400; letter-spacing: 0.04em;
  color: var(--primary-2); padding: 0 2px; vertical-align: 1px;
}
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px;
}
.muted { color: var(--muted); }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
pre {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; overflow-x: auto; line-height: 1.5;
}
.error {
  color: #FCA5A5; background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.4); border-radius: 10px;
  padding: 10px 14px; font-size: 14px; display: none;
}

/* Landing */
.wrap { max-width: 880px; margin: 0 auto; padding: 28px 24px 60px; }
header { display: flex; align-items: center; gap: 12px; padding-bottom: 34px; }
header .wordmark { font-size: 22px; }
nav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 15px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero { padding: 30px 0 36px; }
.hero h1 { font-size: 42px; line-height: 1.15; letter-spacing: -0.02em; }
.hero p { margin-top: 14px; max-width: 560px; color: var(--muted); font-size: 18px; }
.grid { display: grid; gap: 18px; }
.card h2 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15px; }
.card-head { display: flex; align-items: baseline; gap: 12px; }
.card-head .signed-in { margin-left: auto; font-size: 13px; white-space: nowrap; }
.linkish {
  background: none; border: none; padding: 0; font: inherit; font-size: inherit;
  color: var(--primary-2); cursor: pointer;
}
.keys { width: 100%; border-collapse: collapse; margin-top: 14px; }
/* Placeholder where the list would be, not a sentence of card copy. */
.key-empty {
  margin-top: 14px; padding: 18px; text-align: center; font-size: 14px;
  border: 1px dashed var(--border); border-radius: 10px;
}
.card h2.section-break { margin-top: 26px; }
.keys td { padding: 10px 8px 10px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.key-name { font-weight: 600; font-size: 15px; color: var(--text); }
.key-date { font-size: 14px; white-space: nowrap; }
.key-actions { text-align: right; }
.key-delete {
  background: none; border: 1px solid var(--border); color: #FCA5A5;
  border-radius: 8px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.key-delete:hover { border-color: var(--danger); }
.key-delete.armed { background: var(--danger); border-color: var(--danger); color: #fff; }
.prompt { position: relative; margin-top: 14px; }
.prompt pre { white-space: pre-wrap; padding-right: 86px; }
.copy {
  position: absolute; top: 10px; right: 10px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.copy:hover { background: var(--panel-2); }
.env-toggle {
  position: fixed; right: 14px; bottom: 14px; display: flex; gap: 2px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; font-size: 12px;
}
.env-toggle button {
  background: none; border: none; color: var(--muted); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.env-toggle button.active { background: var(--panel-2); color: var(--text); }

/* Sign-in card — scoped under .signin so it can render as a standalone page
   (consent, /login) and inside the landing page's login dialog. */
.signin { width: 100%; max-width: 420px; padding: 30px; }
.signin .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.signin .brand .logo { width: 40px; height: 40px; }
.signin .brand .wordmark { font-size: 19px; }
.signin h1 { font-size: 22px; margin-bottom: 6px; letter-spacing: -0.01em; }
.signin > p { color: var(--muted); font-size: 15px; }
.signin.login > p,
#login-dialog .signin > p { margin-bottom: 20px; }
ul.scopes { margin: 14px 0 22px; padding: 0; list-style: none; }
ul.scopes li { font-size: 14px; color: var(--muted); padding: 6px 0 6px 26px; position: relative; }
ul.scopes li.granted::before { content: "✓"; position: absolute; left: 4px; color: var(--primary-2); }
ul.scopes li.denied { color: var(--border); text-decoration: line-through; }
ul.scopes li.denied::before { content: "–"; position: absolute; left: 4px; }
.buttons { display: grid; gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-apple { background: #000; color: #fff; border-color: #000; }
.btn-apple svg { width: 16px; height: 19px; fill: currentColor; }
.btn-google { background: #fff; color: #202124; border-color: #fff; }
.btn-google svg { width: 18px; height: 18px; }
.google-wrap { position: relative; }
#google-button {
  position: absolute; inset: 0; opacity: 0.001; overflow: hidden;
  display: flex; justify-content: center;
}
.dev { margin-top: 18px; text-align: center; }
.dev-toggle {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12px; color: var(--muted); text-decoration: underline dotted;
}
#dev-panel { margin-top: 14px; text-align: left; }
.dev label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 8px; }
.dev form { display: flex; gap: 8px; }
.dev input {
  flex: 1; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size: 14px;
}
.dev form button {
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.signin .error { margin-bottom: 16px; }

body.signin-page {
  display: flex; align-items: center; justify-content: center; padding: 24px;
}

#login-dialog {
  margin: auto; border: none; padding: 0; background: none; color: inherit;
  width: min(420px, calc(100vw - 40px));
}
#login-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
