*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: #1a1a1a;
  background: #f4f5f6;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

header h1 a {
  color: #1a1a1a;
  text-decoration: none;
}

header h1 a:hover {
  color: #0066cc;
}

.subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.25rem;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.card p {
  margin-bottom: 0.75rem;
}

.card ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.card li {
  margin-bottom: 0.4rem;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.status-badge.authorized {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge.unauthorized {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-details {
  margin-bottom: 1rem;
}

.status-details dt {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.75rem;
}

.status-details dd {
  font-size: 0.95rem;
  margin-top: 0.15rem;
  word-break: break-all;
}

.status-details code {
  font-size: 0.85rem;
  background: #f0f0f0;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.action-bar {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.btn:hover {
  background: #f0f0f0;
  border-color: #aaa;
}

.btn-primary {
  background: #0066cc;
  color: #fff;
  border-color: #0066cc;
}

.btn-primary:hover {
  background: #0052a3;
  border-color: #0052a3;
}

.scope-details {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin: 0.75rem 0;
}

.scope-details summary {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #444;
  user-select: none;
  list-style: none;
}

.scope-details summary::before {
  content: '▶ ';
  font-size: 0.7rem;
  color: #888;
}

.scope-details[open] summary::before {
  content: '▼ ';
}

.scope-details summary::-webkit-details-marker {
  display: none;
}

.scope-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid #e0e0e0;
}

.scope-list li {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #eee;
}

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

.scope-list code {
  font-size: 0.8rem;
  color: #666;
}

.note {
  font-size: 0.85rem;
  color: #666;
}

.result-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.result-icon.success {
  color: #28a745;
}

.result-icon.failure {
  color: #dc3545;
}

.result-message {
  font-size: 1rem;
  margin-bottom: 1rem;
  word-break: break-word;
}

footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.8rem;
  color: #888;
  text-align: center;
}

footer a {
  color: #666;
}

a {
  color: #0066cc;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .container {
    padding: 1rem 0.75rem;
  }

  .card {
    padding: 1rem;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    text-align: center;
  }
}
