.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 44px;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-weight: 500;
}

.nav-actions {
  display: flex;
  gap: 10px;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  padding: 40px 24px;
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 48px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-visual img {
  width: min(420px, 90%);
}

.section {
  margin: 0 auto;
  max-width: 1200px;
  width: 100%;
}

.section h2 {
  margin-bottom: 12px;
  font-size: var(--text-lg);
}

.section-inner {
  padding: 32px;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contrast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.plain-list li {
  padding-left: 20px;
  position: relative;
}

.plain-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--brand-red);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(229, 57, 53, 0.12);
  margin-bottom: 12px;
}

.section-media {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.media-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.media-card img {
  width: 100%;
  display: block;
  height: 220px;
  object-fit: cover;
}

.step-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}

.step-number {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-red);
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  color: var(--muted);
}

.trust-strip span {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.pro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.primary,
.ghost {
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-sm);
}

.primary {
  background: var(--brand-red);
  color: #fff;
  box-shadow: var(--shadow);
}

.ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-page {
  max-width: 560px;
  margin: 0 auto;
}

.auth-card {
  display: grid;
  gap: 12px;
}

.auth-card input {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.ghost-link {
  color: var(--muted);
  font-size: 14px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.app-footer {
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  background: var(--surface);
}

.footer-links {
  display: flex;
  gap: 14px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.pdf-viewer {
  min-height: 320px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--surface);
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

.empty-state img {
  width: 220px;
  margin-bottom: 16px;
  opacity: 0.9;
}

.hero h1 {
  font-size: var(--text-xl);
  margin: 0 0 12px;
}

.hero p {
  color: var(--muted);
  max-width: 520px;
}

.hero-subhead {
  font-size: var(--text-lg);
  font-weight: 600;
}

.hero-support {
  font-size: var(--text-md);
}

.hero .ghost {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.toolbar .ghost {
  border-color: var(--border);
  color: var(--text);
}

.app-header .nav-links a:hover {
  color: var(--brand-red);
}

.auth-status {
  color: var(--muted);
  font-size: 14px;
}

.doc-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.doc-row:last-child {
  border-bottom: none;
}

.editor-shell {
  display: grid;
  gap: 16px;
}

.editor-status {
  font-weight: 600;
}

.editor-auth,
.editor-dropzone,
.editor-progress,
.editor-document,
.editor-tools,
.editor-history {
  display: none;
}

.editor-shell[data-state="empty"] .editor-auth,
.editor-shell[data-state="empty"] .editor-dropzone {
  display: block;
}

.editor-shell[data-state="uploading"] .editor-progress {
  display: block;
}

.editor-shell[data-state="ready"] .editor-document,
.editor-shell[data-state="ready"] .editor-tools,
.editor-shell[data-state="ready"] .editor-history {
  display: block;
}

.editor-shell[data-state="running_operation"] .editor-document,
.editor-shell[data-state="running_operation"] .editor-history {
  display: block;
}

.editor-dropzone {
  border: 2px dashed var(--border);
  text-align: center;
  padding: 32px;
  cursor: pointer;
}

.editor-dropzone.is-dragging {
  border-color: var(--brand-red);
  background: rgba(229, 57, 53, 0.06);
}

.editor-dropzone input {
  display: none;
}

.editor-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--brand-red);
  width: 0%;
}

@media (max-width: 720px) {
  .hero {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .section-inner {
    padding: 24px;
  }
}
