@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --panel: #ffffff;
  --text: #1f1b16;
  --ink: #1f1b16;
  --muted: #6c645a;
  --line: #d8dee8;
  --border: #d8dee8;
  --border-active: #028f80;
  --accent: #028f80;
  --accent-strong: #028f80;
  --accent-2: #028f80;
  --accent-hover: #027569;
  --accent-gradient-top: #1fa898;
  --accent-hover-gradient-top: #02786f;
  --accent-hover-gradient-bottom: #026558;
  --accent-soft: #e5f6f4;
  --shadow: none;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --rect-bg: linear-gradient(90deg, #fcfaf8 0%, #ffffff 100%);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", "Helvetica Neue", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-image: url("/books/assets/background.png");
  background-size: 100% auto;
  background-position: center bottom;
  background-repeat: no-repeat;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

.app-shell {
  width: 100%;
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 12px;
  display: flex;
  flex-direction: column;
}

.app-shell.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 15px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
}

.brand,
.top-actions,
.hero-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brandText {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.title {
  min-width: 0;
  color: var(--accent);
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1;
}

.brandSubtitle {
  min-width: 0;
  color: #586273;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.top-actions {
  gap: 16px;
  margin-left: auto;
  min-width: 0;
}

.account-chip {
  display: inline-flex;
  min-height: 38px;
  max-width: 320px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--rect-bg);
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publisher-account {
  position: relative;
}

.publisher-account-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  background: var(--rect-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.publisher-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.publisher-greeting {
  max-width: 190px;
  overflow: hidden;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publisher-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 190px;
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--rect-bg);
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.14);
  padding: 6px;
}

.publisher-account-menu.open {
  display: grid;
}

.publisher-account-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  padding: 0 10px;
}

.publisher-account-menu button:hover,
.publisher-account-menu button:focus-visible {
  background: var(--rect-bg);
  color: var(--accent);
}

.nav-link,
.nav-button,
.primary-action,
.secondary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link {
  padding: 0 12px;
  color: var(--accent);
}

.nav-button,
.primary-action {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-button {
  padding: 0 16px;
}

.hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 54px;
  align-items: center;
  padding: 38px 0 25px;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-2);
  font-size: clamp(13px, 1.35vw, 15px);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", "Times New Roman", serif;
  color: var(--ink);
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(36px, 4.4vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 590px;
  margin-bottom: 21px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.hero-actions {
  gap: 14px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  padding: 0 22px;
}

.secondary-action {
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, #fcfaf8 0%, #fcfaf8 15%, #ffffff 100%);
  color: var(--accent);
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-button:hover,
.nav-button:focus-visible,
.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:hover,
.secondary-action:focus-visible,
.publisher-account-button:hover,
.publisher-account-button:focus-visible,
.choice-card:hover,
.choice-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 143, 128, 0.2);
  text-decoration: none;
}

.publisher-hero-visual {
  position: relative;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.publisher-hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.workflow-preview {
  position: relative;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--rect-bg);
  box-shadow: var(--shadow);
}

.workflow-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.workflow-card.active {
  border-color: rgba(2, 143, 128, 0.35);
  background: var(--accent-soft);
}

.workflow-card strong,
.workflow-card span {
  display: block;
}

.workflow-card strong {
  margin-bottom: 3px;
}

.workflow-card div span {
  color: var(--muted);
  font-size: 14px;
}

.workflow-number,
.step-index {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.workflow-number {
  width: 34px;
  height: 34px;
  font-size: 15px;
  line-height: 34px;
}

.workflow-line {
  width: 2px;
  height: 34px;
  margin: 0 0 0 34px;
  background: var(--line);
}

.steps-section {
  padding: 24px 0 13px;
}

.section-heading {
  max-width: 660px;
  margin-bottom: 15px;
}

h2 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: 0;
}

.steps-grid,
.capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.info-card,
.capabilities article,
.state-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--rect-bg);
  box-shadow: none;
}

.info-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: 22px;
}

.step-index {
  width: 30px;
  height: 30px;
  margin: 0;
  font-size: 14px;
  line-height: 30px;
}

.info-card h3 {
  align-self: center;
  margin-bottom: 8px;
  font-size: 18px;
}

.capabilities h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.info-card p {
  grid-column: 2;
}

.info-card p,
.capabilities p,
.state-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.capabilities {
  padding: 20px 0 8px;
}

.capabilities article {
  padding: 20px;
}

.state-card {
  width: min(620px, 100%);
  padding: 32px;
}

.state-card h1 {
  margin-bottom: 12px;
  font-size: 38px;
  line-height: 1.1;
}

.setup-shell {
  min-height: 100vh;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: 54px;
  align-items: start;
  padding: 41px 0 27px;
}

.setup-copy {
  max-width: 620px;
}

.setup-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--rect-bg);
  box-shadow: var(--shadow);
  padding: 22px;
}

