* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #111318;
  color: #e6e6e6;
}

.auth-page {
  max-width: 360px;
  margin: 15vh auto 0;
  padding: 32px;
  background: #1b1e26;
  border-radius: 12px;
}

.auth-page h1 {
  font-size: 20px;
  margin-bottom: 24px;
}

.auth-page form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-page label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #a0a4ad;
}

.auth-page input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 14px;
}

.auth-page button {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: #4f7cff;
  color: white;
  font-size: 14px;
  cursor: pointer;
}

.error {
  color: #ff6b6b;
  font-size: 13px;
  min-height: 18px;
  margin-top: 12px;
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: 56px;
  background: #1b1e26;
  border-bottom: 1px solid #262b36;
}

.tab {
  color: #a0a4ad;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.tab.active {
  color: white;
  background: #2a2f3a;
}

.spacer {
  flex: 1;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 12px;
  border-radius: 50%;
  background: #4f7cff;
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}

.tabs button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  cursor: pointer;
  font-size: 13px;
}

.room {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.room-page {
  width: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #a0a4ad;
  max-width: 320px;
}

.project-selector select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 14px;
}

.room-placeholder {
  color: #a0a4ad;
  font-size: 14px;
}

.media-room {
  display: flex;
  width: 100%;
  height: 100%;
}

.gallery-panel {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.resize-handle {
  flex-shrink: 0;
  width: 6px;
  cursor: col-resize;
  background: transparent;
}

.resize-handle:hover {
  background: #333844;
}

body.resizing-split {
  cursor: col-resize;
  user-select: none;
}

body.resizing-split .resize-handle {
  background: #4f7cff;
}

.tree {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #262b36;
  overflow-y: auto;
  padding: 16px;
}

.tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #a0a4ad;
  margin-bottom: 12px;
}

.tree-header button {
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.new-project-form {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.new-project-form.hidden {
  display: none;
}

.new-project-form input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 13px;
}

.new-project-form button {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: #4f7cff;
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.tree-list,
.tree-node ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-node {
  margin-bottom: 10px;
}

.tree-node ul {
  padding-left: 12px;
}

.tree-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #e6e6e6;
  margin-bottom: 4px;
}

.tree-delete-btn {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}

.tree-delete-btn:hover {
  color: #ff6b6b;
}

.tree-trash {
  margin-top: 16px;
  border-top: 1px solid #262b36;
  padding-top: 12px;
}

.tree-trash > button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 0;
}

.trash-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.trash-list.hidden {
  display: none;
}

.trash-item {
  padding: 8px;
  border-radius: 6px;
  background: #1b1e26;
  margin-bottom: 8px;
  font-size: 12px;
}

.trash-item.trash-file-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.trash-thumb {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 4px;
}

.trash-file-info {
  flex: 1;
  min-width: 0;
}

.trash-name {
  display: block;
  color: #e6e6e6;
  margin-bottom: 2px;
}

.trash-meta {
  display: block;
  color: #6b7280;
  margin-bottom: 6px;
}

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

.trash-actions button {
  flex: 1;
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 11px;
}

.tree-leaf {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #a0a4ad;
  cursor: pointer;
}

.tree-leaf:hover {
  background: #1b1e26;
}

.tree-leaf.active {
  background: #2a2f3a;
  color: white;
}

.tree-leaf.drop-target {
  background: #2a2f3a;
  outline: 2px dashed #4f7cff;
  outline-offset: -2px;
}

.tree-empty {
  font-size: 12px;
  color: #6b7280;
  padding: 8px 0;
}

.grid-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #262b36;
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  color: #a0a4ad;
  border-bottom: 1px solid #262b36;
}

