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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #fafafa;
  color: #1a1a1a;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 48px 0 40px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 48px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
}

.description {
  font-size: 15px;
  color: #444;
  max-width: 680px;
  margin: 0 auto;
}

/* Sections */
.section {
  margin-bottom: 48px;
}

.section h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1e40af;
  display: inline-block;
}

.section-intro {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

/* Subsections */
.subsection-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 32px 0 12px;
}

.prose {
  font-size: 15px;
  color: #444;
  line-height: 1.7;
  margin-bottom: 16px;
}

.prose-note {
  font-style: italic;
  color: #666;
  border-left: 3px solid #e5e5e5;
  padding-left: 14px;
  margin: 16px 0 24px;
}

/* Prose table */
.prose-table-wrapper {
  overflow-x: auto;
  margin-bottom: 16px;
}

.prose-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.prose-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.prose-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  line-height: 1.5;
}

.prose-table tr:last-child td { border-bottom: none; }

/* Open question cards */
.question-card {
  border: 1px solid #e5e5e5;
  border-left: 4px solid #0d9488;
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: #fff;
}

.question-card .question-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.question-card p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

/* Phase cards */
.phase-card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: #fff;
}

.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.phase-title {
  font-size: 15px;
  font-weight: 600;
}

.phase-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.phase-current { background: #e8f8f5; color: #1e8449; }
.phase-planned { background: #eef1ff; color: #1e40af; }
.phase-future { background: #f5f5f5; color: #888; }

.phase-card p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

/* Architecture diagram */
.arch-diagram {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 32px 24px;
  overflow-x: auto;
}

.arch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.arch-row-bottom {
  justify-content: flex-end;
  padding-right: 80px;
  margin: 8px 0;
}

.arch-row-api {
  justify-content: flex-end;
  padding-right: 20px;
}

.arch-spacer { width: 100px; }

.arch-box {
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  min-width: 150px;
  background: #fff;
}

.arch-d { border-color: #7c3aed; }
.arch-b { border-color: #2563eb; }
.arch-c { border-color: #1e40af; background: #eff6ff; }
.arch-a { border-color: #059669; }

.arch-label {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  margin-bottom: 2px;
}

.arch-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.arch-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}

.arch-arrow {
  font-size: 20px;
  color: #aaa;
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
}

.arch-arrow-label {
  font-size: 10px;
  color: #bbb;
}

.arch-vertical {
  text-align: center;
}

.arch-arrow-down {
  font-size: 20px;
  color: #aaa;
}

/* Link cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.link-card:hover {
  border-color: #1e40af;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08);
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #1e40af;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.link-card-github .card-icon {
  background: #333;
}

.card-body { flex: 1; }

.card-title {
  font-size: 14px;
  font-weight: 600;
}

.card-desc {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.card-arrow {
  font-size: 16px;
  color: #ccc;
  flex-shrink: 0;
}

/* Quick Start steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e40af;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-text {
  font-size: 14px;
}

.step-text a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 500;
}

.step-text a:hover { text-decoration: underline; }

/* Test Scenarios */
.scenario {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.scenario-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.scenario-expected {
  font-size: 12px;
  color: #888;
  background: #f5f5f5;
  padding: 2px 10px;
  border-radius: 4px;
}

.scenario-config {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.config-tag {
  font-size: 11px;
  background: #eff6ff;
  color: #1e40af;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #dbeafe;
}

.lines-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.agent-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 6px;
}

.line-text {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.copy-btn {
  padding: 4px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.copy-btn:hover {
  border-color: #1e40af;
  color: #1e40af;
}

.copy-btn.copied {
  background: #1e40af;
  color: #fff;
  border-color: #1e40af;
}

/* Tech Stack */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.tech-item {
  font-size: 14px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
}

.tech-label {
  font-weight: 600;
  color: #1e40af;
  margin-right: 8px;
}

.tech-label::after { content: " —"; color: #ccc; }

/* Next steps */
.next-steps {
  margin-top: 8px;
  color: #666;
}

/* Diary entries */
.diary-entry {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.diary-version {
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-size: 11px;
  color: #999;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 3px;
}

.diary-headline {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 8px 0 8px;
}

.diary-body {
  list-style: none;
  padding: 0;
}

.diary-body li {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  padding: 2px 0 2px 14px;
  position: relative;
}

.diary-body li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: #bbb;
  font-weight: bold;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 0 0;
  border-top: 1px solid #e5e5e5;
  margin-top: 48px;
}

footer p {
  font-size: 13px;
  color: #aaa;
}

/* Call Logs */
.log-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.log-row:hover { border-color: #1e40af; }

.log-time { font-size: 13px; font-weight: 500; }
.log-meta { font-size: 12px; color: #888; margin-top: 2px; }

.log-row-right { display: flex; align-items: center; gap: 8px; }
.log-turns { font-size: 12px; color: #666; }

.status-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: 0.3px;
}
.status-completed { background: #e8f8f5; color: #1e8449; }
.status-manual { background: #fef9e7; color: #b7950b; }

.empty-text, .loading-text { font-size: 14px; color: #999; font-style: italic; }
.error-text { font-size: 14px; color: #e74c3c; }

/* Modal */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); display: flex; align-items: center;
  justify-content: center; z-index: 1000;
}

.modal.hidden { display: none; }

.modal-content {
  background: #fff; border-radius: 12px; width: 90%; max-width: 700px;
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid #e5e5e5;
}

.modal-header h3 { font-size: 16px; }

.modal-close {
  background: none; border: none; font-size: 24px; color: #999;
  cursor: pointer; padding: 0 4px;
}

.modal-close:hover { color: #333; }

#modal-body {
  flex: 1; overflow-y: auto; padding: 20px;
}

.modal-meta {
  display: flex; gap: 16px; font-size: 12px; color: #888;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #eee;
}

.transcript-list { display: flex; flex-direction: column; gap: 8px; }

.transcript-turn {
  padding: 8px 12px; border-radius: 6px; font-size: 14px; line-height: 1.5;
}

.transcript-customer { background: #f0f0f0; }
.transcript-agent { background: #dce9f9; }

.modal-footer {
  padding: 12px 20px; border-top: 1px solid #e5e5e5; text-align: right;
}

.download-btn {
  padding: 6px 16px; background: #1e40af; color: #fff; border: none;
  border-radius: 4px; font-size: 13px; cursor: pointer;
}

.download-btn:hover { background: #1a3691; }

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 24px 16px 60px; }
  .hero h1 { font-size: 24px; }
  .arch-row { flex-wrap: wrap; justify-content: center; }
  .arch-row-bottom, .arch-row-api { justify-content: center; padding-right: 0; }
  .arch-spacer { display: none; }
  .card-grid { grid-template-columns: 1fr; }
}
