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

body {
  background: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.container {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  gap: 24px;
  align-items: flex-start;
}

/* ---- Timeline panel (left) ---- */
.timeline {
  width: 280px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding: 24px;
  overflow-y: auto;
}

.timeline h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d1d1f;
  margin: 16px 0 20px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
}

/* Home button */
.button {
  display: inline-block;
  background: #0071e3;
  color: #ffffff;
  border-radius: 980px;
  padding: 6px 16px;
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s ease;
}

.button:hover {
  background: #0077ed;
}

/* Timeline vertical line */
.timeline-content {
  position: relative;
  padding-left: 4px;
}

.timeline-content::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #e5e5e5;
}

/* Timeline items */
.date-item {
  position: relative;
  padding: 10px 8px 10px 28px;
  cursor: pointer;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

.date-item:hover {
  background: #f5f5f7;
}

.date-item.active {
  background: #e8f0fb;
}

.date-item h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 2px 0;
}

.date-item p,
.doc-count {
  font-size: 0.8rem;
  color: #6e6e73;
  margin: 0;
  font-style: normal;
}

/* Timeline dot */
.date-circle {
  position: absolute;
  left: 4px;
  top: 16px;
  width: 10px;
  height: 10px;
  background: #0071e3;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #0071e3;
  z-index: 1;
}

/* ---- Preview panel (right) ---- */
.preview-container {
  flex: 1;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding: 32px;
  min-height: 500px;
  overflow-y: auto;
}

.preview-container h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 20px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
}

#preview-content {
  display: flex;
  flex-direction: column;
}

.no-preview {
  color: #6e6e73;
  font-size: 0.95rem;
}

/* Document tabs (multiple certs per date) */
.document-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 16px 0;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 16px;
}

.document-tab {
  background: #f5f5f7;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: #1d1d1f;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

.document-tab:hover {
  background: #e8f0fb;
  border-color: #0071e3;
}

.document-tab.active {
  background: #0071e3;
  color: #ffffff;
  border-color: #0071e3;
}

.document-icon {
  margin-right: 6px;
  font-size: 14px;
}

/* Preview area */
.document-preview-area {
  border-radius: 8px;
  overflow: hidden;
  min-height: 600px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

iframe {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: none;
  border-radius: 8px;
}

img {
  border: none;
  border-radius: 8px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ---- Mobile ---- */
@media (max-width: 700px) {
  .container {
    flex-direction: column;
    padding: 16px 10px;
  }

  .timeline {
    width: 100%;
  }

  .document-preview-area,
  iframe,
  img {
    min-height: 400px;
  }
}
