:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background-color: #f4f6fb;
  color: #1d1f27;
  --bg: #f5f6fb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --accent: #7c3aed;
  --accent-dark: #5b21b6;
  --accent-soft: #ede9fe;
  --border: #e5e7eb;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --panel-dark: #171a21;
  --panel-darker: #13161c;
  --panel-border: #262b36;
  --panel-text: #e5e7eb;
  --panel-muted: #9aa3b2;
  --preview-bg: #1e1e1e;
  --accent-strong: #6366f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #0d0f14;
  color: var(--panel-text);
}

.page-tabs {
  display: flex;
  gap: 12px;
  padding: 16px clamp(20px, 4vw, 40px);
  background: #0f172a;
  border-bottom: 1px solid #111827;
}

.page-tab {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border 0.2s ease;
}

.page-tab:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
}

.page-tab.is-active {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
}

[data-page] {
  display: none;
}

[data-page].is-active {
  display: block;
}

.app {
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 96px;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100vh - 72px);
}

.app.is-active {
  display: flex;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.header-actions {
  display: flex;
  gap: var(--space-2);
}

header h1 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.app-header h1 {
  color: #f8fafc;
}

.app-header p {
  margin: 0;
  color: var(--panel-muted);
}

.app-version {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr) minmax(420px, 1fr);
  gap: var(--space-3);
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--panel-darker);
  border-radius: 16px;
  padding: var(--space-3);
  border: 1px solid var(--panel-border);
  box-shadow: none;
  min-height: 0;
  overflow: hidden;
}

.panel-center {
  background: var(--preview-bg);
  border-color: #2c313c;
  padding: var(--space-3);
}

.panel-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: auto;
  padding-right: var(--space-1);
  min-height: 0;
  flex: 1;
}

.panel-toggle {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  background: #1f2937;
  color: #f8fafc;
  border: 1px solid #2f3644;
  box-shadow: none;
}

.panel-toggle:hover:not([disabled]) {
  background: #283244;
}

.control {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.control-tight {
  gap: var(--space-1);
}

.control-label {
  font-weight: 600;
  color: var(--panel-text);
  font-size: 0.9rem;
}

.control-value {
  font-size: 0.85rem;
  color: var(--panel-muted);
  font-weight: 600;
}

.control-help {
  font-size: 0.85rem;
  color: var(--panel-muted);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.control-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

.control-inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: var(--space-2);
  align-items: center;
}

.input-number {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2e3442;
  background: #111827;
  color: var(--panel-text);
}

.accordion {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #151923;
  padding: var(--space-2) var(--space-2);
}

.accordion summary {
  font-weight: 600;
  color: var(--panel-text);
  cursor: pointer;
  list-style: none;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion[open] summary {
  margin-bottom: var(--space-2);
}

.accordion-body {
  display: grid;
  gap: var(--space-3);
}

.collapsible-details {
  border: 1px solid #2c313c;
  border-radius: 12px;
  padding: var(--space-2);
  background: #0f131b;
}

.collapsible-details summary {
  font-weight: 600;
  color: var(--panel-text);
  cursor: pointer;
  list-style: none;
}

.collapsible-details summary::-webkit-details-marker {
  display: none;
}

.collapsible-details[open] summary {
  margin-bottom: var(--space-2);
}

.watermark-fields {
  display: grid;
  gap: var(--space-2);
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--panel-text);
}

.toggle-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-strong);
}

.template-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  max-height: 320px;
  overflow: auto;
  padding-right: 6px;
}

.template-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2);
  border-radius: 12px;
  background: #0f131b;
  border: 1px solid #262b36;
  transition: border 0.2s ease, background 0.2s ease;
}

.template-option input {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

.template-option:hover {
  border-color: #3b4253;
  background: #121826;
}

.template-preview {
  width: 50%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #2c313c;
  background: #0b0f14;
}

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

.template-name {
  font-weight: 600;
  color: var(--panel-text);
  font-size: 0.6em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  width: 100%;
}

.drop-zone {
  border: 1px dashed #3a4256;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: var(--panel-muted);
  background: #0f131b;
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.drop-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-direction: column;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: none;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.file-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.3);
}

.drop-row .drop-zone {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone.dragging {
  border-color: var(--accent-strong);
  color: #e0e7ff;
  background: rgba(99, 102, 241, 0.12);
}

button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: none;
}

button:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.3);
}

button[disabled] {
  background: #1f2937;
  border: 1px solid #334155;
  color: #e2e8f0;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary-button[disabled] {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.secondary-button {
  background: rgba(14, 165, 233, 0.16);
  color: #e0f2fe;
  border: 1px solid #38bdf8;
  box-shadow: none;
}

.secondary-button:hover:not([disabled]) {
  box-shadow: 0 6px 14px rgba(56, 189, 248, 0.2);
}

select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2c313c;
  background: #0f131b;
  font-weight: 600;
  color: var(--panel-text);
}

.app input[type="range"] {
  accent-color: var(--accent-strong);
}

.app input[type="color"] {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #2c313c;
  background: #0f131b;
  padding: 0;
}