.grid-header button {
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.grid-panel.drag-over {
  outline: 2px dashed #4f7cff;
  outline-offset: -2px;
}

.delivery-grid-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.grid-view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-toggle-btn {
  border: 1px solid #333844;
  background: transparent;
  color: #a0a4ad;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.view-toggle-btn.active {
  border-color: #4f7cff;
  color: #e6e6e6;
}

.grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* One row of the justified-gallery layout (justifiedLayout.js) — items keep
   their real aspect ratio, row height comes from the inline style computed
   per-row, item widths from the inline style computed per-item. List mode
   never creates these — .grid.list-view is a separate flex-column of
   fixed-size rows, untouched by this. */
.justified-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.justified-row .grid-item {
  flex-shrink: 0;
  height: 100%;
}

.grid-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin: 4px 0;
}

.grid-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #333844;
}

.grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grid-item.list-row {
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
}

.grid-item.list-row .list-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 4px;
}

.list-filename {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #e6e6e6;
}

.list-meta {
  font-size: 11px;
  color: #6b7280;
  flex-shrink: 0;
}

.grid-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #1b1e26;
}

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

.grid-item.active {
  border-color: #4f7cff;
}

.grid-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  line-height: 18px;
  text-align: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  cursor: pointer;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.grid-item:hover .grid-delete-btn {
  opacity: 1;
}

.grid-empty {
  color: #6b7280;
  font-size: 13px;
  padding: 16px;
}

.viewer-panel {
  width: 30vw;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 12px;
  overflow-y: auto;
}

.viewer-empty {
  color: #6b7280;
  font-size: 13px;
}

.viewer-media {
  position: relative;
  overflow: hidden;
}

.viewer-media img,
.viewer-media video {
  max-width: 100%;
  max-height: 50vh;
  border-radius: 8px;
}

.viewer-histogram {
  width: 100%;
  height: 64px;
  background: #0f1116;
  border-radius: 6px;
}

.viewer-info {
  width: 100%;
  font-size: 12px;
  color: #a0a4ad;
}

.viewer-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #262b36;
}

.viewer-info-row span:last-child {
  color: #e6e6e6;
  text-align: right;
  word-break: break-word;
}

.viewer-panel button {
  border: 1px solid #333844;
  background: transparent;
  color: #ff6b6b;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
}

.viewer-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.viewer-response-text {
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: #1b1e26;
  color: #a0a4ad;
  font-size: 13px;
  white-space: pre-wrap;
}

.viewer-actions button {
  flex: 1;
}

#viewer-workflow-btn,
#viewer-prompt-btn {
  color: #4f7cff;
}

.viewer-prompt {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.viewer-prompt.hidden {
  display: none;
}

.viewer-prompt textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

#viewer-prompt-copy-btn {
  align-self: flex-end;
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.viewer-generating {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  width: 100%;
  color: #6b7280;
  font-size: 14px;
  background: #1b1e26;
  border-radius: 8px;
}

.viewer-generating.viewer-failed {
  color: #e6787c;
  padding: 16px;
  text-align: center;
}

.profile-page {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.profile-nav {
  display: flex;
  gap: 4px;
  padding: 12px 40px 0;
  border-bottom: 1px solid #262b36;
}

.profile-tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: #a0a4ad;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}

.profile-tab.active {
  color: white;
  background: #1b1e26;
}

.profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
}

.profile-section-narrow {
  max-width: 480px;
}

.profile-section h2 {
  margin-top: 0;
  font-size: 18px;
}

.profile-section h3 {
  font-size: 15px;
  color: #a0a4ad;
  margin-top: 32px;
}

.profile-field {
  margin-bottom: 20px;
}

.profile-field label {
  display: block;
  font-size: 13px;
  color: #a0a4ad;
  margin-bottom: 4px;
}

.profile-value {
  font-size: 14px;
  color: #e6e6e6;
}

.profile-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #a0a4ad;
  flex: 1;
  min-width: 180px;
}

.profile-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 14px;
}

.profile-form button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #4f7cff;
  color: white;
  font-size: 14px;
  cursor: pointer;
  height: fit-content;
}

.form-status {
  font-size: 13px;
  color: #6b7280;
}

