.bpc-epub-creator {
  --bpc-ink: #2a363b;
  --bpc-muted: #637381;
  --bpc-paper: #ffffff;
  --bpc-wash: #f3f8fb;
  --bpc-line: #dce2e9;
  --bpc-green: #5b90b7;
  --bpc-green-dark: #3c6989;
  --bpc-sage: #e7f1f7;
  --bpc-gold: #bd8943;
  --bpc-red: #9d2f2f;
  color: var(--bpc-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(18px, 3vw, 42px) 14px 56px;
}

.bpc-epub-creator *,
.bpc-epub-creator *::before,
.bpc-epub-creator *::after {
  box-sizing: border-box;
}

.bpc-epub-creator [hidden] {
  display: none !important;
}

.bpc-epub-hero {
  background: transparent;
  color: var(--bpc-ink);
  margin-bottom: 26px;
  padding: 10px 4px 20px;
  position: relative;
}

.bpc-epub-hero::after {
  content: none;
}

.bpc-epub-eyebrow {
  color: var(--bpc-green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.bpc-epub-hero h1 {
  color: var(--bpc-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0;
  max-width: 760px;
}

.bpc-epub-intro {
  color: var(--bpc-muted);
  font-size: clamp(1rem, 2vw, 1.16rem);
  margin: 18px 0 24px;
  max-width: 720px;
}

.bpc-epub-privacy {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--bpc-muted);
  display: inline-flex;
  font-size: 0.86rem;
  gap: 8px;
  padding: 0;
}

.bpc-epub-runtime {
  align-items: center;
  color: var(--bpc-muted);
  display: flex;
  font-size: 0.76rem;
  gap: 7px;
  justify-content: flex-end;
  margin: -14px 4px 18px;
}

.bpc-epub-runtime-dot {
  background: #5b90b7;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(91, 144, 183, 0.15);
  height: 7px;
  width: 7px;
}

.bpc-epub-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.bpc-epub-grid.is-awaiting-analysis {
  grid-template-columns: 1fr;
}

.bpc-epub-panel {
  background: var(--bpc-paper);
  border: 1px solid var(--bpc-line);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(31, 41, 51, 0.07);
  margin: 0 0 24px;
  padding: clamp(20px, 3vw, 32px);
}

.bpc-epub-step {
  align-items: center;
  color: var(--bpc-green);
  display: flex;
  font-size: 0.75rem;
  font-weight: 800;
  gap: 9px;
  letter-spacing: 0.09em;
  margin-bottom: 11px;
  text-transform: uppercase;
}

.bpc-epub-step span {
  align-items: center;
  background: var(--bpc-sage);
  border-radius: 50%;
  display: inline-flex;
  height: 25px;
  justify-content: center;
  width: 25px;
}

.bpc-epub-panel h2 {
  color: var(--bpc-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 20px;
}

.bpc-epub-panel-intro {
  color: var(--bpc-muted);
  margin: -10px 0 22px;
  max-width: 780px;
}

.bpc-epub-source-choice {
  background: var(--bpc-paper);
}

.bpc-epub-source-options {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.bpc-epub-source-card {
  cursor: pointer;
  display: block;
  margin: 0;
  min-width: 0;
  position: relative;
}

.bpc-epub-source-card > input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.bpc-epub-source-card-inner {
  background: #fff;
  border: 1px solid var(--bpc-line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 184px;
  padding: 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.bpc-epub-source-card:hover .bpc-epub-source-card-inner {
  border-color: #9eb4a5;
  box-shadow: 0 10px 25px rgba(31, 41, 51, 0.08);
  transform: translateY(-2px);
}

.bpc-epub-source-card > input:focus-visible + .bpc-epub-source-card-inner {
  box-shadow: 0 0 0 3px rgba(91, 144, 183, 0.22);
  outline: 2px solid var(--bpc-green);
  outline-offset: 2px;
}

.bpc-epub-source-card > input:checked + .bpc-epub-source-card-inner {
  background: #f3f8fb;
  border-color: var(--bpc-green);
  box-shadow: inset 0 0 0 1px var(--bpc-green), 0 10px 26px rgba(91, 144, 183, 0.16);
}

.bpc-epub-source-card > input:checked + .bpc-epub-source-card-inner::after {
  align-items: center;
  background: var(--bpc-green);
  border-radius: 50%;
  color: #fff;
  content: "✓";
  display: flex;
  font-size: 0.72rem;
  font-weight: 900;
  height: 23px;
  justify-content: center;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 23px;
}

.bpc-epub-source-icon {
  align-items: center;
  border-radius: 9px;
  display: inline-flex;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  margin-bottom: 14px;
  width: 38px;
}

.bpc-epub-source-icon--indesign {
  background: #4a1238;
  color: #ff6eb4;
}

.bpc-epub-source-icon--word {
  background: #185abd;
  color: #fff;
}

.bpc-epub-source-icon--html {
  background: var(--bpc-green);
  color: #fff;
  font-size: 0.72rem;
}

.bpc-epub-source-icon--pdf {
  background: #b6292e;
  color: #fff;
  font-size: 0.62rem;
}

.bpc-epub-source-copy {
  display: block;
  flex: 1 1 auto;
}

.bpc-epub-source-copy strong,
.bpc-epub-source-copy small {
  display: block;
}

.bpc-epub-source-copy strong {
  color: var(--bpc-ink);
  font-size: 0.96rem;
  line-height: 1.25;
  padding-right: 22px;
}

.bpc-epub-source-copy small {
  color: var(--bpc-muted);
  font-size: 0.76rem;
  line-height: 1.4;
  margin-top: 6px;
}

.bpc-epub-source-badge {
  align-self: flex-start;
  background: #e7f1f7;
  border-radius: 999px;
  color: #3c6989;
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  margin-top: 14px;
  padding: 5px 8px;
  text-transform: uppercase;
}

.bpc-epub-source-badge--ready {
  background: var(--bpc-sage);
  color: var(--bpc-green);
}

.bpc-epub-source-badge--care {
  background: #fbe3e3;
  color: #8b2929;
}

.bpc-epub-guide-panel {
  border-left: 5px solid var(--bpc-green);
}

.bpc-epub-guide-summary {
  align-items: flex-start;
  display: flex;
  gap: 14px;
}

.bpc-epub-guide-mark {
  align-items: center;
  background: var(--bpc-green);
  border-radius: 10px;
  color: #fff;
  display: flex;
  flex: 0 0 44px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  height: 44px;
  justify-content: center;
}

.bpc-epub-guide--warning .bpc-epub-guide-mark {
  background: #b6292e;
  font-size: 0.65rem;
}

.bpc-epub-guide-summary strong {
  color: var(--bpc-ink);
  display: block;
  font-size: 1rem;
  margin-top: 1px;
}

.bpc-epub-guide-summary p {
  color: var(--bpc-muted);
  margin: 4px 0 0;
}

.bpc-epub-instructions {
  background: var(--bpc-wash);
  border: 1px solid var(--bpc-line);
  border-radius: 11px;
  margin-top: 18px;
  overflow: hidden;
}

.bpc-epub-instructions summary {
  color: var(--bpc-green);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  list-style-position: inside;
  padding: 13px 15px;
}

.bpc-epub-instructions summary:hover,
.bpc-epub-instructions summary:focus-visible {
  background: #e9f0eb;
}

.bpc-epub-instructions[open] summary {
  border-bottom: 1px solid var(--bpc-line);
}

.bpc-epub-instruction-body {
  background: #fff;
  color: #46544d;
  font-size: 0.88rem;
  padding: 4px 18px 18px;
}

.bpc-epub-instruction-body ol {
  margin: 14px 0 0;
  padding-left: 22px;
}

.bpc-epub-instruction-body li {
  margin: 0 0 9px;
  padding-left: 4px;
}

.bpc-epub-style-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.bpc-epub-style-list span {
  background: var(--bpc-sage);
  border-radius: 6px;
  color: var(--bpc-green-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  padding: 4px 7px;
}

.bpc-epub-dropzone {
  align-items: center;
  background: var(--bpc-wash);
  border: 2px dashed #afbeb4;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 246px;
  justify-content: center;
  padding: 26px;
  position: relative;
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.bpc-epub-dropzone:hover,
.bpc-epub-dropzone:focus,
.bpc-epub-dropzone.is-dragging {
  background: #e7f1f7;
  border-color: var(--bpc-green);
  outline: none;
  transform: translateY(-1px);
}

.bpc-epub-file-input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.bpc-epub-upload-icon {
  align-items: center;
  background: var(--bpc-green);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 1.6rem;
  height: 54px;
  justify-content: center;
  margin-bottom: 14px;
  width: 54px;
}

.bpc-epub-dropzone strong {
  color: var(--bpc-ink);
  font-size: 1.03rem;
}

.bpc-epub-dropzone span {
  color: var(--bpc-green);
  font-size: 0.92rem;
  font-weight: 700;
  margin: 3px 0 12px;
}

.bpc-epub-dropzone small {
  color: var(--bpc-muted);
  font-size: 0.78rem;
}

.bpc-epub-file-summary {
  align-items: center;
  background: #f3f8fb;
  border: 1px solid #c5d8e6;
  border-radius: 12px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 13px 15px;
}

.bpc-epub-file-summary strong,
.bpc-epub-file-summary span {
  display: block;
  overflow-wrap: anywhere;
}

.bpc-epub-file-summary span {
  color: var(--bpc-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.bpc-epub-link-button {
  background: transparent;
  border: 0;
  color: var(--bpc-red);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px;
}

.bpc-epub-status {
  color: var(--bpc-muted);
  font-size: 0.88rem;
  min-height: 1.4em;
  padding-top: 10px;
}

.bpc-epub-status.is-error {
  color: var(--bpc-red);
}

.bpc-epub-status.is-working::before {
  animation: bpc-epub-spin 0.8s linear infinite;
  border: 2px solid #c9d5cc;
  border-right-color: var(--bpc-green);
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 14px;
  margin-right: 7px;
  vertical-align: -2px;
  width: 14px;
}

@keyframes bpc-epub-spin {
  to { transform: rotate(360deg); }
}

.bpc-epub-form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bpc-epub-field {
  display: block;
  margin: 0;
}

.bpc-epub-field--wide {
  grid-column: 1 / -1;
}

.bpc-epub-field > span {
  color: #33413a;
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  margin-bottom: 6px;
}

.bpc-epub-field b {
  color: var(--bpc-red);
}

.bpc-epub-field input,
.bpc-epub-field select {
  appearance: none;
  background: #fff;
  border: 1px solid #bdc8c0;
  border-radius: 9px;
  color: var(--bpc-ink);
  font: inherit;
  min-height: 45px;
  padding: 9px 11px;
  width: 100%;
}

.bpc-epub-field input:focus,
.bpc-epub-field select:focus {
  border-color: var(--bpc-green);
  box-shadow: 0 0 0 3px rgba(91, 144, 183, 0.18);
  outline: 0;
}

.bpc-epub-analysis-heading {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.bpc-epub-analysis-heading h2 {
  margin-bottom: 6px;
}

.bpc-epub-analysis-heading p {
  color: var(--bpc-muted);
  margin: 0 0 20px;
}

.bpc-epub-ready-badge {
  background: #e7f1f7;
  border-radius: 999px;
  color: #3c6989;
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 7px 11px;
}

.bpc-epub-stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 4px 0 22px;
}

.bpc-epub-stat-grid > div {
  background: var(--bpc-wash);
  border-radius: 11px;
  min-width: 0;
  padding: 14px;
}

.bpc-epub-stat-grid strong,
.bpc-epub-stat-grid span {
  display: block;
}

.bpc-epub-stat-grid strong {
  color: var(--bpc-green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  line-height: 1;
}

.bpc-epub-stat-grid span {
  color: var(--bpc-muted);
  font-size: 0.73rem;
  line-height: 1.2;
  margin-top: 6px;
}

.bpc-epub-checks {
  border-bottom: 1px solid var(--bpc-line);
  border-top: 1px solid var(--bpc-line);
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 22px 0;
}

.bpc-epub-checks > div {
  display: flex;
  gap: 10px;
}

.bpc-epub-check {
  align-items: center;
  background: var(--bpc-sage);
  border-radius: 50%;
  color: var(--bpc-green);
  display: inline-flex;
  flex: 0 0 25px;
  font-size: 0.8rem;
  height: 25px;
  justify-content: center;
}

.bpc-epub-checks p {
  color: var(--bpc-muted);
  font-size: 0.82rem;
  margin: 0;
}

.bpc-epub-checks strong {
  color: var(--bpc-ink);
  font-size: 0.88rem;
}

.bpc-epub-warnings {
  background: #fff7e8;
  border-left: 4px solid var(--bpc-gold);
  border-radius: 8px;
  color: #6e4a18;
  font-size: 0.85rem;
  margin-top: 20px;
  padding: 13px 15px;
}

.bpc-epub-warnings ul {
  margin: 6px 0 0 18px;
}

.bpc-epub-create-row {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.bpc-epub-create-row h2 {
  margin-bottom: 5px;
}

.bpc-epub-create-row p {
  color: var(--bpc-muted);
  font-size: 0.86rem;
  margin: 0;
  max-width: 580px;
}

.bpc-epub-build {
  align-items: center;
  background: var(--bpc-green);
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  gap: 9px;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  transition: background-color 160ms ease, transform 160ms ease;
}

.bpc-epub-build:hover:not(:disabled),
.bpc-epub-build:focus-visible:not(:disabled) {
  background: var(--bpc-green-dark);
  transform: translateY(-1px);
}

.bpc-epub-build:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.bpc-epub-build.is-working span {
  animation: bpc-epub-spin 0.8s linear infinite;
}

.bpc-epub-download-result {
  align-items: center;
  background: #e7f1f7;
  border: 1px solid #b6d0e1;
  border-radius: 10px;
  color: #3c6989;
  display: flex;
  font-size: 0.9rem;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 14px;
}

.bpc-epub-download-result[hidden] {
  display: none;
}

.bpc-epub-download-link {
  color: var(--bpc-green-dark);
  font-weight: 800;
  margin-left: auto;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bpc-epub-version {
  color: #88948d;
  display: block;
  font-size: 0.72rem;
  margin-top: 14px;
  text-align: right;
}

.bpc-epub-alert {
  border-radius: 8px;
  margin: 0 0 20px;
  padding: 12px 14px;
}

.bpc-epub-alert--error {
  background: #fdecec;
  color: var(--bpc-red);
}

@media (max-width: 860px) {
  .bpc-epub-source-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bpc-epub-grid {
    grid-template-columns: 1fr;
  }

  .bpc-epub-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bpc-epub-checks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .bpc-epub-creator {
    padding-left: 4px;
    padding-right: 4px;
  }

  .bpc-epub-hero,
  .bpc-epub-panel {
    border-radius: 14px;
  }

  .bpc-epub-runtime {
    justify-content: flex-start;
    margin-left: 8px;
  }

  .bpc-epub-source-options {
    grid-template-columns: 1fr;
  }

  .bpc-epub-source-card-inner {
    min-height: 0;
  }

  .bpc-epub-guide-summary {
    gap: 11px;
  }

  .bpc-epub-form-grid {
    grid-template-columns: 1fr;
  }

  .bpc-epub-field--wide {
    grid-column: auto;
  }

  .bpc-epub-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bpc-epub-analysis-heading,
  .bpc-epub-create-row {
    align-items: stretch;
    flex-direction: column;
  }

  .bpc-epub-build {
    width: 100%;
  }

  .bpc-epub-download-result {
    align-items: flex-start;
    flex-direction: column;
  }

  .bpc-epub-download-link {
    margin-left: 0;
  }
}