.status {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.status-compact {
  padding: var(--space-2);
  border-radius: 12px;
  background: #151a22;
  border: 1px solid #2b313c;
}

progress {
  width: 100%;
  height: 8px;
}

.preview-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.preview-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  background: #1b1f2a;
  border: 1px solid #2d3442;
  display: flex;
}

.preview-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  overflow: auto;
}

.grid-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #dbe3f3;
}

.file-grid,
.mockup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.grid-card {
  border: 1px solid #2d3442;
  border-radius: 12px;
  background: #111722;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.grid-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2c313c;
  background: #0b0f14;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid-card-title {
  font-size: 0.78rem;
  color: var(--panel-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-card-meta {
  font-size: 0.72rem;
  color: var(--panel-muted);
  line-height: 1.25;
}

.grid-empty {
  color: var(--panel-muted);
  font-size: 0.82rem;
}

.preview-overlay-controls {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-2);
  z-index: 2;
}

.icon-button {
  padding: 6px 10px;
  border-radius: 8px;
  background: #0f131b;
  border: 1px solid #2d3442;
  color: var(--panel-text);
  font-size: 0.85rem;
  box-shadow: none;
}

.preview-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

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

.preview-table {
  display: none;
}

.preview-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.preview-table th,
.preview-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #232935;
}

.artwork-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--panel-text);
}

.artwork-name {
  font-size: 0.8rem;
  line-height: 1.2;
  word-break: break-word;
}

.artwork-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #2c313c;
  background: #0b0f14;
}

.preview-table th {
  background: #151a22;
  font-weight: 600;
  color: var(--panel-text);
}

.preview-table thead th {
  font-size: 0.85rem;
}

.preview-table td {
  background: #0f131b;
  color: var(--panel-text);
  vertical-align: top;
  font-size: 0.85rem;
}

@media (max-width: 1200px) {
  .workspace-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .panel-right {
    position: fixed;
    top: 72px;
    right: 0;
    height: calc(100vh - 100px);
    width: min(320px, 90vw);
    transform: translateX(110%);
    transition: transform 0.2s ease;
    z-index: 20;
  }

  body.right-panel-open .panel-right {
    transform: translateX(0);
  }
}

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

  .panel-left {
    position: fixed;
    top: 72px;
    left: 0;
    height: calc(100vh - 100px);
    width: min(340px, 90vw);
    transform: translateX(-110%);
    transition: transform 0.2s ease;
    z-index: 20;
  }

  body.left-panel-open .panel-left {
    transform: translateX(0);
  }

  .header-actions {
    display: none;
  }

  .global-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .global-actions {
    justify-content: space-between;
  }
}

.preview-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 120px;
}

.preview-cell img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 10px;
  box-shadow: none;
}

.preview-image {
  cursor: pointer;
}

.color-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: 4px;
}

.color-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: 10px;
  background: #111827;
  border: 1px solid #2c313c;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.color-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--panel-text);
}

.is-hidden {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.lightbox.is-active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
}

.lightbox-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
  max-width: min(90vw, 1200px);
  max-height: 85vh;
}

.lightbox-content img {
  max-width: min(76vw, 1000px);
  max-height: 85vh;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.4);
}

.lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  background: #f8fafc;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.3);
}

.lightbox-nav {
  background: rgba(248, 250, 252, 0.9);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.3);
}

.lightbox-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.preview-placeholder {
  font-size: 0.85rem;
  color: #8a91a6;
}

.preview-error {
  font-size: 0.85rem;
  color: #c03543;
}

.queue-hint {
  font-size: 0.8rem;
  color: var(--panel-muted);
}

.queue-list {
  display: grid;
  gap: var(--space-2);
  max-height: 320px;
  overflow: auto;
}

.queue-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: 10px;
  background: #0f131b;
  border: 1px solid #2a303c;
}

.queue-item.is-drag-over {
  border-color: var(--accent-strong);
  background: rgba(99, 102, 241, 0.12);
}

.queue-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-strong);
}

.queue-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2c313c;
  background: #0b0f14;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--panel-muted);
  font-size: 0.65rem;
}

.queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-name {
  font-size: 0.85rem;
  color: var(--panel-text);
}

.queue-handle {
  font-size: 1rem;
  color: var(--panel-muted);
  cursor: grab;
  user-select: none;
}

.global-action-bar {
  position: sticky;
  bottom: 0;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: 14px;
  background: #121620;
  border: 1px solid #2b313c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  z-index: 5;
}

.queue-indicator {
  font-size: 0.9rem;
  color: var(--panel-muted);
}

.global-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-ready {
  background: #e4f4ec;
  color: #19724b;
}

.status-rendering {
  background: #e9f0ff;
  color: #1b57c5;
}

.pdf-page {
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: calc(100vh - 72px);
}

.pdf-page .header-bar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px clamp(24px, 5vw, 56px);
  background: #0f172a;
  color: #f8fafc;
}

.pdf-page .header-bar h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
}

.pdf-page .header-bar .right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 13px;
}

