:root {
  --bg: #0f1216;
  --card: #12161b;
  --text: #e7edf3;
  --muted: #99a3ad;
  --primary: #4b8df8;
  --primary-700: #2f6de2;
  --border: #1f2730;
  --accent: #1a1f27;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, #0d1114 0%, #0f1216 100%);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  background: rgba(10, 13, 16, 0.6);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 16px;
}

.nav a:hover {
  color: var(--text);
}

.hero {
  padding: 36px 0 14px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.hero .sub {
  margin: 0;
  color: var(--muted);
}

.app {
  margin-top: 12px;
}

.app-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--muted);
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  background: var(--accent);
}

.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(75, 141, 248, 0.08);
}

.drop-instructions {
  color: var(--muted);
  margin-bottom: 8px;
}

.drop-instructions span {
  display: inline-block;
  margin: 0 8px;
  color: var(--muted);
}

.controls {
  margin-top: 14px;
}

.controls-row {
  display: flex;
  gap: 10px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #141a20;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
}

.button.ghost {
  background: transparent;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button.mini {
  padding: 6px 8px;
  font-size: 13px;
}

.list-wrap {
  margin-top: 14px;
}

.image-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.image-item {
  display: grid;
  grid-template-columns: 40px 1fr 28px;
  grid-template-rows: auto auto auto;
  align-items: start;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #141a20;
}

.item-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* Document title section */
.document-title-section {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.document-title-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.document-title-input:focus,
.heading-input:focus,
.caption-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Heading input for each image */
.heading-input {
  grid-column: 1 / -1;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
}

.caption-input {
  grid-column: 1 / -1;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
  resize: vertical;
  min-height: 50px;
  font-family: inherit;
}

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Container for thumbnail with overlay controls */
/* Container for thumbnail with overlay controls */
.thumb-container {
  width: 40px;
  height: 40px;
  position: relative;
  grid-row: 1;
  grid-column: 1;
}

.rotate-controls {
  display: none;
}

.handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: grab;
  grid-row: 1;
  grid-column: 3;
}

.handle:active {
  cursor: grabbing;
}

.preview {
  background: #0e1317;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.preview {
  max-height: 80vh;
  overflow-y: auto;
}

.a4-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.a4 {
  aspect-ratio: 210 / 297;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.a4:last-child {
  margin-bottom: 0;
}

.page-block {
  padding: 16px;
}

.page-block img {
  width: 100%;
  display: block;
}

.caption {
  color: #3c4752;
  font-size: 13px;
}

.info {
  margin: 36px 0;
}

.info h2 {
  margin: 0 0 10px;
}

.info .muted {
  color: var(--muted);
}

.bullets {
  color: var(--muted);
}

.bullets li {
  margin: 6px 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  color: var(--primary);
  margin: 0 0 6px;
  display: inline-block;
}

.muted {
  color: var(--muted);
}

.info-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  justify-content: space-between;
}

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

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

.step {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #10151a;
}

.step-num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(75, 141, 248, 0.12);
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 8px;
}

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

.card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #10151a;
}

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

.tips .bullets li {
  margin: 10px 0;
}

.blog-cards .card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.cta {
  text-align: center;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  padding: 16px 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .controls-row {
    flex-wrap: wrap;
  }

  .info-header {
    flex-direction: column;
  }
}