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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f6f6f6;
  color: #222;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0.5rem 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-logo {
  display: flex;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.header-logo:hover {
  opacity: 1;
}

.header-logo img {
  height: 50px;
  width: auto;
}

.header-right {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 50px;
}

.header-right a {
  display: flex;
  line-height: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.header-right a:hover {
  opacity: 1;
}

.header-right a:last-child {
  position: absolute !important;
  bottom: 0 !important;
}

.header-right a:first-child img {
  height: 25px;
  width: auto;
}

.header-right a:last-child img {
  height: 20px;
  width: auto;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #222;
}

.site-subtitle {
  color: #666;
  font-size: 0.9rem;
}

/* Main container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Prototype banner */
.prototype-banner {
  background: #fef08a;
  color: #713f12;
  padding: 1rem 1.5rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  text-align: center;
  border: 2px solid #eab308;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: #0066cc;
}

.breadcrumb span {
  margin: 0 0.5rem;
  color: #999;
}

/* Main content card */
.content-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

/* Dataset header */
.dataset-header {
  padding: 2rem;
  border-bottom: 1px solid #eee;
}

.dataset-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.dataset-meta {
  color: #666;
  font-size: 0.9rem;
}

.dataset-meta strong {
  color: #444;
}

/* Section */
.section {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #eee;
}

.section:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-content {
  color: #444;
  font-size: 0.95rem;
}

.section-content p {
  margin-bottom: 1rem;
}

.section-content p:last-child {
  margin-bottom: 0;
}

.section-content .filename {
  color: #888;
  font-size: 0.85rem;
}

/* Collapsible section */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 1.5rem 2rem;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
}

.collapsible-header:hover {
  background: #f5f5f5;
}

.collapsible-header .section-title {
  margin-bottom: 0;
}

.collapse-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: transform 0.3s;
}

.collapsible-header.expanded .collapse-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.collapsible-content.expanded {
  max-height: 2000px;
}

.collapsible-inner {
  padding: 1.5rem 2rem;
}

/* File browser */
.file-browser {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}

.file-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #666;
  padding: 0.75rem 1rem;
  background: #fafafa;
  border-bottom: 1px solid #e0e0e0;
}

.file-nav a {
  color: #0066cc;
}

.file-item {
  border-bottom: 1px solid #f0f0f0;
}

.file-item:last-child {
  border-bottom: none;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.file-item:hover {
  background: #fafafa;
}

.file-meta-toggle {
  font-size: 0.6rem;
  color: #ccc;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  width: 0.8rem;
  flex-shrink: 0;
}

.file-meta-toggle:hover {
  color: #666;
}

.file-meta-toggle .arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.file-meta-toggle.expanded .arrow {
  transform: rotate(90deg);
}

.file-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

.file-info {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: #999;
  flex-shrink: 0;
}

.file-info span {
  min-width: 5rem;
  text-align: right;
}

.file-meta {
  display: none;
  padding: 0.3rem 1rem 0.5rem 3rem;
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
  border-top: 1px dashed #eee;
}

.file-meta.expanded {
  display: block;
}

.file-name .icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.file-name .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row.folder .file-name {
  cursor: pointer;
}

.file-row.folder .file-name:hover .name {
  color: #0066cc;
  text-decoration: underline;
}

.file-row.file .file-name .name a {
  color: #222;
}

.file-row.file .file-name .name a:hover {
  color: #0066cc;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty {
  text-align: center;
  padding: 2rem;
  color: #888;
}

.error-msg {
  background: #fef2f2;
  color: #b91c1c;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.dev-notice {
  background: #fef9c3;
  color: #854d0e;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  border: 1px solid #fde047;
}

/* Contact info */
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-email svg {
  color: #666;
}

/* License box */
.license-box {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.license-badge img {
  display: block;
}

.license-details {
  flex: 1;
}

.license-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
}

.license-name a {
  color: #333;
}

.license-name a:hover {
  color: #0066cc;
}

.license-table {
  width: 100%;
  font-size: 0.9rem;
  border-collapse: collapse;
}

.license-table th {
  text-align: left;
  font-weight: 600;
  color: #555;
  padding: 0.4rem 1rem 0.4rem 0;
  vertical-align: top;
  width: 6rem;
}

.license-table td {
  color: #444;
  padding: 0.4rem 0;
}

.license-condition {
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 0.25rem;
}

.license-condition strong {
  display: inline-block;
  background: #444;
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-right: 0.4rem;
}

.license-text {
  font-size: 0.9rem;
  color: #555;
}

/* Attribution */
.attribution {
  padding: 2rem;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.attribution-title {
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.attribution-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem 3rem;
}

.attribution-grid a {
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.attribution-grid a:hover {
  opacity: 1;
}

.attribution-grid a.logo-dark {
  background: #444;
  padding: 6px 10px;
  border-radius: 3px;
  border: none;
  opacity: 1;
}

.attribution-grid a.logo-dark:hover {
  background: #333;
}

.attribution-grid img {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.attribution-grid .logo-large img {
  height: 50px;
}

.attribution-grid a.logo-right {
  margin-left: auto;
}

.attribution-grid a.logo-right img {
  height: 28px;
}

/* Footer */
.site-footer {
  text-align: right;
  padding: 0 0 1rem;
  margin-top: -0.5rem;
  font-size: 0.7rem;
  color: #999;
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  transition: opacity 0.2s;
}

.site-footer a {
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer:hover {
  opacity: 0.7;
}

.footer-separator {
  margin: 0 0.2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .dataset-header,
  .section,
  .collapsible-header,
  .collapsible-inner {
    padding: 1.25rem;
  }

  .dataset-title {
    font-size: 1.35rem;
  }

  .license-box {
    flex-direction: column;
    gap: 1rem;
  }

  .license-table th {
    display: block;
    padding-bottom: 0.25rem;
  }

  .license-table td {
    display: block;
    padding-bottom: 0.75rem;
  }
}
