/* StoryDraft visual theme. Component state and interaction rules remain in styles.css. */
@font-face {
  font-family: Manrope;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --paper: #fff;
  --white: #fff;
  --ink: #18191b;
  --muted: #65676c;
  --line: #e7e7e9;
  --accent: #d760ad;
  --accent-hover: #cf55a2;
  --accent-border: #bb3d8d;
  --accent-soft: #fbedf6;
  --accent-strong: #a32a77;
  --wash: #f7f7f8;
  --orange: #d760ad;
  --orange-dark: #bd3c90;
  --orange-soft: var(--accent-soft);
  --dark: #18191b;
  --green: #327251;
  --radius: 16px;
  --shadow: 0 8px 30px #18191b04;
  font-family: Manrope, Arial, Helvetica, sans-serif;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}
body {
  background: #fff;
  color: var(--ink);
  line-height: 1.6;
}
button,
input,
select {
  font: inherit;
}
:focus-visible {
  outline: 3px solid #3c64c5;
  outline-offset: 4px;
}
h1,
h2,
h3,
h4 {
  line-height: 1.22;
}
h2 {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -1px;
}
h3 {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.35px;
}
.skip-link {
  border-color: var(--ink);
  background: var(--accent);
  border-radius: 6px;
}
/* The workspace is centered, with a persistent new-course action. */
.app-shell {
  display: block;
  min-height: 100vh;
}
.workspace {
  min-width: 0;
}
.topbar {
  max-width: 1184px;
  height: auto;
  min-height: 77px;
  margin: 22px auto 0;
  padding: 16px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  gap: 24px;
  background: #fff;
}
.brand {
  gap: 10px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1.4px;
  white-space: nowrap;
}
.brand-mark {
  width: 31px;
  height: 34px;
  stroke-width: 2.3;
}
.brand-fold {
  stroke: #92939b;
}
.brand-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 2px;
  font-size: 0;
  padding: 0;
  background: var(--accent);
  border-radius: 50%;
  vertical-align: baseline;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 12px;
  font-weight: 600;
}
.header-nav a {
  text-decoration: none;
}
.header-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.domain-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
main {
  max-width: 1184px;
  margin: 0 auto;
  padding: 36px 24px 28px;
}
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 1fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 32px;
}
.eyebrow,
.mini-label {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.5px;
}
.eyebrow {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  margin-bottom: 19px;
  letter-spacing: 1.05px;
}
.eyebrow > span {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--accent-border);
}
h1 {
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(42px, 4.9vw, 66px);
  line-height: 1.16;
  letter-spacing: -3.8px;
}
h1 mark {
  color: inherit;
  background: var(--accent);
  padding: 0 8px 4px;
  margin-left: -2px;
  border-radius: 7px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.lede {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 24px;
  max-width: 535px;
}
.hero-format {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  margin-top: 17px;
  color: #56585f;
}
.hero-format svg {
  width: 16px;
  height: 16px;
}
/* Original file illustration. Motion is limited to its two source tokens. */
.draft-illustration {
  position: relative;
  height: 300px;
  width: 370px;
  max-width: 100%;
  justify-self: end;
}
.draft-ring {
  border: 1px solid #f0f0f2;
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 3px 12px #27283403;
}
.ring-outer {
  width: 310px;
  height: 310px;
  top: 0;
  left: 30px;
}
.ring-inner {
  width: 250px;
  height: 250px;
  top: 30px;
  left: 60px;
}
.draft-card {
  position: absolute;
  width: 210px;
  left: 77px;
  top: 43px;
  border: 1px solid #e4e4e7;
  border-radius: 13px;
  padding: 11px;
  background: #fff;
  transform: rotate(-6deg);
  box-shadow:
    0 16px 36px #22232b10,
    0 3px 5px #22232b05;
}
.draft-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.draft-card-top > span {
  display: flex;
  gap: 3px;
}
.draft-card-top i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d1d1d7;
}
.draft-card-top b {
  font-size: 9px;
  font-weight: 650;
}
.draft-cover {
  background: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding: 12px 7px;
  height: 83px;
}
.draft-cover svg {
  width: 67px;
  height: 60px;
  stroke-width: 2;
}
.draft-cover span {
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.draft-card-bottom {
  padding: 13px 5px 3px;
}
.draft-card-bottom > strong {
  font-size: 11px;
  display: block;
  margin-bottom: 9px;
  font-weight: 750;
}
.draft-card-bottom > span {
  display: block;
  height: 3px;
  border-radius: 3px;
  background: #e7e7e9;
  margin: 5px 0;
  width: 86%;
}
.draft-card-bottom > span + span {
  width: 60%;
}
.draft-card-bottom > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}
.draft-card-bottom i {
  font-style: normal;
  font-size: 7px;
  color: var(--muted);
}
.draft-card-bottom b {
  font-size: 7px;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  padding: 5px 9px;
  border-radius: 4px;
}
.draft-card-bottom em {
  font-style: normal;
  padding-left: 7px;
}
.source-token {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 81px;
  background: #fff;
  border: 1px solid #ebebef;
  border-radius: 11px;
  box-shadow: 0 5px 15px #2e33400a;
}
.source-token svg {
  width: 29px;
  height: 34px;
}
.source-token span {
  font-size: 9px;
  font-weight: 750;
  margin-top: 3px;
}
.token-doc {
  top: 13px;
  left: 18px;
  color: #456ccd;
  transform: rotate(-13deg);
  animation: float-doc 6s ease-in-out infinite;
}
.token-zip {
  bottom: 28px;
  right: 7px;
  color: #bd407d;
  transform: rotate(11deg);
  animation: float-zip 6s ease-in-out infinite;
  animation-delay: -3s;
}
.orbit-dot {
  position: absolute;
  border-radius: 50%;
}
.dot-one {
  width: 10px;
  height: 10px;
  top: 14px;
  right: 68px;
  background: var(--accent);
}
.dot-two {
  width: 6px;
  height: 6px;
  bottom: 35px;
  left: 34px;
  background: #d3d4dd;
}
.illustration-note {
  position: absolute;
  bottom: -9px;
  width: 100%;
  text-align: center;
  color: #85858e;
  font-size: 9px;
}
@keyframes float-doc {
  50% {
    transform: translateY(-7px) rotate(-9deg);
  }
}
@keyframes float-zip {
  50% {
    transform: translateY(6px) rotate(7deg);
  }
}
body:not([data-state="upload"]) .page-heading,
body:not([data-state="upload"]) .how-link {
  display: none;
}
body:not([data-state="upload"]) main {
  padding-top: 36px;
}
.workflow {
  gap: 32px;
  margin: 0 0 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.workflow li,
.workflow li + li {
  padding: 0;
  gap: 12px;
  color: #75777e;
  min-width: 0;
}
.workflow li::after {
  display: none;
}
.workflow li + li::before {
  content: "→";
  position: absolute;
  left: -29px;
  color: #c3c4c9;
  font-size: 16px;
}
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #fff;
  border-color: var(--line);
  font-size: 10px;
  font-weight: 750;
  flex-shrink: 0;
}
.workflow b {
  font-size: 12px;
  font-weight: 750;
}
.workflow small {
  font-size: 10px;
  color: #73757d;
  margin-top: 2px;
}
.workflow .active {
  color: var(--ink);
}
.workflow .active .step-number {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.workflow .complete .step-number {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
/* Upload is the primary action, with source processing notes nearby. */
.upload-layout {
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr);
  gap: 44px;
  align-items: start;
}
.upload-panel {
  padding: 26px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-heading h2 {
  font-size: 21px;
  letter-spacing: -0.6px;
  margin: 0;
}
.panel-heading p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.upload-format-label {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
  color: var(--muted);
}
.drop-zone {
  margin-top: 23px;
  padding: 26px 16px 22px;
  border: 1.5px dashed #cfd0d6;
  border-radius: 12px;
  background: #fafafb;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.drop-zone.drag-over {
  border: 1.5px dashed var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-border);
  padding: 26px 16px 22px;
  transform: none;
}
.upload-icon {
  width: 53px;
  height: 56px;
  background: #fff;
  border: 1px solid #e5e5e9;
  border-radius: 11px;
  margin: 0 auto 16px;
  box-shadow: 0 3px 6px #18191b04;
  transform: none;
}
.upload-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.5;
  color: #555966;
  transform: none;
}
.drop-zone h3 {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.5px;
}
.drop-zone > p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.button {
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  transition:
    background 0.18s,
    border-color 0.18s,
    box-shadow 0.18s;
}
.button:hover:not(:disabled) {
  transform: none;
}
.button > span {
  font-size: 17px;
  font-weight: 500;
  margin-left: 8px;
}
.button-dark {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}
.button-dark:hover:not(:disabled) {
  background: #383a40;
  border-color: #383a40;
}
.button-primary {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent-border);
}
.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-strong);
  box-shadow: none;
}
.button-quiet,
.button-outline {
  background: #fff;
  border-color: #dcdde1;
  color: #45474f;
}
.button-quiet:hover:not(:disabled),
.button-outline:hover:not(:disabled) {
  border-color: #b5b7c0;
  background: var(--wash);
}
.button-large {
  min-height: 52px;
  padding: 15px 27px;
  font-size: 13px;
}
.header-action {
  min-height: 40px;
  font-size: 11px;
  padding: 9px 16px;
}
.drop-zone .button {
  margin-top: 19px;
  min-width: 159px;
}
.file-hint {
  font-size: 10px;
  color: #70727a;
  margin: 15px auto 0;
  max-width: 440px;
  line-height: 1.7;
}
.upload-footnote {
  gap: 7px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
}
.processing-notes {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f2;
}
.processing-notes:not(:has(> :not([hidden]))) {
  display: none;
}
.image-context-disclosure {
  font-size: 10px;
  line-height: 1.7;
  margin-top: 8px;
}
.expect-panel {
  display: block;
  min-width: 0;
  padding: 22px 2px 0;
  scroll-margin-top: 28px;
}
.expect-panel > .mini-label {
  color: #777984;
  font-size: 9px;
  letter-spacing: 1.1px;
}
.expect-panel h2 {
  font-family: inherit;
  margin-top: 12px;
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 750;
  line-height: 1.22;
}
.expect-list {
  margin: 25px 0 0;
}
.expect-list li {
  gap: 15px;
  margin-bottom: 19px;
}
.expect-list li > span {
  font-family: inherit;
  font-size: 10px;
  font-weight: 650;
  min-width: 20px;
  color: #8c8f98;
  padding-top: 3px;
}
.expect-list h3 {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
  letter-spacing: -0.1px;
}
.expect-list p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  max-width: 300px;
}
.source-note {
  gap: 10px;
  padding-top: 17px;
  margin-top: 22px;
  color: var(--muted);
}
.source-note p {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
}
.source-note svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
.page-footer {
  gap: 24px;
  margin-top: 42px;
  padding-top: 24px;
  font-size: 11px;
  color: var(--muted);
}
.page-footer .footer-brand {
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
  font-size: 15px;
}
.footer-brand > span {
  color: var(--accent-strong);
}
.footer-brand small {
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0;
  margin-left: 15px;
  color: var(--muted);
}
.page-footer > span:last-child {
  gap: 16px;
  color: var(--muted);
}
/* Restyle every conversion state while retaining its behavior and structure. */
.notice {
  border-radius: 11px;
  font-size: 12px;
}
.notice p,
.notice li {
  line-height: 1.75;
}
.notice-error {
  color: #933d37;
  background: #fff4f2;
  border-color: #f0cfc9;
}
.notice-warning {
  color: #735823;
  background: #fffae9;
  border-color: #eee0ab;
}
.source-readiness {
  color: #426650;
  background: #f4f8f4;
  border-color: #dce9dd;
}
.text-button {
  font-weight: 700;
}
.text-button:hover {
  text-underline-offset: 3px;
}
.progress-panel {
  padding: 58px 28px 46px;
  min-height: 410px;
}
.progress-orbit {
  width: 70px;
  height: 70px;
  margin-bottom: 25px;
}
.progress-orbit > span:first-child {
  border-color: #efeff1;
  border-top-color: #aaaeb8;
}
.progress-orbit > span:last-child {
  inset: 21px;
  background: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 7px;
}
.progress-panel > .mini-label,
.ready-panel > .mini-label,
.section-heading .mini-label,
.ai-panel .mini-label {
  color: var(--muted);
}
.progress-panel h2,
.section-heading h2,
.ready-panel h2 {
  font-family: inherit;
  font-weight: 750;
  letter-spacing: -1.3px;
}
.progress-panel h2:focus-visible,
.section-heading h2:focus-visible,
.ready-panel h2:focus-visible {
  outline: none;
}
.progress-panel h2 {
  font-size: 36px;
}
.progress-panel > p:not(.mini-label) {
  color: var(--muted);
}
.progress-panel .progress-reassurance {
  color: var(--muted) !important;
  font-size: 11px !important;
}
.file-chip {
  background: var(--wash);
  color: #545862;
  padding: 12px 14px;
  border-radius: 7px;
}
.file-chip small {
  color: var(--muted);
  font-size: 10px;
}
.progress-track progress {
  min-width: 0;
  background: #efeff1;
}
.progress-track progress::-webkit-progress-bar {
  background: #efeff1;
}
.progress-track progress::-webkit-progress-value {
  background: var(--accent-strong);
}
.progress-track progress::-moz-progress-bar {
  background: var(--accent-strong);
}
.progress-track > span {
  color: var(--muted);
}
.section-heading h2 {
  font-size: 35px;
}
.section-heading p:not(.mini-label) {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.review-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 22px;
}
.course-settings,
.content-summary {
  padding: 26px;
  min-width: 0;
}
.panel-topline h3 {
  font-size: 15px;
  font-weight: 750;
}
.tag {
  background: #f1f2f4;
  color: #666b75;
  font-size: 10px;
  font-weight: 650;
  white-space: normal;
}
.course-settings label,
.customization-panel label {
  font-size: 11px;
  color: var(--ink);
  font-weight: 700;
}
input[type="text"],
input[type="number"],
select,
.course-settings input,
.mapping-selection select {
  border-color: #dcdde3;
  background: #fff;
  border-radius: 7px;
  min-height: 44px;
  color: #24262d;
  font-size: 12px;
}
.course-settings input:hover,
input:hover,
select:hover {
  border-color: #aaadb8;
}
input[aria-invalid="true"] {
  border-color: #a2443a;
  background: #fff7f5;
}
.field-help {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.source-file-line,
.accent-line {
  font-size: 11px;
}
.source-file-line .muted,
.accent-line .muted,
.stat-grid > div > span,
.content-summary > p,
.content-summary > .mini-label {
  color: var(--muted);
}
.accent-value {
  font-size: 10px;
}
.tiny-dot {
  background: var(--accent);
}
.stat-grid strong {
  font-family: inherit;
  font-size: 39px;
  font-weight: 750;
  letter-spacing: -2px;
}
.stat-grid > div {
  gap: 10px;
}
.customization-panel {
  padding: 26px;
}
.customization-panel .mini-label {
  color: var(--muted);
}
.color-controls {
  flex-wrap: wrap;
}
input[type="color"] {
  background: #fff;
  border-color: #dcdde3;
}
.color-preview {
  border-color: #e5e5eb;
  border-top-color: var(--preview-accent);
  background: #fafafb;
}
.preview-kicker,
.customization-save-note,
.percentage-control span {
  color: var(--muted);
}
.preview-lines i {
  background: #e2e3e8;
}
.ai-panel,
.image-context-panel {
  padding: 26px;
  margin: 22px 0;
}
.ai-intro,
.ai-provider,
.ai-list small,
.ai-placement-summary {
  color: var(--muted);
}
.ai-image-choice input {
  accent-color: var(--ink);
}
.ai-setup {
  background: var(--wash);
  color: var(--muted);
}
.ai-error {
  background: #fff4f2;
  color: #933d37;
}
.ai-list li {
  border-color: var(--line);
  background: #fafafb;
  border-radius: 7px;
  line-height: 1.8;
}
.ai-list strong {
  font-size: 12px;
}
.ai-list .ai-finding-warning {
  background: #fffae9;
  border-color: #eee0ab;
  color: #735823;
}
.lesson-details summary {
  font-size: 13px;
  font-weight: 750;
}
.details-icon,
.lesson-details summary > svg,
.lesson-list li::before {
  color: #858995;
}
.lesson-details summary > .muted,
.lesson-list small {
  color: var(--muted);
}
.lesson-list li {
  border-top-color: #efeff2;
  font-size: 12px;
  line-height: 1.7;
}
.lesson-list li > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.mapping-group {
  min-width: 0;
  border-radius: 12px;
}
.mapping-group legend {
  font-size: 14px;
  font-weight: 750;
}
.mapping-context {
  color: var(--muted);
  font-size: 12px;
}
.mapping-slot {
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 20px;
  padding: 18px 0;
  border-top-color: var(--line);
}
.mapping-selection label {
  font-size: 12px;
  font-weight: 700;
}
.mapping-preview {
  height: 122px;
  border-color: var(--line);
  background: var(--wash);
  border-radius: 8px;
  color: var(--muted);
}
.mapping-reset {
  margin-top: 9px;
}
.mapping-empty-note {
  color: #8e4a37;
  font-size: 11px;
}
.build-bar {
  align-items: center;
  gap: 22px;
}
.build-bar p {
  font-size: 12px;
  font-weight: 650;
}
.build-bar small {
  color: var(--muted);
  font-size: 10px;
}
.build-bar .button {
  min-height: 48px;
}
.ready-panel {
  padding: 42px 30px 28px;
}
.success-mark {
  width: 69px;
  height: 69px;
  background: var(--accent);
  color: var(--ink);
  border: 0;
  border-radius: 20px;
  transform: rotate(-6deg);
}
.success-mark svg {
  width: 44px;
  height: 44px;
  transform: rotate(6deg);
}
.ready-panel h2 {
  font-size: 39px;
  letter-spacing: -1.5px;
}
.ready-description {
  color: var(--muted);
  font-size: 13px;
}
.download-file {
  max-width: 600px;
  background: #fafafb;
  border-color: var(--line);
  border-radius: 10px;
}
.story-file-mark {
  background: #fff;
  color: var(--ink);
  border: 1px solid #dedfe6;
  border-radius: 7px;
  box-shadow: 3px 3px 0 var(--accent);
}
.download-file h3 {
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.download-file p,
.download-note,
.ready-actions {
  color: var(--muted);
}
.tag-success {
  background: #eaf3ed;
  color: #38624a;
}
.ready-notes {
  max-width: 600px;
  background: #fffae9;
  border: 1px solid #eee0ab;
  border-radius: 9px;
  color: #735823;
}
.recent-conversions {
  padding: 24px 26px;
}
.recent-heading h2 {
  font-size: 20px;
  letter-spacing: -0.6px;
}
.recent-heading p {
  color: var(--muted);
}
.history-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
  margin: 18px 0 10px;
}
.history-stat {
  background: #f7f7fa;
  border: 1px solid #e6e7ee;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-stat-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.history-stat strong {
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.06em;
}
.history-stat-error {
  background: #fff3f3;
  border-color: #f1d4d2;
}
.history-summary-label {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.history-quota {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.history-quota-full {
  color: #8f5a20;
  font-weight: 600;
}
.history-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 0 0;
}
.history-search-wrap,
.history-filter-wrap {
  display: block;
}
.history-search,
.history-status-filter {
  min-height: 38px;
  border: 1px solid #dfe3ec;
  border-radius: 8px;
  background: #fff;
  color: #2c2f36;
  padding: 0 12px;
  font: inherit;
}
.history-search {
  min-width: 220px;
  width: min(100%, 320px);
}
.history-status-filter {
  min-width: 130px;
}
.history-list li {
  padding: 17px 0;
}
.history-details h3 {
  font-weight: 700;
  line-height: 1.65;
}
.history-status {
  color: var(--muted);
}
.history-actions .button,
.history-remove {
  min-height: 38px;
}
.history-remove {
  color: #787984;
}
.history-error,
.history-remove:hover:not(:disabled) {
  color: #933d37;
}
@media (min-width: 1450px) {
  main {
    padding-top: 36px;
  }
}
@media (max-width: 1200px) {
  .topbar {
    margin-left: 24px;
    margin-right: 24px;
  }
  main {
    padding-left: 40px;
    padding-right: 40px;
  }
  .page-heading {
    gap: 12px;
  }
  h1 {
    font-size: clamp(42px, 5.25vw, 62px);
    letter-spacing: -3px;
  }
  .draft-illustration {
    transform: scale(0.92);
    transform-origin: center right;
  }
  .upload-layout {
    gap: 32px;
  }
}
@media (max-width: 960px) {
  .header-nav {
    gap: 22px;
  }
  .domain-label {
    display: none;
  }
  .page-heading {
    grid-template-columns: minmax(0, 1fr) 260px;
    margin-bottom: 34px;
  }
  h1 {
    font-size: 47px;
    letter-spacing: -2.6px;
  }
  .draft-illustration {
    width: 340px;
    max-width: none;
    transform: scale(0.77);
    margin-right: -10px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 0.7px;
  }
  .lede {
    font-size: 13px;
  }
  .wide-break {
    display: none;
  }
  .upload-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(220px, 1fr);
    gap: 25px;
  }
  .upload-panel {
    padding: 22px;
  }
  .upload-format-label {
    display: none;
  }
  .panel-heading h2 {
    font-size: 19px;
  }
  .expect-panel h2 {
    font-size: 26px;
  }
}
@media (max-width: 760px) {
  .topbar {
    margin: 14px 20px 0;
    padding: 13px 16px;
    min-height: 68px;
  }
  .brand {
    font-size: 23px;
  }
  .brand-mark {
    width: 28px;
    height: 30px;
  }
  .header-nav {
    gap: 15px;
  }
  .how-link {
    display: none;
  }
  .header-action {
    font-size: 10px;
    min-height: 38px;
    padding: 9px 12px;
  }
  main {
    padding: 35px 28px 24px;
  }
  .page-heading {
    display: block;
    position: relative;
    margin-bottom: 29px;
  }
  .hero-copy {
    max-width: 550px;
  }
  h1 {
    font-size: 54px;
    line-height: 1.18;
    letter-spacing: -3px;
  }
  .draft-illustration {
    display: none;
  }
  .lede {
    max-width: 430px;
    font-size: 13px;
    margin-top: 21px;
  }
  .hero-format {
    margin-top: 16px;
  }
  .workflow {
    gap: 16px;
    padding: 18px 0;
    margin-bottom: 24px;
  }
  .workflow li {
    align-items: flex-start;
    gap: 8px;
  }
  .workflow li + li::before {
    display: none;
  }
  .workflow b {
    font-size: 11px;
  }
  .workflow small {
    font-size: 9px;
    line-height: 1.6;
  }
  .step-number {
    width: 26px;
    height: 28px;
    font-size: 9px;
    border-radius: 7px;
  }
  .upload-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .upload-panel {
    padding: 24px;
  }
  .panel-heading h2 {
    font-size: 22px;
  }
  .upload-format-label {
    display: inline-block;
  }
  .expect-panel {
    padding: 10px 4px 0;
  }
  .expect-panel h2 br {
    display: none;
  }
  .expect-panel h2 {
    font-size: 28px;
  }
  .expect-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 23px;
  }
  .expect-list li {
    display: block;
    margin-bottom: 0;
  }
  .expect-list li > span {
    display: block;
    margin-bottom: 8px;
  }
  .expect-list h3 {
    font-size: 12px;
  }
  .source-note {
    max-width: 480px;
  }
  .section-heading {
    align-items: flex-start;
  }
  .section-heading h2 {
    font-size: 30px;
  }
  .section-heading > .button {
    font-size: 10px;
  }
  .review-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .course-settings,
  .content-summary,
  .customization-panel,
  .ai-panel,
  .image-context-panel {
    padding: 23px;
  }
  .build-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
  .build-bar .button {
    width: 100%;
  }
  .mapping-slot {
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 15px;
  }
  .mapping-preview {
    height: 100px;
  }
  .ready-panel h2 {
    font-size: 34px;
  }
  .ready-panel {
    padding: 34px 24px 26px;
  }
  .footer-brand small {
    display: block;
    margin: 5px 0 0;
  }
  .page-footer {
    align-items: flex-start;
  }
}
@media (max-width: 480px) {
  .topbar {
    margin: 12px 14px 0;
    padding: 12px 13px;
    border-radius: 12px;
    gap: 10px;
  }
  .brand {
    font-size: 22px;
    gap: 7px;
  }
  .brand-mark {
    width: 25px;
    height: 28px;
  }
  .header-action {
    min-height: 36px;
    gap: 3px;
    padding: 8px 11px;
  }
  .header-action > span {
    margin-left: 4px;
    font-size: 14px;
  }
  main {
    padding: 33px 20px 23px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 0.8px;
    margin-bottom: 17px;
  }
  h1 {
    font-size: clamp(33px, 9.8vw, 46px);
    letter-spacing: -2.3px;
  }
  h1 mark {
    padding: 0 5px 3px;
    border-radius: 5px;
  }
  .lede {
    font-size: 12px;
    line-height: 1.85;
    margin-top: 21px;
  }
  .hero-format {
    font-size: 10px;
  }
  .workflow {
    gap: 12px;
  }
  .workflow li {
    display: block;
  }
  .step-number {
    margin-bottom: 8px;
  }
  .workflow b {
    font-size: 10px;
    line-height: 1.5;
  }
  .workflow small {
    display: none;
  }
  .upload-panel {
    padding: 19px;
    border-radius: 13px;
  }
  .panel-heading h2 {
    font-size: 19px;
  }
  .panel-heading p {
    font-size: 11px;
  }
  .upload-format-label {
    display: none;
  }
  .drop-zone {
    padding: 23px 12px 20px;
  }
  .drop-zone h3 {
    font-size: 15px;
  }
  .drop-zone > p {
    font-size: 11px;
  }
  .file-hint {
    font-size: 9px;
  }
  .expect-panel {
    padding-top: 2px;
  }
  .expect-panel h2 {
    font-size: 26px;
  }
  .expect-list {
    display: block;
  }
  .expect-list li {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
  }
  .expect-list li > span {
    margin-bottom: 0;
  }
  .expect-list p {
    max-width: none;
  }
  .expect-list h3 {
    font-size: 12px;
  }
  .recent-conversions {
    padding: 21px 19px;
  }
  .recent-heading {
    align-items: flex-start;
    gap: 10px;
  }
  .recent-heading h2 {
    font-size: 18px;
  }
  .history-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .history-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 20px;
  }
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .section-heading h2 {
    font-size: 28px;
  }
  .section-heading .mini-label {
    font-size: 8px;
  }
  .notice {
    padding: 18px 16px;
    gap: 10px;
    font-size: 11px;
  }
  .course-settings,
  .content-summary,
  .customization-panel,
  .ai-panel,
  .image-context-panel {
    padding: 21px 18px;
  }
  .panel-topline {
    gap: 10px;
    flex-wrap: wrap;
  }
  .panel-topline h3 {
    font-size: 14px;
  }
  .stat-grid strong {
    font-size: 36px;
  }
  .lesson-details summary {
    padding: 18px 17px;
    gap: 8px;
    font-size: 12px;
  }
  .lesson-details summary > .muted {
    font-size: 9px;
  }
  .lesson-list {
    padding: 0 17px 12px;
  }
  .lesson-list li {
    gap: 10px;
    flex-wrap: wrap;
  }
  .lesson-list small {
    margin-left: 30px;
  }
  .mapping-group {
    padding: 19px 17px;
  }
  .mapping-slot {
    grid-template-columns: minmax(0, 1fr);
  }
  .mapping-preview {
    height: 160px;
  }
  .mapping-selection select {
    max-width: 100%;
  }
  .ready-panel {
    padding: 32px 18px 23px;
  }
  .ready-panel h2 {
    font-size: 30px;
  }
  .ready-description {
    font-size: 12px;
  }
  .download-file {
    gap: 12px;
    padding: 15px 12px;
  }
  .download-file .tag {
    display: none;
  }
  .download-file h3 {
    font-size: 12px;
  }
  .story-file-mark {
    width: 44px;
    height: 54px;
    font-size: 9px;
  }
  #download-story {
    width: 100%;
  }
  .ready-actions {
    gap: 18px;
  }
  .progress-panel {
    padding: 40px 20px 33px;
  }
  .progress-panel h2 {
    font-size: 29px;
  }
  .file-chip {
    font-size: 10px;
    padding: 10px;
  }
  .file-chip small {
    font-size: 9px;
  }
  .page-footer {
    margin-top: 30px;
    gap: 16px;
  }
  .page-footer > span:last-child {
    font-size: 10px;
    gap: 7px;
  }
  .footer-brand small {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Phase 4: Billing, Plans & Pricing Modal --- */
.auth-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-session-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-badge-free {
  background: #f0f0f2;
  color: #4a4a52;
}
.plan-badge-pro {
  background: #e9dff7;
  color: #58248c;
}
.plan-badge-team {
  background: #d4edda;
  color: #155724;
}

.pricing-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 920px;
  width: 94vw;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
  background: #ffffff;
  color: #1a1a1f;
}
.pricing-modal::backdrop {
  background: rgba(10, 10, 14, 0.6);
  backdrop-filter: blur(4px);
}
.pricing-modal-content {
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}
.pricing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.pricing-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 4px 0 6px;
  letter-spacing: -0.02em;
}
.pricing-subtitle {
  color: var(--muted, #686873);
  font-size: 14px;
  margin: 0;
}
.modal-close-btn {
  background: none;
  border: 1px solid #e2e2e6;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #686873;
}
.modal-close-btn:hover {
  background: #f4f4f6;
  color: #1a1a1f;
}

.billing-interval-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}
.interval-label {
  font-size: 14px;
  font-weight: 500;
  color: #71717a;
}
.interval-label.active {
  color: #18181b;
  font-weight: 600;
}
.save-badge {
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
}
.cycle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #e4e4e7;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
.cycle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.cycle-switch[aria-checked="true"] {
  background: #7931aa;
}
.cycle-switch[aria-checked="true"]::after {
  transform: translateX(20px);
}

