:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e5e7eb;
  --primary: #2454d6;
  --primary-dark: #1e3fa5;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #111827;
  color: white;
}
.topbar a { color: white; margin-left: 16px; }
.brand { font-weight: 700; margin-left: 0 !important; }
.container { max-width: 1160px; margin: 0 auto; padding: 28px 20px 80px; }
.hero {
  background: linear-gradient(135deg, #ffffff, #eef3ff);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.04);
}
.card h2, .card h3 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: #ecfdf3; color: var(--ok); }
.badge.warn { background: #fffaeb; color: var(--warn); }
.badge.danger { background: #fef3f2; color: var(--danger); }
form.stack { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label { display: grid; gap: 6px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid textarea { min-height: 92px; }
.question-list { display: grid; gap: 12px; }
.question-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #f9fafb; }
.question-item p { margin: 0 0 10px; }
label { font-weight: 600; font-size: 14px; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  font: inherit;
  background: white;
}
textarea { min-height: 120px; resize: vertical; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--primary-dark); text-decoration: none; }
button.secondary, .button.secondary { background: #344054; }
button.danger { background: var(--danger); }
button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #f9fafb; color: #344054; font-size: 13px; }
.asset-img { width: 100%; max-height: 260px; object-fit: contain; background: #f9fafb; border: 1px solid var(--line); border-radius: 12px; }
.asset-video { width: 100%; max-height: 360px; background: #0b1020; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
.story { white-space: pre-wrap; line-height: 1.75; }
.notice { border-left: 4px solid var(--primary); background: #eff6ff; padding: 12px 14px; border-radius: 10px; }
.error { border-left-color: var(--danger); background: #fef3f2; }
.section-divider { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.slideshow {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border-radius: 18px;
  background: #111827;
  color: white;
}
.slide {
  display: none;
  padding: 24px;
  text-align: center;
}
.slide.active { display: block; }
.slide img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 14px; background: white; }
.slide p { font-size: 20px; line-height: 1.5; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #0b1020; color: #d1e7ff; padding: 14px; border-radius: 12px; }
.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.56);
}
.busy-overlay[hidden] { display: none; }
.busy-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, 100%);
  padding: 24px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.24);
  text-align: center;
}
.busy-panel span { color: var(--muted); }
.busy-stage {
  position: relative;
  width: 158px;
  height: 108px;
  margin-bottom: 2px;
}
.busy-paper {
  position: absolute;
  left: 22px;
  top: 22px;
  width: 114px;
  height: 72px;
  border: 2px solid #d0d5dd;
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.1);
}
.busy-stroke {
  position: absolute;
  left: 18px;
  height: 7px;
  border-radius: 999px;
}
.busy-stroke-one {
  top: 18px;
  width: 72px;
  background: #2454d6;
}
.busy-stroke-two {
  top: 34px;
  width: 58px;
  background: #f04438;
}
.busy-stroke-three {
  top: 50px;
  width: 82px;
  background: #12b76a;
}
.busy-crayon {
  position: absolute;
  left: 36px;
  top: 12px;
  width: 76px;
  height: 18px;
  border-radius: 7px 3px 3px 7px;
  background: linear-gradient(90deg, #fdb022 0 68%, #f79009 68% 100%);
  box-shadow: 0 10px 18px rgba(181, 71, 8, 0.18);
  transform-origin: 86% 50%;
}
.busy-crayon::before,
.busy-crayon::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 2px;
  height: 12px;
  background: rgba(255, 255, 255, 0.65);
}
.busy-crayon::before { left: 14px; }
.busy-crayon::after { right: 18px; }
.busy-crayon-tip {
  position: absolute;
  right: -12px;
  top: 2px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid #7a2e0e;
}
.busy-spark {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #7a5af8;
}
.busy-spark-one {
  left: 10px;
  top: 22px;
}
.busy-spark-two {
  right: 18px;
  top: 10px;
  background: #12b76a;
}
.busy-spark-three {
  right: 8px;
  bottom: 20px;
  background: #f04438;
}
.busy-cancel {
  margin-top: 2px;
  min-width: 112px;
}
body.is-busy {
  cursor: wait;
}
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; gap: 10px; flex-direction: column; }
  .busy-stage {
    width: 144px;
    height: 102px;
  }
}
