:root {
  font-family: 'Inter', 'HarmonyOS Sans', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  background: #eef2ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #eff6ff, #e0e7ff 40%, #f8fafc 75%);
  color: #0f172a;
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #f8fafc;
  border-radius: 28px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(14, 165, 233, .35), transparent 60%);
  pointer-events: none;
}

.hero-text {
  flex: 1 1 320px;
  position: relative;
  z-index: 1;
}

.hero-metrics {
  flex: 1 1 240px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(248, 250, 252, .15);
  border: 1px solid rgba(248, 250, 252, .3);
  font-size: 13px;
  margin-bottom: 14px;
  transition: background .2s ease, border .2s ease;
}

.hero-tag.success {
  background: rgba(34, 197, 94, .15);
  border-color: rgba(34, 197, 94, .4);
}

.hero-tag.error {
  background: rgba(248, 113, 113, .2);
  border-color: rgba(248, 113, 113, .45);
}

.hero-tag.loading {
  background: rgba(248, 250, 252, .08);
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: .02em;
}

.subtitle {
  margin: 12px 0 24px;
  color: rgba(248, 250, 252, .82);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero .label {
  color: rgba(248, 250, 252, .7);
  font-size: 13px;
}

.hero-metrics strong {
  display: block;
  font-size: 30px;
}

button,
.hero a,
.story-actions a {
  font: inherit;
}

.primary,
.story-actions .primary {
  border: none;
  background: linear-gradient(120deg, #60a5fa, #38bdf8);
  color: #0f172a;
  padding: 12px 22px;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 35px rgba(59, 130, 246, .35);
  text-decoration: none;
}

.ghost,
.story-actions .ghost {
  border: 1px solid rgba(248, 250, 252, .4);
  background: transparent;
  color: inherit;
  padding: 11px 20px;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
}

.panel {
  background: #ffffff;
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 16px 80px rgba(15, 23, 42, .08);
}

.panel.settings,
.panel.help {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .55);
  padding: 24px;
  z-index: 5;
}

.panel.settings > div,
.panel.help > div {
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  width: min(520px, 90vw);
  box-shadow: 0 25px 80px rgba(15, 23, 42, .15);
}

.panel.settings[hidden],
.panel.help[hidden] {
  display: none;
}

.panel.flow {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.flow-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  background: #f8fafc;
}

.flow-index {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.flow-list h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.panel.matches header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.matches-actions {
  display: flex;
  align-items: center;
}

.matches-content {
  margin-top: 18px;
}

.matches-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed #cbd5f5;
  background: #f8fafc;
  color: #475569;
}

.matches-empty.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.job-cards {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.job-card {
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

.job-card h3 {
  margin: 0;
  font-size: 18px;
}

.job-card a {
  color: #1d4ed8;
  text-decoration: none;
}

.job-meta {
  font-size: 14px;
  color: #475569;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.job-score {
  font-weight: 600;
  color: #0f172a;
}

.job-reasons {
  font-size: 13px;
  color: #64748b;
}

.tagline {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tagline span {
  font-size: 12px;
  color: #475569;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 999px;
}

.matches-empty.hidden {
  display: none;
}

.settings-grid {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

label {
  font-size: 14px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input {
  border-radius: 14px;
  border: 1px solid #c7d2fe;
  padding: 12px 14px;
  font-size: 15px;
}

input:focus {
  outline: 2px solid #818cf8;
  border-color: transparent;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.panel.help ul {
  padding-left: 20px;
  color: #475569;
}

.panel.help code,
.settings-grid code,
.help code {
  background: #e2e8f0;
  border-radius: 6px;
  padding: 2px 6px;
}

.panel.overview {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  letter-spacing: .3em;
  text-transform: uppercase;
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.panel.overview h2 {
  margin: 6px 0;
  font-size: 28px;
}

.panel.overview p {
  margin: 0;
  color: #475569;
}

.panel.report header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.panel.showcase header {
  margin-bottom: 18px;
}

.panel.showcase header p {
  margin: 0 0 10px;
}

.panel.persona .persona-content {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.persona-editor,
.persona-summary {
  flex: 1 1 320px;
}

.persona-editor textarea {
  width: 100%;
  min-height: 220px;
  border-radius: 18px;
  border: 1px solid #c7d2fe;
  padding: 16px;
  font-size: 15px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: #f8fafc;
  resize: vertical;
}

.persona-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.status-text {
  margin: 0;
  font-size: 14px;
  color: #475569;
}

.status-text.error {
  color: #dc2626;
}

.persona-summary {
  border: 1px solid #e0e7ff;
  border-radius: 20px;
  padding: 18px;
  background: #f8fafc;
}

.persona-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.persona-grid article {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.persona-grid h3 {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #1d4ed8;
  font-size: 13px;
  border: 1px solid rgba(99, 102, 241, .25);
}

.pill.muted {
  background: #e2e8f0;
  color: #64748b;
  border-color: transparent;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.showcase-grid article {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #e0e7ff;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .05);
}

.showcase-grid article h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.showcase-grid article p {
  margin: 0;
  color: #475569;
  font-size: 15px;
}

.frame-wrapper {
  margin-top: 20px;
  border-radius: 22px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  background: #0f172a;
  position: relative;
}

iframe {
  width: 100%;
  min-height: 520px;
  border: none;
  background: #fff;
}

.frame-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #cbd5f5;
  background: rgba(15, 23, 42, .85);
}

.frame-empty.hidden {
  display: none;
}

.panel.highlights .highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.panel.highlights article {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #e0e7ff;
  background: #f8fafc;
}

.panel.roadmap header {
  margin-bottom: 18px;
}

.roadmap-progress {
  margin-bottom: 20px;
  color: #475569;
  font-size: 14px;
}

.progress-track {
  margin-top: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-value {
  --progress: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(120deg, #60a5fa, #34d399);
  width: var(--progress);
  transition: width .4s ease;
}

.roadmap-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roadmap-steps li {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #f8fafc;
}

.roadmap-steps li div p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 14px;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
}

.step-status {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.roadmap-steps li.done {
  border-color: rgba(34, 197, 94, .4);
}

.roadmap-steps li.done .step-status {
  background: rgba(34, 197, 94, .15);
  color: #15803d;
}

.roadmap-steps li.active {
  border-color: rgba(59, 130, 246, .4);
  box-shadow: 0 12px 30px rgba(59, 130, 246, .15);
}

.roadmap-steps li.active .step-status {
  background: rgba(59, 130, 246, .2);
  color: #1d4ed8;
}

.roadmap-steps li.upcoming {
  opacity: .85;
}

.roadmap-steps li.upcoming .step-status {
  background: #e2e8f0;
  color: #475569;
}

.panel.story {
  background: linear-gradient(135deg, #0f172a, #312e81);
  color: #fff;
}

.panel.story p {
  color: rgba(248, 250, 252, .8);
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.story-actions .ghost {
  border-color: rgba(248, 250, 252, .5);
  color: #fff;
}

footer {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

@media (max-width: 720px) {
  .hero {
    padding: 32px 24px;
  }

  .panel {
    padding: 24px;
  }

  .flow-list {
    grid-template-columns: 1fr;
  }

  .persona-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  iframe {
    min-height: 420px;
  }
}