.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 860px) {
  .pricing-cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.pricing-card {
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  position: relative;
}
.pricing-card-featured {
  border: 2px solid #7931aa;
  box-shadow: 0 8px 24px rgba(121, 49, 170, 0.12);
}
.featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #7931aa;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 10px;
  border-radius: 999px;
}
.pricing-card-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}
.pricing-card-desc {
  font-size: 12px;
  color: #71717a;
  min-height: 32px;
  margin: 0 0 16px;
}
.price-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 20px;
}
.price-amount {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.price-period {
  font-size: 13px;
  color: #71717a;
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex-grow: 1;
}
.plan-features li {
  font-size: 13px;
  color: #3f3f46;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.check-icon {
  color: #059669;
  font-weight: 700;
}
.plan-select-btn {
  width: 100%;
}
.pricing-modal-footer {
  border-top: 1px solid #f4f4f5;
  padding-top: 16px;
  text-align: center;
}
.policy-note {
  font-size: 11px;
  color: #a1a1aa;
  margin: 0;
}

.auth-dialog {
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 0;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.auth-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.auth-dialog-content {
  padding: 24px;
}
.auth-dialog .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.auth-dialog .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.upload-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.upload-guide-card {
  background: #fbfbf8;
  border: 1px solid #e2e6db;
  border-radius: 8px;
  padding: 13px 15px;
  font-size: 11px;
  line-height: 1.6;
  color: #636b5d;
}

.upload-guide-card strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #273024;
  margin-bottom: 5px;
}

.upload-guide-card strong svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  stroke-width: 1.8;
  flex-shrink: 0;
}

.upload-guide-card p {
  margin: 0;
}

.upload-guide-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.upload-guide-card a:hover {
  color: var(--accent-strong);
}

.upload-guide-card code {
  background: #edf0e6;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  color: #3b4437;
}

@media (max-width: 640px) {
  .upload-guide {
    grid-template-columns: 1fr;
  }
}

/* Job detail view (/jobs/:id) — mirrors the history dashboard stat cards. */
.job-detail-panel {
  padding: 24px 26px;
}
.job-detail-panel .section-heading {
  margin-bottom: 0;
}
.job-detail-panel .section-heading h2 {
  font-size: 22px;
  letter-spacing: -0.6px;
}
.job-detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}
.job-detail-meta > div {
  background: #f7f7fa;
  border: 1px solid #e6e7ee;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.job-detail-meta span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.job-detail-meta strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.job-detail-message {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.job-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .job-detail-panel {
    padding: 21px 19px;
  }
  .job-detail-meta,
  .history-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