.setup-card h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.form-intro {
  margin-bottom: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.publisher-form {
  display: grid;
  gap: 14px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 13px;
  background: var(--rect-bg);
  color: var(--text);
  font: inherit;
}

.field-group textarea {
  min-height: 132px;
  padding: 12px 13px;
  resize: vertical;
}

.author-suggestions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(2, 143, 128, 0.22);
  border-radius: var(--radius-md);
  background: var(--rect-bg);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.author-suggestions[hidden] {
  display: none;
}

.author-suggestion {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.author-suggestion:hover,
.author-suggestion:focus-visible {
  border-color: rgba(2, 143, 128, 0.34);
  background: rgba(2, 143, 128, 0.06);
  outline: none;
}

.author-suggestion span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.field-group select {
  appearance: none;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--border-active);
  box-shadow: none;
  outline: none;
}

.publisher-picker-trigger {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 13px;
  background: var(--rect-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.publisher-picker-trigger:focus-visible {
  border-color: var(--border-active);
  outline: none;
}

.publisher-picker-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publisher-picker-value.is-placeholder {
  color: var(--muted);
}

.publisher-picker-chevron {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}

.publisher-picker-field {
  position: relative;
  z-index: 1;
}

.publisher-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 30;
  display: block;
  max-height: var(--publisher-picker-menu-max-height, 440px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.publisher-picker-menu--open:not([hidden]) {
  display: block;
  position: fixed;
  z-index: 200;
}

.publisher-picker-menu[hidden] {
  display: none !important;
}

.publisher-picker-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 1px solid rgba(216, 222, 232, 0.7);
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
  cursor: pointer;
}

.publisher-picker-menu--open .publisher-picker-option {
  width: auto;
  min-width: 100%;
}

.publisher-picker-option:last-child {
  border-bottom: 0;
}

.publisher-picker-option:hover,
.publisher-picker-option:focus-visible {
  background: rgba(2, 143, 128, 0.06);
  outline: none;
}

.publisher-picker-option.is-selected {
  background: rgba(2, 143, 128, 0.1);
  color: var(--accent-strong);
  font-weight: 700;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.form-message.error {
  color: #b3261e;
}

.form-message.success {
  color: var(--accent-strong);
}

.validation-diagnostics {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(176, 54, 54, 0.22);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #fff7f5;
  color: var(--text);
}

.validation-diagnostics h3 {
  margin: 0;
  font-size: 16px;
}

.validation-diagnostics ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.validation-summary-list {
  padding-left: 0;
  list-style: none;
}

.validation-summary-list li {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
}

.validation-diagnostics li {
  display: grid;
  gap: 4px;
}

.validation-diagnostics strong {
  color: #8c2f2a;
}

.validation-diagnostics small,
.validation-diagnostics em {
  color: var(--muted);
}

.progress-message {
  color: var(--text);
}

.progress-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(2, 143, 128, 0.22);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--accent-soft);
}

.progress-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid rgba(2, 143, 128, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: progress-spin 0.85s linear infinite;
}

.progress-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.progress-copy strong,
.progress-copy span {
  overflow-wrap: anywhere;
}

.progress-copy span {
  color: var(--muted);
  font-size: 13px;
}

.progress-steps {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
}

.progress-steps li.active {
  color: var(--accent-strong);
  font-weight: 750;
}

.progress-steps li.done {
  color: var(--text);
}

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

.form-submit {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.form-submit:disabled {
  cursor: default;
  opacity: 0.68;
}

.secondary-action.form-submit {
  border: 1px solid var(--border);
}

.danger-outline-action {
  border: 1px solid #b3261e;
  background: var(--rect-bg);
  color: #b3261e;
  box-shadow: none;
}

.danger-outline-action:hover,
.danger-outline-action:focus-visible {
  background: #fff5f3;
}

.dashboard-shell {
  min-height: 100vh;
}

.dashboard-main {
  padding: 32px 0 27px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.dashboard-heading h1 {
  margin-bottom: 10px;
}

.dashboard-heading p:last-child,
.dashboard-loading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.create-title-heading {
  display: block;
}

.create-title-heading h1 {
  margin-bottom: 10px;
}

.create-title-heading p:last-child {
  max-width: 640px;
}

.dashboard-action,
.small-action {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.small-action {
  min-height: 38px;
  padding: 0 14px;
}

.dashboard-loading,
.empty-dashboard,
.title-list,
.choice-card,
.upload-card,
.requirements-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--rect-bg);
  box-shadow: none;
}

.dashboard-loading,
.empty-dashboard {
  padding: 22px;
}

#dashboardLibrary {
  display: grid;
  gap: 14px;
}

.dashboard-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--rect-bg);
  box-shadow: none;
  padding: 16px;
}

.dashboard-controls .field-group {
  gap: 6px;
}

.dashboard-controls .field-group label {
  line-height: 1.35;
}

