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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #1a56db;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
}

header .container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

header h1 a {
  color: inherit;
}

header h1 a:hover {
  text-decoration: none;
}

main {
  flex: 1;
  padding: 2rem 0;
}

footer {
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
}

/* Intro */
.intro {
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  color: #374151;
}

/* Org Sections */
.org-section {
  margin-bottom: 2.5rem;
}

.org-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.org-description {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.org-empty {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.9rem;
}

/* Policy Cards */
.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.policy-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
  color: inherit;
}

.policy-card:hover {
  border-color: #1a56db;
  box-shadow: 0 1px 4px rgba(26, 86, 219, 0.1);
  text-decoration: none;
}

.policy-card .name {
  font-weight: 500;
  font-size: 0.95rem;
}

.policy-card .arrow {
  color: #9ca3af;
  float: right;
  transition: color 0.15s;
}

.policy-card:hover .arrow {
  color: #1a56db;
}

/* Policy Page */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.policy-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

/* Rendered Markdown */
.policy-content h1 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; }
.policy-content h2 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.policy-content h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
.policy-content p { margin-bottom: 0.75rem; }
.policy-content ul, .policy-content ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.policy-content li { margin-bottom: 0.25rem; }
.policy-content a { word-break: break-word; }

.policy-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.policy-content th,
.policy-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.policy-content th {
  background: #f3f4f6;
  font-weight: 600;
}

/* Error */
.error {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.error h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: #9ca3af;
}

@media (max-width: 640px) {
  .policy-grid {
    grid-template-columns: 1fr;
  }
}