.form-status.success {
  color: #4ade80;
}

.form-status.error {
  color: #ff6b6b;
}

.api-key-row {
  padding: 16px;
  border: 1px solid #262b36;
  border-radius: 8px;
  margin-bottom: 16px;
}

.api-key-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}

.api-key-status {
  font-size: 12px;
  color: #6b7280;
}

.api-key-status.connected {
  color: #4ade80;
}

.api-key-form {
  display: flex;
  gap: 8px;
}

.api-key-form input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 14px;
}

.api-key-form button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  font-size: 13px;
  cursor: pointer;
}

.api-key-form button[type="submit"] {
  border: none;
  background: #4f7cff;
  color: white;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.usage-table th,
.usage-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #262b36;
}

.usage-table th {
  color: #a0a4ad;
  font-weight: 500;
}

.admin-user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-user-actions button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  font-size: 12px;
  cursor: pointer;
}

.role-select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 13px;
}

.admin-keys-row.hidden {
  display: none;
}

.admin-keys-panel {
  padding: 12px 0;
}

.invite-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.invite-link-box.hidden {
  display: none;
}

.invite-link-box input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 13px;
}

.invite-link-box button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: transparent;
  color: #4f7cff;
  font-size: 13px;
  cursor: pointer;
}

.admin-project-share-card {
  border: 1px solid #262b36;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.admin-project-share-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.admin-project-owner {
  color: #a0a4ad;
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
}

.admin-project-share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.admin-project-share-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.generation-room {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.generation-topbar {
  display: flex;
  gap: 24px;
  padding: 12px 24px;
  border-bottom: 1px solid #262b36;
}

.generation-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.generation-form {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid #262b36;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#reset-form-btn {
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.batch-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid #262b36;
  border-radius: 8px;
  background: #1b1e26;
}

#batch-count-input {
  width: 56px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 12px;
}

#batch-run-btn,
#batch-cancel-btn {
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

#batch-run-btn:disabled {
  background: #333844;
  color: #6b7280;
  cursor: not-allowed;
}

#batch-cancel-btn {
  color: #ff6b6b;
}

#batch-count-input.hidden,
#batch-run-btn.hidden,
#batch-cancel-btn.hidden,
.batch-progress.hidden {
  display: none;
}

.batch-progress {
  font-size: 12px;
  color: #a0a4ad;
}

.mode-hint {
  margin: 0;
}

.mode-hint.hidden {
  display: none;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #a0a4ad;
}

.form-field input[type="text"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 13px;
}

.form-field-prompt textarea {
  resize: vertical;
  min-height: 120px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 14px;
  font-family: inherit;
}

.prompt-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#prompt-expand-btn {
  border: 1px solid #333844;
  background: transparent;
  color: #a0a4ad;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.prompt-modal {
  width: 60vw;
  max-width: 900px;
  height: 70vh;
  background: #1b1e26;
  border: 1px solid #333844;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #e6e6e6;
}

#prompt-modal-close-btn {
  border: 1px solid #333844;
  background: transparent;
  color: #4f7cff;
  border-radius: 6px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
}

#prompt-modal-textarea {
  flex: 1;
  resize: none;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 14px;
  font-family: inherit;
}

.media-modal {
  position: relative;
  width: 90vw;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overrides the normal small-panel cap so the reparented .viewer-media
   (see wireZoom reuse in viewer.js) actually fills the fullscreen modal
   instead of staying capped at the 50vh it uses in the regular viewer. */
.media-modal .viewer-media img,
.media-modal .viewer-media video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.media-extend-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.form-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-settings h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #e6e6e6;
}

.mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #a0a4ad;
}

.mode-toggle.hidden {
  display: none;
}

.dynamic-params {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.param-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #a0a4ad;
}

.param-hint {
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
}

.param-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  align-self: flex-start;
}

.param-field input:not([type="checkbox"]),
.param-field select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #0f1116;
  color: #e6e6e6;
  font-size: 13px;
}