.pdf-page .header-bar img {
  height: 44px;
}

.pdf-page .header-bar a {
  color: #e0e7ff;
  text-decoration: none;
}

.pdf-page .header-bar .version {
  margin: 0;
  color: #cbd5f5;
  font-weight: 500;
}

.pdf-main {
  padding: 40px clamp(20px, 5vw, 60px) 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.pdf-page .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.pdf-page .hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
}

.pdf-page .hero p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  max-width: 680px;
}

.pdf-page .layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

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

.pdf-page .card h3 {
  margin: 0 0 18px;
  font-size: 20px;
}

.pdf-page label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}

.pdf-page input,
.pdf-page textarea,
.pdf-page select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font: inherit;
  background: #f9fafb;
}

.pdf-page textarea {
  min-height: 100px;
  resize: vertical;
}

.pdf-page .field {
  margin-bottom: 16px;
}

.pdf-page .section-title {
  margin: 20px 0 12px;
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pdf-page .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.pdf-page button {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pdf-page button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 5px 12px rgba(71, 71, 71, 0.35);
}

.pdf-page button.secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
}

.pdf-page button:hover {
  transform: translateY(-2px);
}

.pdf-page .preview {
  display: grid;
  gap: 18px;
  align-content: start;
}

.pdf-page .preview-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 22px;
  background: linear-gradient(135deg, var(--card) 0%, var(--accent-soft) 100%);
}

.pdf-page .preview-card h4 {
  margin: 0 0 8px;
  font-size: 22px;
}

.pdf-page .preview-card a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.pdf-page .preview-message {
  margin: 12px 0 18px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px dashed #d8b4fe;
  color: var(--muted);
  white-space: pre-wrap;
}

.pdf-page .download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  min-width: 200px;
  box-shadow: 0 5px 12px rgba(71, 71, 71, 0.3);
}

.pdf-page .download-path {
  display: inline-block;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted) !important;
  text-decoration: underline;
  word-break: break-all;
}

.pdf-page .image-preview {
  width: 100%;
  border-radius: 14px;
  margin: 0 auto 16px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px dashed var(--border);
  padding: 8px;
}

.pdf-page .range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdf-page .range-row output {
  min-width: 46px;
  font-weight: 600;
  color: var(--muted);
}

.pdf-page .color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.pdf-page input[type="color"] {
  padding: 0;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
}

.pdf-page .preview-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.pdf-page .helper {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.etsy-page {
  background: var(--bg);
  color: var(--ink);
  min-height: calc(100vh - 72px);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
}

.etsy-header {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(24px, 5vw, 56px);
  background: #0f172a;
  color: #f8fafc;
}

.etsy-header h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
}

.etsy-header p {
  margin: 8px 0 0;
  color: #cbd5f5;
  font-size: 15px;
}

.etsy-help {
  font-size: 13px;
  color: #e0e7ff;
  max-width: 360px;
}

.etsy-help code {
  background: rgba(15, 23, 42, 0.4);
  color: #e2e8f0;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.etsy-content {
  padding: 24px clamp(20px, 5vw, 60px) 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
  gap: 18px;
  height: calc(100vh - 220px);
  min-height: 540px;
  overflow: hidden;
}

.etsy-pane {
  border-radius: 16px;
  border: 1px solid #2c313c;
  background: #0f131b;
  padding: 16px;
  overflow-y: auto;
  min-height: 0;
}

.etsy-pane-left h3 {
  margin: 0 0 12px;
}

.etsy-pane-left .etsy-table {
  margin-top: 8px;
}

.etsy-shared-fields {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
}

.etsy-shared-fields label {
  display: grid;
  gap: 8px;
  color: var(--panel-text);
  font-size: 0.82rem;
}

.etsy-empty {
  margin: 0 0 16px;
  color: var(--muted);
}

.etsy-table {
  width: 100%;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid #2c313c;
  background: #0f131b;
}

.etsy-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.etsy-table th,
.etsy-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #232935;
  vertical-align: top;
  font-size: 0.85rem;
  color: var(--panel-text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.etsy-table th {
  background: #151a22;
  font-weight: 600;
}

.warning-file-name {
  color: #facc15;
  font-weight: 600;
  text-shadow: 0 0 0.5px #fde047, 0 0 6px rgba(250, 204, 21, 0.35);
}

.etsy-input,
.etsy-textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #2c313c;
  background: #111827;
  color: var(--panel-text);
  padding: 8px 10px;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.etsy-textarea {
  min-height: 84px;
  resize: vertical;
}

.etsy-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid #2c313c;
  background: #0b0f14;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--panel-text);
  font-size: 0.75rem;
}


.row-remove-button {
  border: 1px solid #3a4150;
  background: #1a202c;
  color: var(--panel-text);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.row-remove-button:hover {
  background: #2a3242;
}

.etsy-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

@media (max-width: 980px) {
  .etsy-content {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .etsy-pane {
    max-height: 50vh;
  }
}

@media (max-width: 720px) {
  .pdf-page .header-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .pdf-page .header-bar .right {
    align-items: flex-start;
  }
}
