:root {
  --navy: #12233f;
  --navy-2: #1b3357;
  --red: #b22234;
  --gold: #c9a227;
  --paper: #f7f5f0;
  --ink: #22262b;
  --muted: #5b6470;
  --line: #dcd7cc;
  --ok: #1e7d46;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 4px solid var(--red);
}
.brand { font-size: 1.25rem; font-weight: bold; letter-spacing: 0.06em; }
.brand .num { color: var(--gold); }
.brand small { display: block; font-size: 0.7rem; font-weight: normal; letter-spacing: 0.12em; color: #c9d4e6; }
.container { max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 1.7rem; color: var(--navy); margin-bottom: 10px; }
h2 { font-size: 1.2rem; color: var(--navy); margin: 22px 0 8px; }
p.lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 18px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(18, 35, 63, 0.07);
}
.notice {
  background: #fdf6e3;
  border: 1px solid var(--gold);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.92rem;
  margin: 14px 0;
}
.notice strong { color: var(--navy); }
.warn {
  background: #fbeeee;
  border: 1px solid #e3b8bc;
  border-left: 5px solid var(--red);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.92rem;
  margin: 14px 0;
}
label { display: block; font-size: 0.85rem; font-weight: bold; color: var(--navy); margin: 12px 0 4px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-2); border-color: var(--navy-2); }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > div { flex: 1 1 200px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 0.92rem; }
.checkline input { width: auto; margin-top: 4px; }
button, .btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 22px;
  font-size: 1.02rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  margin-top: 16px;
}
button:hover { background: #971d2c; }
button.secondary { background: var(--navy-2); }
button.secondary:hover { background: var(--navy); }
button:disabled { background: #9aa3ae; cursor: not-allowed; }
.linklike { background: none; border: none; color: var(--navy-2); text-decoration: underline; cursor: pointer; font-size: 0.9rem; padding: 0; margin: 10px 0 0; font-weight: normal; }
.error-msg { color: var(--red); font-size: 0.92rem; margin-top: 10px; min-height: 1.2em; font-weight: bold; }
.ok-msg { color: var(--ok); font-size: 0.92rem; margin-top: 10px; }
footer {
  max-width: 980px;
  margin: 30px auto;
  padding: 0 20px 40px;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
a { color: var(--navy-2); }
/* Analyzer page */
.dropzone {
  border: 2px dashed var(--navy-2);
  border-radius: 10px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: #fff;
}
.dropzone.dragover { background: #eef3fb; border-color: var(--red); }
.report {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  margin: 18px 0;
  overflow-x: auto;
}
.report table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 0.9rem; }
.report th, .report td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.report th { background: var(--navy); color: #fff; }
.report h1, .report h2, .report h3 { color: var(--navy); margin: 18px 0 8px; }
.report blockquote { border-left: 4px solid var(--gold); padding: 6px 14px; margin: 10px 0; background: #fdf9ec; font-style: italic; }
.report ul, .report ol { margin: 8px 0 8px 24px; }
.report code { background: #f0ede6; padding: 1px 5px; border-radius: 4px; font-size: 0.88em; }
.report pre { background: #f0ede6; padding: 12px; border-radius: 6px; overflow-x: auto; }
.doclist { list-style: none; }
.doclist li { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 0.92rem; }
.doclist li:hover { background: #eef3fb; }
.progress { font-size: 0.9rem; color: var(--navy-2); margin-top: 10px; font-weight: bold; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.qa-item { margin: 14px 0; animation: fadeUp 0.5s ease both; }
.qa-q { font-weight: bold; color: var(--navy); background: #eef3fb; padding: 10px 14px; border-radius: 8px 8px 0 0; border: 1px solid var(--line); border-bottom: none; }
.hidden { display: none; }

/* ---------- motion & polish ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes scanline { 0% { top: 8%; } 50% { top: 84%; } 100% { top: 8%; } }
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(178, 34, 52, 0.35); } 50% { box-shadow: 0 0 0 10px rgba(178, 34, 52, 0); } }
@keyframes barSlide { from { background-position: 0 0; } to { background-position: 32px 0; } }
@keyframes bannerShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes orbitDot { from { transform: rotate(0deg) translateX(52px); } to { transform: rotate(360deg) translateX(52px); } }

.topbar { position: relative; }
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--navy-2), var(--red));
  background-size: 300% 100%;
  animation: bannerShift 8s ease infinite;
}
.card { animation: fadeUp 0.5s ease both; transition: box-shadow 0.25s ease; }
.card:hover { box-shadow: 0 4px 14px rgba(18, 35, 63, 0.10); }
button, .btn { transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(18, 35, 63, 0.18); }
h1 { animation: fadeUp 0.45s ease both; }
.report { animation: fadeUp 0.7s ease both; }

/* ---------- analysis theater ---------- */
.analysis-theater {
  margin-top: 18px;
  padding: 26px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fdfcf9, #f4f1ea);
  text-align: center;
  animation: fadeUp 0.4s ease both;
}
.doc-scan {
  width: 76px; height: 98px;
  margin: 0 auto 16px;
  position: relative;
  border: 2px solid var(--navy-2);
  border-radius: 8px;
  background: repeating-linear-gradient(#fff, #fff 9px, #e8ecf3 10px, #fff 11px);
  overflow: hidden;
  animation: pulseGlow 2.4s ease infinite;
}
.doc-scan .beam {
  position: absolute; left: 6%; right: 6%;
  height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: scanline 2.2s ease-in-out infinite;
}
.orbit-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.orbit-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: orbitDot 3.2s linear infinite; }
.theater-title { font-weight: bold; color: var(--navy); font-size: 1.05rem; }
.progress-track {
  height: 9px; max-width: 460px;
  margin: 14px auto;
  border-radius: 6px;
  background: #e7e2d7;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 4%;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, var(--red) 0 12px, #d0576a 12px 24px);
  background-size: 32px 32px;
  animation: barSlide 0.8s linear infinite;
  transition: width 0.8s ease;
}
.stage-list { list-style: none; max-width: 470px; margin: 6px auto 0; text-align: left; }
.stage-list li {
  padding: 7px 0 7px 32px;
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.4s ease;
}
.stage-list li::before {
  content: '';
  position: absolute; left: 7px; top: 11px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  transition: all 0.4s ease;
}
.stage-list li.active { color: var(--navy); font-weight: bold; }
.stage-list li.active::before { border-color: var(--red); background: var(--red); animation: pulseGlow 1.5s ease infinite; }
.stage-list li.done { color: var(--ok); }
.stage-list li.done::before { border-color: var(--ok); background: var(--ok); animation: none; }
.stage-list li.done::after {
  content: '✓';
  position: absolute; left: 9px; top: 5px;
  color: #fff; font-size: 9px; font-weight: bold;
}
.theater-note { font-size: 0.85rem; color: var(--muted); margin-top: 12px; }

/* ---------- citation badges ---------- */
.cite {
  background: #fdf3d7;
  border: 1px solid var(--gold);
  border-radius: 5px;
  padding: 0 5px;
  font-size: 0.85em;
  font-style: normal;
  color: #6b5410;
  white-space: nowrap;
}