.seed-field {
  display: flex;
  gap: 8px;
}

.seed-field input[type="number"] {
  flex: 1;
  min-width: 0;
}

.seed-field select {
  flex-shrink: 0;
}

.seed-randomize-btn {
  flex-shrink: 0;
  width: 34px;
  border: 1px solid #333844;
  border-radius: 8px;
  background: #0f1116;
  color: #e6e6e6;
  cursor: pointer;
  font-size: 14px;
}

.reference-slots-panel.hidden {
  display: none;
}

.slots-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.slots-header-label {
  font-size: 13px;
  color: #a0a4ad;
}

.slots-limit {
  font-size: 11px;
  color: #6b7280;
}

#slots-clear-all-btn,
.slots-show-more-btn {
  border: 1px solid #333844;
  background: transparent;
  color: #e6e6e6;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

#slots-clear-all-btn.hidden,
.slots-show-more-btn.hidden {
  display: none;
}

.slots-show-more-btn {
  display: block;
  margin-top: 8px;
}

.reference-slots {
  --slot-size: 72px;
  --slot-gap: 8px;
  display: flow-root;
}

.reference-slot {
  position: relative;
  float: left;
  width: var(--slot-size);
  height: var(--slot-size);
  margin: 0 var(--slot-gap) var(--slot-gap) 0;
  border: 1px dashed #333844;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reference-slot.filled {
  border-style: solid;
}

.reference-slot.main-slot {
  border-color: #4f7cff;
  width: calc(var(--slot-size) * 2 + var(--slot-gap));
  height: calc(var(--slot-size) * 2 + var(--slot-gap));
}

.reference-slot.main-slot.filled {
  border-style: solid;
}

.reference-slot.drop-target {
  border-color: #4f7cff;
}

.reference-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-empty {
  font-size: 10px;
  color: #6b7280;
  text-align: center;
  padding: 4px;
}

.slot-clear-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  cursor: pointer;
  font-size: 12px;
  line-height: 16px;
}

#generate-btn {
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  background: #4f7cff;
  color: white;
  font-size: 14px;
  cursor: pointer;
}

#generate-btn:disabled {
  background: #333844;
  color: #6b7280;
  cursor: not-allowed;
}

.compare-room {
  display: flex;
  width: 100%;
  height: 100%;
}

.compare-panel {
  width: 55vw;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  overflow-y: auto;
}

.compare-pair {
  display: flex;
  gap: 16px;
}

.compare-slot {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-dropzone {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px dashed #333844;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1116;
}

.compare-dropzone.filled {
  border-style: solid;
}

.compare-dropzone.drop-target {
  border-color: #4f7cff;
}

.compare-dropzone img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compare-wipe {
  position: relative;
  flex: 1;
  min-height: 240px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wipe-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wipe-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #4f7cff;
  pointer-events: none;
}

.delivery-room {
  display: flex;
  width: 100%;
  height: 100%;
}

.delivery-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  border-right: 1px solid #262b36;
  overflow-y: auto;
}

.rating-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #a0a4ad;
}

.rating-filter-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rating-filter-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.export-control {
  position: relative;
}

#export-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333844;
  background: #1b1e26;
  color: #e6e6e6;
  cursor: pointer;
  font-size: 14px;
}

#export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #333844;
  border-radius: 8px;
  background: #1b1e26;
  overflow: hidden;
  z-index: 10;
}

.export-menu.hidden {
  display: none;
}

.export-menu button {
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #e6e6e6;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.export-menu button:hover {
  background: #262b36;
}

.delivery-item {
  position: relative;
}

.delivery-item.selected {
  border-color: #4f7cff;
}

.delivery-checkbox {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 16px;
  height: 16px;
}

.delivery-rating {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 4px 0;
  background: rgba(0, 0, 0, 0.6);
  font-size: 13px;
}

.star {
  cursor: pointer;
  color: #6b7280;
}

.star.filled {
  color: #f5c518;
}
