:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c1e21;
  --text-muted: #656b76;
  --border: #dde1e6;
  --accent: #3457d5;
  --accent-hover: #2c46b3;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1e2126;
    --text: #eceef1;
    --text-muted: #9aa1ab;
    --border: #30343b;
    --accent: #6b8afd;
    --accent-hover: #86a0ff;
    --danger: #ff8a80;
    --danger-bg: #3a2222;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
header strong { font-size: 1.05rem; letter-spacing: 0.02em; }
header span { color: var(--text-muted); font-size: 0.9rem; }
header form { margin: 0; }
main {
  display: flex;
  justify-content: center;
  padding: 3rem 1.5rem;
}
#content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 28rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
#content-card.wide { max-width: 40rem; }
h1 {
  margin-top: 0;
  font-size: 1.4rem;
}
h2 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.75rem;
}
p { color: var(--text-muted); }
a { color: var(--accent); }
form div { margin-bottom: 1rem; }
label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}
input[type="text"]:focus,
input[type="password"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button {
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}
button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button[value="deny"] {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
button[value="deny"]:hover { background: var(--bg); }
fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
}
legend {
  padding: 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
fieldset label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  color: var(--text);
  margin: 0.4rem 0;
}
fieldset input[type="checkbox"] { width: auto; }
ul.app-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.app-list-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
}
.app-list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.app-list-item-header form { margin: 0; }
.app-list-item-header button {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}
.app-list-item-header button:hover { background: var(--danger-bg); }
.app-list-item-scopes {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.scope-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.app-list-item-meta {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
}
[role="alert"] {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}