.dashboard-search-field input {
  min-width: 0;
}

.dashboard-controls-trailing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: calc(14px * 1.35 + 6px);
  min-height: 46px;
}

.dashboard-bookshelf-note {
  margin: 0;
  white-space: nowrap;
}

.publisher-payout-panel,
.publisher-merchant-panel {
  margin: 0 0 24px;
  padding: 20px 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #fff;
}

.setup-layout--profile-edit .publisher-merchant-panel {
  margin: 24px 0 0;
  max-width: 520px;
}

.publisher-payout-panel-inner,
.publisher-merchant-panel-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.publisher-merchant-panel-inner--profile {
  flex-direction: column;
  align-items: flex-start;
}

.publisher-payout-panel h2,
.publisher-merchant-panel h2,
.publisher-merchant-title {
  margin: 6px 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.setup-layout--profile-edit .publisher-merchant-panel .eyebrow {
  margin-bottom: 8px;
}

.setup-layout--profile-edit .publisher-merchant-panel .field-help {
  font-size: 16px;
  line-height: 1.55;
}

.publisher-payout-badge,
.publisher-merchant-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(2, 143, 128, 0.12);
  color: #026457;
  white-space: nowrap;
}

.publisher-merchant-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.publisher-merchant-updated {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.publisher-payout-actions,
.publisher-merchant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.publisher-stripe-return-hint {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .publisher-payout-panel-inner,
  .publisher-merchant-panel-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.empty-dashboard {
  display: grid;
  justify-items: start;
  gap: 12px;
}

.empty-dashboard h2 {
  font-size: 28px;
}

.empty-dashboard p {
  max-width: 640px;
  color: var(--muted);
  line-height: 1.55;
}

.filtered-empty {
  box-shadow: none;
}

.title-list {
  overflow: hidden;
}

.title-row {
  --bookshelf-destructive: #b3261e;
  display: grid;
  grid-template-columns:
    54px
    minmax(0, 1fr)
    minmax(200px, 240px)
    112px
    116px
    140px
    148px;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.title-row[data-bookshelf-status="unpublished"] {
  cursor: default;
}

.title-row[data-bookshelf-status="unpublished"]:hover {
  background: transparent;
}

#dashboardMessage {
  margin-bottom: 12px;
}

.bookshelf-price-panel {
  position: relative;
  align-self: center;
  min-width: 0;
}

.bookshelf-price-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.bookshelf-price-popover {
  position: fixed;
  z-index: 40;
  display: grid;
  gap: 10px;
  min-width: 280px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(16, 24, 18, 0.16);
}

.bookshelf-price-popover[hidden] {
  display: none !important;
}

.bookshelf-price-value {
  font-size: 16px;
  font-weight: 750;
  color: var(--ink);
}

.bookshelf-price-panel .field-group {
  margin: 0;
}

.bookshelf-price-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.bookshelf-price-summary .bookshelf-price-label {
  margin-right: 2px;
}

.bookshelf-price-summary .title-bookshelf-action {
  width: auto;
  flex: 0 0 auto;
}

.bookshelf-price-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bookshelf-price-mode select,
.bookshelf-price-amount input {
  width: 100%;
  max-width: 140px;
}

.bookshelf-price-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bookshelf-price-currency {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.bookshelf-price-message {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.bookshelf-price-message.success {
  color: var(--accent-strong);
}

.bookshelf-price-message.error {
  color: #b42318;
}

.title-row-status,
.title-row-date,
.title-row-action {
  display: flex;
  align-items: center;
  min-width: 0;
}

.title-row-status {
  justify-content: center;
}

.title-row-date {
  justify-content: center;
}

.title-row-action {
  justify-content: stretch;
}

.title-row-date .title-date {
  width: 100%;
  text-align: center;
}

.title-bookshelf-action {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: linear-gradient(135deg, #fcfaf8 0%, #fcfaf8 15%, #ffffff 100%);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.title-bookshelf-action--primary {
  color: var(--accent);
}

.title-bookshelf-action--destructive {
  color: var(--bookshelf-destructive);
}

.title-bookshelf-action:hover,
.title-bookshelf-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 143, 128, 0.2);
}

.title-bookshelf-action:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.title-row:hover {
  background: #fbfcfa;
}

.title-row:last-child {
  border-bottom: 0;
}

.title-cover {
  width: 42px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-soft);
}

.title-cover-link {
  display: block;
  width: 100%;
  height: 100%;
}

.title-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.title-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  padding: 4px;
}

.title-main h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.title-main p,
.title-date {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.title-main .title-status-detail {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.status-pill {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status-draft {
  background: #f3f5f1;
  color: #555f57;
}

.status-processing {
  background: #e8f4fd;
  color: #2470a8;
}

.status-ready {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-published {
  background: #e5f7f4;
  color: #386b17;
}

.status-unpublished {
  background: #f3f0e8;
  color: #6b5b45;
}

.title-row-status .status-pill,
.title-row-status .bookshelf-status-label {
  max-width: 100%;
}

.bookshelf-status-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: #6b5b45;
  pointer-events: none;
  user-select: none;
  cursor: default;
  text-align: center;
}

.bookshelf-status-unpublished {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.status-failed {
  background: #fff1ef;
  color: #b3261e;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(260px, 340px);
  gap: 22px;
  align-items: start;
}

.workspace-grid > .details-card {
  grid-column: 1;
  grid-row: 1;
}

.workspace-grid > .status-panel {
  grid-column: 2;
  grid-row: 1;
}

.workspace-grid > .retry-card,
.workspace-grid > .pricing-card,
.workspace-grid > .final-review-card {
  grid-column: 1;
}

.preview-step-main {
  --title-details-panel-width: 40rem;
}

.preview-step-panel {
  box-sizing: border-box;
  width: min(100%, var(--title-details-panel-width));
  max-width: var(--title-details-panel-width);
  margin: 0 auto;
  padding: 18px 20px 16px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  box-shadow: none;
}

.preview-step-lead {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--ink);
}

.preview-step-lead.status-text-ready {
  color: var(--ink);
}

.preview-step-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.preview-step-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.preview-step-meta li {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.preview-step-meta span {
  color: var(--muted);
}

.preview-step-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.preview-step-meta-line strong {
  color: var(--text);
  font-weight: 700;
}

.preview-step-meta-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.primary-action:disabled,
.primary-action.preview-open-link[aria-disabled="true"] {
  cursor: default;
  opacity: 0.68;
  pointer-events: none;
}

.preview-step-panel .form-message {
  width: 100%;
  margin: 0;
}

.preview-step-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 2px;
}

.preview-step-actions-split {
  flex-wrap: wrap;
  gap: 10px;
}

.preview-step-actions-split .primary-action,
.preview-step-actions-split .secondary-action,
.preview-step-actions-split .preview-open-link {
  width: auto;
  min-width: 168px;
  flex: 1 1 180px;
  max-width: 240px;
}

.pricing-step-panel {
  text-align: left;
}

.pricing-step-panel .pricing-step-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.25;
  text-align: center;
}

.pricing-step-panel .publisher-form {
  margin-top: 4px;
}

.preview-step-help {
  margin: 0;
  font-size: 13px;
}

.preview-step-panel-failed .validation-errors {
  width: 100%;
  text-align: left;
}

.preview-step-panel-failed .validation-errors ul {
  margin: 0;
  padding-left: 18px;
}

.preview-step-panel-failed .status-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

a.primary-action.preview-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  text-decoration: none;
}

.status-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--rect-bg);
  box-shadow: none;
  padding: 19px;
}

