/* Pixjoin Workspace — Light-Table Contact Sheet */
.pj-app {
  background: var(--card, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 10px);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(15, 23, 42, 0.06));
  overflow: hidden;
}

.pj-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.pj-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  padding: 4px 10px;
  border-radius: 999px;
}

.pj-privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #14b8a6;
  flex: none;
}

.pj-spec-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.pj-spec-chip {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.pj-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 520px;
}

.pj-sidebar {
  border-right: 1px solid var(--line, #e2e8f0);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}

.pj-dropzone {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  background: #f8fafc;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
}

.pj-dropzone:hover,
.pj-dropzone.is-dragover {
  border-color: var(--accent, #2563eb);
  background: #eff6ff;
}

.pj-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.pj-drop-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  color: var(--accent, #2563eb);
}

.pj-drop-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.pj-drop-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #64748b);
}

.pj-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pj-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text, #0f172a);
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pj-btn-ghost:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
}

.pj-btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pj-btn-demo {
  color: var(--accent, #2563eb);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.pj-btn-demo:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
}

.pj-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.pj-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.pj-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.pj-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 8px;
}

.pj-seg button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted, #64748b);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pj-seg button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--text, #0f172a);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.pj-select,
.pj-range {
  width: 100%;
  font-family: inherit;
}

.pj-select {
  height: 40px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text, #0f172a);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.pj-range {
  accent-color: var(--accent, #2563eb);
  cursor: pointer;
}

.pj-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pj-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pj-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  cursor: pointer;
  padding: 0;
  background: #ffffff;
  position: relative;
}

.pj-swatch[aria-pressed="true"] {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.pj-swatch-trans {
  background-image:
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%),
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%),
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}

.pj-color-input {
  width: 34px;
  height: 32px;
  padding: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.pj-stage-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f8fafc;
}

.pj-strip-wrap {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  background: #ffffff;
}

.pj-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pj-strip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.pj-strip-actions {
  display: flex;
  gap: 6px;
}

.pj-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pj-thumb {
  flex: 0 0 116px;
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
  user-select: none;
}

.pj-thumb.is-dragging {
  opacity: 0.45;
  border-style: dashed;
}

.pj-thumb.is-over {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.pj-thumb-media {
  position: relative;
  height: 68px;
  border-radius: 5px;
  overflow: hidden;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pj-thumb-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.pj-thumb-num {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.pj-thumb-meta {
  font-size: 11px;
  color: var(--muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.pj-thumb-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.pj-thumb-btns button {
  height: 24px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text, #0f172a);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pj-thumb-btns button:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--accent, #2563eb);
}

.pj-thumb-btns button[data-act="del"]:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.pj-thumb-btns button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pj-canvas-wrap {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  background-color: #f1f5f9;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 16px 16px;
  overflow: auto;
}

.pj-empty-state {
  max-width: 380px;
  text-align: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
}

.pj-empty-state p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted, #64748b);
}

.pj-empty-state strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  color: var(--text, #0f172a);
}

.pj-canvas-frame {
  max-width: 100%;
  background: transparent;
  line-height: 0;
}

.pj-canvas-frame canvas {
  display: block;
  max-width: 100%;
  max-height: 540px;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-color: #ffffff;
}

.pj-export-bar {
  padding: 14px 16px;
  border-top: 1px solid var(--line, #e2e8f0);
  background: #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pj-format-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pj-format-controls select {
  width: auto;
  min-width: 130px;
  height: 44px;
}

.pj-quality-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, #64748b);
}

.pj-quality-wrap input {
  width: 90px;
}

.pj-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pj-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #2563eb);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.pj-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.pj-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pj-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text, #0f172a);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.pj-btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}

.pj-btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pj-status {
  padding: 0 16px 12px;
  font-size: 13px;
  color: var(--muted, #64748b);
  background: #ffffff;
}

.pj-status[data-tone="ok"] {
  color: #0f766e;
}

.pj-status[data-tone="warn"] {
  color: #b45309;
}

.pj-status[data-tone="err"] {
  color: #dc2626;
}

.pj-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .pj-grid {
    grid-template-columns: 1fr;
  }
  .pj-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line, #e2e8f0);
  }
}

@media (max-width: 640px) {
  .pj-topbar {
    padding: 10px 12px;
  }
  .pj-sidebar {
    padding: 12px;
  }
  .pj-export-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .pj-format-controls {
    justify-content: space-between;
  }
  .pj-format-controls select {
    flex: 1;
  }
  .pj-export-actions {
    flex-direction: column;
  }
  .pj-btn-primary,
  .pj-btn-secondary {
    width: 100%;
  }
  .pj-canvas-wrap {
    padding: 12px;
    min-height: 260px;
  }
}
