:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --paper: #fffdf7;
  --card: #ffffff;
  --accent: #3563ff;
  --accent-dark: #2147c7;
  --sun: #ffe48c;
  --line: #e5e7ef;
  --good: #0f9f6e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff2ba, transparent 28rem), linear-gradient(135deg, #f7f9ff 0%, #fffdf7 100%);
}

.app {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-dark);
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(34px, 5vw, 56px); line-height: .98; margin-bottom: 12px; }
h2 { font-size: 24px; margin-bottom: 6px; }
h3 { font-size: 19px; margin-bottom: 12px; }
.lede { font-size: 18px; line-height: 1.55; color: #344054; max-width: 680px; }

.status-card, .panel {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(30, 41, 59, .08);
  border-radius: 24px;
}

.status-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 2px solid #111827;
  background: var(--sun);
}
.status-card span, .status-card small { color: #344054; }
.status-card strong { font-size: 28px; margin: 8px 0; }

.panel { padding: 22px; margin-bottom: 16px; }
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.section-heading p { color: var(--muted); margin-bottom: 0; line-height: 1.4; }
.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #ecf3ff;
  color: var(--accent-dark);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.button {
  appearance: none;
  border: 1px solid #cfd5e6;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  min-height: 46px;
}
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button:active { transform: translateY(1px); }

.mini-preview {
  margin-top: 18px;
  padding: 18px;
  border: 2px dashed #b8c1d9;
  border-radius: 18px;
  background: var(--paper);
}
.preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.preview-grid span { padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-family: "Comic Sans MS", cursive; font-size: 19px; }

.upload-box {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  border: 2px dashed #98a6c9;
  border-radius: 22px;
  background: #f8fbff;
  text-align: center;
  cursor: pointer;
  padding: 22px;
}
.upload-box input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon { font-size: 42px; }
.upload-box small, .hint, .history-meta { color: var(--muted); }

.preview-wrap { margin-top: 16px; }
.preview-wrap img { max-width: 100%; max-height: 420px; border-radius: 16px; border: 1px solid var(--line); display: block; }
.hidden { display: none; }

.field { display: grid; gap: 8px; margin-top: 16px; font-weight: 800; }
textarea {
  width: 100%;
  border: 1px solid #cfd5e6;
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  resize: vertical;
  min-height: 110px;
}

.link-button {
  background: none;
  border: 0;
  color: var(--accent-dark);
  font-weight: 800;
  cursor: pointer;
  padding: 8px;
}
.history { display: grid; gap: 10px; }
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}
.history-item p { margin: 4px 0; color: #344054; }
.history-open { color: var(--accent-dark); font-weight: 800; }
.roadmap ol { padding-left: 22px; line-height: 1.6; }

.grading-card { margin-top: 16px; border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fffdf7; }
.grading-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 9px; margin-top: 12px; }
.grade-row { display: grid; gap: 5px; border: 1px solid #e5e7ef; border-radius: 13px; padding: 10px; background: white; }
.grade-row label { font-size: 13px; font-weight: 800; }
.grade-row small { color: var(--muted); }
.grade-row select { width: 100%; border: 1px solid #cfd5e6; border-radius: 10px; padding: 8px; background: white; font: inherit; }

.analysis-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  padding: 14px;
  line-height: 1.5;
  color: #344054;
}
.analysis-box ul { margin: 8px 0 0; padding-left: 20px; }
.loading { opacity: .65; pointer-events: none; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; }
  .preview-grid { grid-template-columns: 1fr; }
  .button { width: 100%; text-align: center; }
}