.status-panel h2 {
  margin-bottom: 8px;
  font-size: 30px;
}

.status-summary {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.status-text-ready,
.status-text-published {
  color: var(--accent-strong);
}

.status-text-processing {
  color: #2470a8;
}

.status-text-failed {
  color: #b3261e;
}

.status-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.status-list div {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.status-list dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.status-list dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.status-note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.validation-errors {
  margin-top: 18px;
  border: 1px solid rgba(179, 38, 30, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff8f7;
  color: #7f1d17;
}

.validation-errors strong {
  display: block;
  margin-bottom: 8px;
}

.validation-errors ul {
  margin: 0;
  padding-left: 18px;
}

.validation-errors li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.live-note {
  color: var(--accent-strong);
  font-weight: 650;
}

.status-refresh-action {
  width: 100%;
  margin-top: 16px;
}

.status-reader-action {
  width: 100%;
  margin-top: 10px;
  text-align: center;
}

.workspace-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-actions {
  display: grid;
  gap: 12px;
}

.workspace-actions .danger-action {
  grid-column: 1 / -1;
}

.danger-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: #fff5f3;
  color: #b3261e;
  font-weight: 700;
  text-decoration: none;
}

.validation-retry-action {
  border-radius: 999px;
  border: 1px solid #8c2f2a;
  background: linear-gradient(180deg, #a63c35 0%, #8c2f2a 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(140, 47, 42, 0.2);
}

.validation-retry-action:hover,
.validation-retry-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(140, 47, 42, 0.24);
  background: linear-gradient(180deg, #96342e 0%, #7c2924 100%);
}

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

.choice-card {
  width: 100%;
  padding: 19px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.choice-card:hover {
  border-color: rgba(2, 143, 128, 0.42);
  box-shadow: none;
}

.choice-card h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.choice-card p {
  color: var(--muted);
  line-height: 1.55;
}

.choice-card span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.upload-card {
  padding: 22px;
}

.upload-content-primary-action {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.upload-content-primary-action .form-submit {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding-left: 22px;
  padding-right: 22px;
}

.requirements-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.requirements-card h2 {
  margin: 0;
  font-size: 22px;
}

.requirements-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.requirements-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.book-design-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--rect-bg);
  box-shadow: none;
  padding: 22px;
}

.book-design-step-main {
  --title-details-panel-width: 58rem;
}

.book-design-panel-compact {
  --title-details-panel-width: 58rem;
  box-sizing: border-box;
  width: min(100%, var(--title-details-panel-width));
  max-width: var(--title-details-panel-width);
  margin: 0 auto;
  gap: 10px;
  padding: 14px 16px;
  overflow: hidden;
}

.book-design-form-compact {
  gap: 10px;
}

.book-design-paragraph-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 10px;
  align-items: flex-end;
  width: 100%;
}

.book-design-paragraph-row .field-group {
  flex: 0 0 auto;
  min-width: 0;
}

.book-design-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.book-design-preview-slot {
  min-width: 0;
  overflow: hidden;
}

.book-design-preview-panel {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.book-design-preview-panel .book-design-section-title {
  flex: 0 0 auto;
}

.book-design-preview-panel .design-live-preview-canvas {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.title-details-form-compact .field-group label,
.book-design-form-compact .book-design-section-title {
  display: block;
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.book-design-form-compact .book-design-section-title {
  margin-bottom: 4px;
}

.book-design-controls .design-fieldset-toc + .book-design-section-title,
.book-design-controls .book-design-paragraph-row + .book-design-section-title {
  margin-top: 16px;
}

.book-design-controls {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.heading-style-controls-mount {
  display: grid;
  gap: 8px;
}

.book-design-primary-action {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.book-design-primary-action .primary-action {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding-left: 22px;
  padding-right: 22px;
}

.book-design-back-link {
  margin: 8px 0 0;
}

.book-design-cover-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.book-design-cover-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.book-design-cover-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.book-design-cover-preview {
  max-width: 180px;
}

.book-design-cover-preview img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.text-link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent-strong);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-link-button:hover {
  color: var(--accent-hover);
}

.field-group-compact label {
  font-size: 12px;
}

.field-group-compact input,
.field-group-compact select {
  min-height: 40px;
  font-size: 14px;
}

.design-fieldset-inline {
  gap: 6px;
  padding: 10px 12px;
}

.design-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.checkbox-row-compact {
  gap: 6px;
  font-size: 14px;
}

.publisher-sticky-chrome {
  position: sticky;
  top: 0;
  z-index: 45;
  margin: 0 0 18px;
  padding-bottom: 2px;
  background: var(--bg);
  box-shadow: 0 10px 18px rgba(255, 255, 255, 0.92);
}

.publisher-sticky-chrome .topbar {
  position: static;
  top: auto;
  z-index: auto;
  margin-bottom: 16px;
}

.title-details-epub-source-row {
  --title-details-cover-preview-width: 180px;
  --title-details-epub-author-photo-size: 156px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  align-items: stretch;
  width: 100%;
}

.title-details-epub-from-file {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.title-details-epub-from-file .eyebrow {
  margin: 0 0 10px;
}

.title-details-epub-from-file-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.title-details-epub-meta {
  width: 100%;
  min-width: 0;
}

.title-details-epub-meta p {
  margin: 0 0 8px;
  width: 100%;
}

.title-details-epub-title,
.title-details-epub-author {
  line-height: 1.35;
}

.title-details-epub-meta p:last-child {
  margin-bottom: 0;
}

.title-details-epub-cover-slot {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.title-details-epub-cover-preview {
  justify-self: auto;
  min-height: 0;
}

.title-details-epub-source-row .field-group-author-photo {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.title-details-epub-source-row .title-details-author-photo {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 100%;
  height: 100%;
}

.title-details-epub-source-row .title-details-author-photo-preview img {
  width: var(--title-details-epub-author-photo-size);
  height: var(--title-details-epub-author-photo-size);
}

.title-details-epub-source-row .title-details-author-photo-upload {
  margin-top: auto;
}

.title-details-epub-source-row #authorPhotoReadyNote {
  margin: 6px 0 0;
}

.title-details-epub-source-row #authorPhotoMessage:empty {
  display: none;
}

.publish-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.publish-success-card {
  text-align: center;
}

.publish-success-card .book-design-status {
  margin-bottom: 0;
}

.publish-success-card .publish-success-actions {
  align-items: center;
}

body.publisher-fatal-error-open {
  overflow: hidden;
}

.publisher-fatal-error-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 28, 26, 0.56);
}

.publisher-fatal-error-dialog {
  width: min(520px, 100%);
  padding: 32px 28px 28px;
  border-radius: var(--radius-lg, 16px);
  background: #fff;
  box-shadow: 0 24px 64px rgba(16, 28, 26, 0.22);
  text-align: center;
}

.publisher-fatal-error-intro,
.publisher-fatal-error-follow-up {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

.publisher-fatal-error-follow-up {
  margin-top: 14px;
}

.form-message.publisher-debug-error {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 40vh;
  overflow: auto;
}

.publisher-fatal-error-start-over {
  margin-top: 24px;
  min-width: 180px;
}

.publisher-flow-stepper {
  margin: 0;
  padding: 20px 0 14px;
  border-bottom: 1px solid var(--border);
}

.publisher-flow-stepper-list {
  display: flex;
  align-items: flex-start;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.publisher-flow-step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.publisher-flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.publisher-flow-step-completed:not(:last-child)::after {
  background: var(--accent);
}

.publisher-flow-step-index {
  position: relative;
  z-index: 1;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.publisher-flow-step-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.publisher-flow-step-active .publisher-flow-step-index {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(2, 143, 128, 0.12);
}

.publisher-flow-step-active .publisher-flow-step-label {
  color: var(--accent-strong);
}

.publisher-flow-step-completed .publisher-flow-step-index {
  background: var(--accent);
  color: #fff;
}

.publisher-flow-step-completed .publisher-flow-step-label {
  color: var(--text);
}

.publishing-journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 11px;
}

.journey-step {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  background: var(--rect-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.journey-step:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.journey-index {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-weight: 800;
}

.journey-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.journey-copy strong,
.journey-copy small {
  overflow-wrap: anywhere;
}

.journey-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.journey-completed .journey-index {
  background: var(--accent);
  color: #fff;
}

.journey-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 143, 128, 0.12);
}

.journey-active .journey-index {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.journey-failed {
  border-color: rgba(179, 38, 30, 0.45);
  background: #fff7f5;
}

.journey-failed .journey-index {
  background: #b3261e;
  color: #fff;
}

.journey-blocked {
  background: #f3f4f1;
}

.journey-checklist {
  display: grid;
  gap: 10px;
  margin-bottom: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--rect-bg);
}

.journey-checklist h3 {
  margin: 0;
  font-size: 16px;
}

.journey-checklist ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.journey-checklist li {
  color: var(--muted);
}

.journey-checklist strong {
  color: var(--text);
}

.book-design-status {
  display: grid;
  gap: 8px;
}

.book-design-status h2,
.design-live-preview h3,
.heading-styles-panel h3,
.flat-card h3 {
  margin: 0;
}

.book-design-status p,
.design-live-preview p,
.flat-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.design-fieldset {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.design-fieldset legend {
  padding: 0 6px;
  font-weight: 750;
}

.design-fieldset-toc {
  width: fit-content;
  max-width: 100%;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.flat-card {
  display: grid;
  gap: 8px;
  border: 1px dashed rgba(2, 143, 128, 0.34);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--accent-soft);
}

.heading-styles-panel,
.design-live-preview,
.book-cover-panel {
  display: grid;
  gap: 8px;
}

.design-live-preview {
  min-width: 0;
}

.design-live-preview:not(.book-design-preview-panel) {
  display: grid;
  gap: 8px;
}

.heading-style-fieldset {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.heading-style-fieldset legend {
  padding: 0 6px;
  font-weight: 750;
}

.heading-style-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.heading-style-fieldset .field-group {
  gap: 4px;
}

.heading-style-fieldset .field-group label {
  font-size: 11px;
  white-space: nowrap;
}

.heading-style-fieldset .field-group input,
.heading-style-fieldset .field-group select {
  min-height: 36px;
  padding: 0 8px;
  font-size: 13px;
}

.design-live-preview-canvas {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: #fff;
}

@media (max-width: 960px) {
  .book-design-main-grid {
    grid-template-columns: 1fr;
  }

  .book-design-paragraph-row {
    flex-wrap: wrap;
  }

  .heading-style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.design-live-preview-canvas .design-preview-heading {
  margin: 0 0 0.35em;
  color: var(--text);
  line-height: 1.25;
}

.design-preview-flow {
  margin-top: 0.5em;
  line-height: var(--design-preview-line-height, 1.5);
}

.design-preview-p {
  margin: 0;
  color: var(--text);
  text-align: justify;
  line-height: var(--design-preview-line-height, 1.5);
}

.design-live-preview-canvas {
  --design-preview-line-height: 1.5;
}

.design-preview-canvas--paragraph-indent .design-preview-p {
  text-indent: 1.5em;
}

.design-preview-canvas--paragraph-indent .design-preview-p-first-in-section {
  text-indent: 0;
}

.design-preview-canvas--paragraph-spaced .design-preview-p {
  text-indent: 0;
  margin-bottom: 0.85em;
}

.design-preview-canvas--paragraph-spaced .design-preview-p:last-child {
  margin-bottom: 0;
}

.design-preview-p.design-preview-drop-cap::first-letter {
  float: left;
  margin: 0.04em 0.12em 0 0;
  font-size: 3.1em;
  line-height: 0.82;
  font-weight: 700;
  color: var(--accent-strong);
}

.cover-setup-panel {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.continue-publishing-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: #fff;
}

.continue-publishing-panel h2,
.continue-publishing-panel p {
  margin: 0;
}

.continue-publishing-panel p:not(.eyebrow) {
  color: var(--muted);
}

.cover-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #fff;
}

.cover-summary div {
  display: grid;
  gap: 4px;
}

.cover-summary strong {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.cover-summary span,
.cover-summary p {
  margin: 0;
  overflow-wrap: anywhere;
}

.cover-summary p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
}

.cover-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cover-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.muted-inline {
  color: var(--muted);
  font-size: 13px;
}

.upload-dropzone {
  display: grid;
  min-height: 190px;
  place-items: center;
  border: 1px dashed rgba(2, 143, 128, 0.46);
  border-radius: var(--radius-md);
  padding: 26px;
  background: var(--accent-soft);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.upload-dropzone.dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 143, 128, 0.14);
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-dropzone strong,
.upload-dropzone span {
  display: block;
}

.upload-dropzone strong {
  margin-bottom: 6px;
  font-size: 20px;
}

.upload-dropzone span {
  color: var(--muted);
  font-size: 14px;
}

.details-card,
.pricing-card,
.review-card {
  max-width: 760px;
}

.title-details-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

.title-details-header {
  display: grid;
  gap: 4px;
  width: min(100%, var(--title-details-panel-width, 52rem));
  margin: 0 auto 10px;
}

.title-details-header h1 {
  margin: 0;
  font-size: 1.45rem;
}

.title-details-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.details-card-compact {
  --title-details-panel-width: 52rem;
  box-sizing: border-box;
  width: min(100%, var(--title-details-panel-width));
  max-width: var(--title-details-panel-width);
  margin: 0 auto;
  padding: 14px 16px;
  box-shadow: none;
  overflow: hidden;
}

.title-details-main .details-card-compact {
  overflow: visible;
}

.title-details-main .requirements-card.details-card-compact {
  padding: 22px;
}

.title-details-form-compact,
.title-details-grid {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.title-details-form-compact .field-span-full,
.title-details-form-compact .field-group,
.title-details-primary-action {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.title-details-short-row,
.title-details-media-row {
  --title-details-cover-preview-width: 180px;
  --title-details-cover-preview-height: calc(var(--title-details-cover-preview-width) * 1440 / 900);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  align-items: start;
  width: 100%;
}

.title-details-media-row {
  margin-top: 2px;
}

.title-details-short-row .field-group,
.title-details-media-row .field-group {
  min-width: 0;
}

.title-details-short-row .field-group-author,
.title-details-media-row .field-group-book-cover,
.title-details-media-row .field-group-author-photo {
  overflow: visible;
}

.field-group-author .author-name-autocomplete-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.field-group-author .author-suggestions-overlay {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  width: 100%;
  margin-top: 0;
  max-height: min(280px, 42vh);
  overflow-y: auto;
}

.title-details-author-photo,
.title-details-book-cover {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.title-details-book-cover-preview {
  display: flex;
  justify-content: flex-start;
  width: var(--title-details-cover-preview-width);
  max-width: 100%;
}

.title-details-book-cover-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
}

.title-details-author-photo-preview {
  display: flex;
  justify-content: flex-start;
}

.title-details-author-photo-preview[hidden] {
  display: none;
}

.title-details-author-photo-preview img {
  width: var(--title-details-cover-preview-height);
  height: var(--title-details-cover-preview-height);
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
}

.title-details-author-photo-upload,
.title-details-book-cover-upload {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.title-details-author-photo-file-wrap,
.title-details-book-cover-file-wrap {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--rect-bg);
  padding: 5px 12px;
}

.title-details-author-photo-choose,
.title-details-book-cover-choose {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f3f4f6;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

.title-details-author-photo-choose:hover,
.title-details-book-cover-choose:hover {
  background: #e8eaee;
}

.title-details-author-photo-file-name,
.title-details-book-cover-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text);
}

.title-details-author-photo-file-input,
.title-details-book-cover-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.title-details-author-photo-upload .secondary-action,
.title-details-book-cover-upload .secondary-action {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
}

.title-details-text-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  align-items: start;
  width: 100%;
}

.title-details-text-row .field-group {
  min-width: 0;
}

.title-details-form-compact {
  gap: 10px;
}

.title-details-grid {
  display: grid;
  gap: 10px;
}

.title-details-meta-row {
  display: grid;
  grid-template-columns:
    5.5rem
    minmax(13.5rem, 1.35fr)
    minmax(13.5rem, 1.35fr)
    minmax(7.5rem, 0.85fr);
  gap: 10px 12px;
  align-items: start;
  width: 100%;
}

.title-details-meta-row .field-group:nth-child(2),
.title-details-meta-row .field-group:nth-child(3) {
  min-width: 13.5rem;
}

.title-details-meta-row .publisher-picker-field {
  width: 100%;
  min-width: 0;
}

.title-details-meta-row .publisher-picker-trigger {
  width: 100%;
  box-sizing: border-box;
}

.title-details-meta-row .publisher-picker-value {
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-details-form-compact .field-group {
  gap: 4px;
}

.title-details-form-compact .field-group input,
.title-details-form-compact .field-group textarea,
.title-details-form-compact .field-group select,
.title-details-form-compact .publisher-picker-trigger {
  min-height: 40px;
  font-size: 14px;
}

.title-details-form-compact .field-group textarea {
  min-height: 72px;
  padding: 8px 11px;
}

.title-details-form-compact .title-details-textarea {
  min-height: 144px;
  resize: vertical;
}

.title-details-form-compact .field-help {
  font-size: 11px;
  line-height: 1.35;
}

.title-details-primary-action {
  display: flex;
  justify-content: center;
}

.title-details-media-errors {
  margin: 8px 0 0;
  padding-left: 18px;
  text-align: left;
}

.title-details-media-errors li + li {
  margin-top: 4px;
}

.title-details-primary-action .primary-action {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding-left: 22px;
  padding-right: 22px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .title-details-meta-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .title-details-text-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .title-details-meta-row {
    grid-template-columns: 1fr;
  }

  .title-details-short-row,
  .title-details-media-row,
  .title-details-epub-source-row {
    grid-template-columns: 1fr;
  }


}

.cover-editor {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.cover-preview {
  width: 96px;
  min-height: 128px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.cover-preview img {
  width: 100%;
  height: 128px;
  object-fit: cover;
}

.inline-file-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.inline-file-action input[type="file"] {
  min-width: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
}

.review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--rect-bg);
  box-shadow: var(--shadow);
  padding: 22px;
}

.review-card dl {
  display: grid;
  gap: 16px;
  margin: 0 0 22px;
}

.review-card dl div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.review-card dt {
  color: var(--muted);
  font-weight: 750;
}

.review-card dd {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.pricing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--rect-bg);
  box-shadow: var(--shadow);
  padding: 22px;
}

.retry-card {
  border: 1px solid rgba(179, 38, 30, 0.18);
  border-radius: var(--radius-md);
  background: #fffdfc;
  box-shadow: none;
  padding: 22px;
}

.empty-note {
  color: var(--muted);
  font-size: 14px;
}

.empty-note {
  margin: 0;
  line-height: 1.5;
}

.compact-form {
  margin-top: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px) minmax(120px, 160px);
  gap: 12px;
  align-items: end;
}

.pricing-card .form-row {
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 160px) minmax(120px, 160px);
}

.redesign-pricing-card {
  max-width: none;
  box-shadow: none;
}

.pricing-sale-field[hidden],
.pricing-currency-field[hidden] {
  display: none;
}

.protected-review-panel .redesign-pricing-card {
  margin-top: 4px;
}

.publish-confirmation-card {
  border-color: rgba(39, 94, 73, 0.2);
}

.pricing-summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.final-review-card {
  box-shadow: none;
}

@media (max-width: 820px) {
  .app-shell {
    width: 100%;
    max-width: 680px;
    padding: 14px 16px 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .hero-actions {
    width: 100%;
  }

  .publisher-flow-step-label {
    font-size: 10px;
  }

  .publisher-flow-step-index {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .nav-link,
  .nav-button,
  .primary-action,
  .secondary-action {
    flex: 1 1 0;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 32px 0 18px;
  }

  h1 {
    font-size: 48px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .workflow-preview {
    padding: 18px;
  }

  .setup-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 32px 0 20px;
  }

  .steps-grid,
  .capabilities,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .title-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .title-row-status,
  .title-row-date,
  .title-row-action,
  .title-row .status-pill,
  .title-row .bookshelf-status-label {
    justify-self: stretch;
    grid-column: 2;
  }

  .title-row-action--primary,
  .title-row-action--secondary {
    max-width: 100%;
  }

  .bookshelf-price-panel {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .bookshelf-price-summary {
    flex-wrap: wrap;
    white-space: normal;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .workspace-grid > .details-card,
  .workspace-grid > .status-panel,
  .workspace-grid > .retry-card,
  .workspace-grid > .pricing-card,
  .workspace-grid > .final-review-card {
    grid-column: 1;
    grid-row: auto;
  }

  .workspace-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-controls,
  .form-row,
  .inline-file-action,
  .cover-editor {
    grid-template-columns: 1fr;
  }

  .cover-summary,
  .cover-setup-grid {
    grid-template-columns: 1fr;
  }

  .review-card dl div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 480px) {
  .top-actions,
  .hero-actions {
    flex-direction: column;
  }

  .nav-link,
  .nav-button,
  .primary-action,
  .secondary-action {
    width: 100%;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 28px;
  }
}
