
body.create-page .task-edit-btn,
body.create-page .task-resend-btn,
body.create-page .task-action-btn,
body.create-page .jump-to-bottom-btn {
  border: 1px solid var(--tap-line-strong) !important;
  border-radius: 8px !important;
  background: #0f0f0f !important;
  color: var(--tap-text-muted) !important;
  box-shadow: none !important;
  transition: border-color 200ms cubic-bezier(0, 0, 0.2, 1), background-color 200ms cubic-bezier(0, 0, 0.2, 1), color 200ms cubic-bezier(0, 0, 0.2, 1) !important;
}

body.create-page .task-edit-btn:hover,
body.create-page .task-resend-btn:hover,
body.create-page .task-action-btn:hover,
body.create-page .jump-to-bottom-btn:hover {
  border-color: rgba(255, 255, 255, 0.07) !important;
  background: #161616 !important;
  color: var(--tap-text) !important;
  box-shadow: none !important;
}

body.create-page .ai-result-frame,
body.create-page .ai-result-image,
body.create-page .ai-result-video,
body.create-page .message-ref-img,
body.create-page .ai-result-placeholder,
body.create-page .ai-result-failed-slot,
body.create-page .ai-result-expired-slot {
  border-color: var(--tap-line) !important;
  border-radius: 8px !important;
  background: #111 !important;
}

body.create-page .ai-result-image:hover {
  box-shadow: none !important;
  transform: scale(1.03);
  transition: transform 500ms cubic-bezier(0, 0, 0.2, 1) !important;
}

/* Completed media sits directly on the workspace; only loading/error slots get a surface. */
body.create-page .task-card-stack,
body.create-page .task-output,
body.create-page .ai-result-frame,
body.create-page .ai-result-frame > .ai-result-image,
body.create-page .ai-result-frame > .ai-result-video {
  background: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.create-page .task-wait-pulse i {
  background: linear-gradient(180deg, var(--tap-text-soft), var(--tap-text-dim)) !important;
}

body.create-page .loading-spinner {
  border-top-color: #f0f0f0 !important;
  color: #f0f0f0 !important;
}

body.create-page .strands-loader {
  filter: grayscale(1) contrast(0.92);
}

/* Gallery and viewer stay in the same route but use the same solid material. */
body.create-page .gallery-view {
  background-color: var(--tap-bg) !important;
  background-image:
    radial-gradient(
      ellipse 62% 38% at 50% 38%,
      rgba(48, 57, 61, 0.12),
      transparent 72%
    ),
    linear-gradient(180deg, #07090a 0%, #090c0d 52%, #050607 100%) !important;
  background-position: center !important;
  background-size: auto !important;
}

body.create-page .gallery-topbar {
  border-bottom-color: var(--tap-line) !important;
  background: rgba(10, 10, 10, 0.9) !important;
  box-shadow: var(--tap-inset) !important;
  -webkit-backdrop-filter: blur(24px) saturate(108%) !important;
  backdrop-filter: blur(24px) saturate(108%) !important;
}

body.create-page .gallery-title {
  color: var(--tap-text) !important;
}

body.create-page .gallery-subtitle,
body.create-page .gallery-time,
body.create-page .gallery-retention {
  color: var(--tap-text-muted) !important;
}

body.create-page .gallery-filters,
body.create-page .gallery-date-search {
  border-color: var(--tap-line) !important;
  border-radius: 16px !important;
  background: rgba(24, 24, 24, 0.92) !important;
  box-shadow: var(--tap-inset) !important;
  -webkit-backdrop-filter: blur(22px) saturate(105%) !important;
  backdrop-filter: blur(22px) saturate(105%) !important;
}

body.create-page .gallery-filter,
body.create-page .gallery-action-btn,
body.create-page .gallery-close-btn,
body.create-page .gallery-day-toggle,
body.create-page .gallery-card-actions button,
body.create-page .gallery-date-search button {
  border: 1px solid var(--tap-line) !important;
  border-radius: 999px !important;
  background: var(--tap-surface-soft) !important;
  color: var(--tap-text-soft) !important;
  box-shadow: var(--tap-inset) !important;
}

body.create-page .gallery-filter:hover,
body.create-page .gallery-action-btn:hover,
body.create-page .gallery-close-btn:hover,
body.create-page .gallery-day-toggle:hover,
body.create-page .gallery-card-actions button:hover,
body.create-page .gallery-date-search button:hover {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: var(--tap-surface-hover) !important;
  color: var(--tap-text) !important;
}

body.create-page .gallery-filter.active {
  border-color: rgba(255, 255, 255, 0.32) !important;
  background: #363636 !important;
  color: #fff !important;
}

body.create-page .gallery-card {
  border: 1px solid var(--tap-line) !important;
  border-radius: 12px !important;
  background: #1d1d1d !important;
  box-shadow: none !important;
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body.create-page .gallery-card:hover {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: #222 !important;
  box-shadow: none !important;
  transform: none;
}

body.create-page .gallery-thumb,
body.create-page .gallery-thumb-grid,
body.create-page .gallery-thumb-placeholder {
  border-radius: 8px !important;
}

body.create-page .gallery-date-search input,
body.create-page .gallery-date-picker {
  border-color: var(--tap-line) !important;
  border-radius: 11px !important;
  background: #181818 !important;
  color: var(--tap-text) !important;
  box-shadow: var(--tap-inset) !important;
}

body.create-page .image-viewer {
  background: rgba(3, 3, 3, 0.94) !important;
}

body.create-page .image-viewer-toolbar,
body.create-page .image-viewer-close {
  border-color: var(--tap-line-strong) !important;
  background: rgba(29, 29, 29, 0.94) !important;
  box-shadow: var(--tap-inset), 0 18px 48px rgba(0, 0, 0, 0.4) !important;
  -webkit-backdrop-filter: blur(24px) saturate(108%) !important;
  backdrop-filter: blur(24px) saturate(108%) !important;
}

body.create-page .image-viewer-download {
  border-color: var(--tap-line-strong) !important;
  background: var(--tap-surface) !important;
  color: var(--tap-text-soft) !important;
  box-shadow: var(--tap-inset) !important;
}

body.create-page .image-viewer-close,
body.create-page .image-viewer-download {
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  line-height: 1;
}

body.create-page .image-viewer-close > .ui-icon,
body.create-page .image-viewer-download > .ui-icon {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 !important;
  vertical-align: middle;
}

body.create-page .image-viewer-tool:hover,
body.create-page .image-viewer-download:hover,
body.create-page .image-viewer-close:hover {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  color: var(--tap-text) !important;
}

/* Viewer loading and recovery use the same quiet graphite control language. */
body.create-page .image-viewer-status {
  gap: 10px;
  width: max-content;
  min-height: 42px;
  max-width: calc(100% - 32px);
  padding: 0 14px 0 12px;
  box-sizing: border-box;
  border-color: var(--tap-line-strong) !important;
  border-radius: 6px !important;
  background: var(--tap-surface) !important;
  color: var(--tap-text-soft) !important;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  box-shadow: var(--tap-inset), var(--tap-float-shadow) !important;
}

body.create-page #imageViewerStatusText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.create-page .image-viewer-status-indicator {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid var(--tap-highlight) !important;
  border-top-color: var(--tap-text-soft) !important;
  border-radius: 50% !important;
  animation-duration: 820ms;
}

body.create-page .image-viewer-stage.is-error .image-viewer-status {
  color: var(--tap-text-soft) !important;
}

body.create-page .image-viewer-stage.is-error .image-viewer-status-indicator {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 116, 100, 0.38) !important;
  border-radius: 50% !important;
  background: rgba(255, 116, 100, 0.1);
  color: #ff7464;
  animation: none;
}

body.create-page .image-viewer-stage.is-error .image-viewer-status-indicator::before {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

body.create-page .image-viewer-status-retry {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border-color: var(--tap-line-strong) !important;
  border-radius: 5px;
  background: var(--tap-surface-raised) !important;
  color: var(--tap-text) !important;
  box-shadow: var(--tap-inset);
  white-space: nowrap;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1), background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.create-page .image-viewer-status-retry:hover {
  border-color: var(--tap-focus) !important;
  background: var(--tap-surface-hover) !important;
}

body.create-page .image-viewer-status-retry:active {
  background: var(--tap-surface) !important;
}

body.create-page .image-viewer-status-retry:focus-visible {
  outline-color: var(--tap-focus);
}

/* Viewer metadata is a compact production ledger, not a second card stack. */
body.create-page .image-viewer-details-shell {
  border-color: var(--tap-line) !important;
  background: var(--tap-bg-deep) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.create-page .image-viewer-details {
  scrollbar-color: var(--tap-highlight) transparent;
}

body.create-page .image-viewer-detail-header {
  border-color: var(--tap-line) !important;
  background: var(--tap-bg-deep) !important;
}

body.create-page .image-viewer-detail-title {
  color: var(--tap-text) !important;
}

body.create-page .image-viewer-detail-time {
  color: var(--tap-text-dim) !important;
}

body.create-page .image-viewer-header-prompt {
  color: var(--tap-text-soft) !important;
}

body.create-page .image-viewer-detail-body {
  gap: 0;
  padding: 4px 24px 24px;
}

body.create-page .image-viewer-detail-section {
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--tap-line);
}

body.create-page .image-viewer-detail-section:last-child {
  border-bottom: 0;
}

body.create-page .image-viewer-detail-label {
  color: var(--tap-text-dim) !important;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0;
}

body.create-page .image-viewer-reference-list {
  grid-template-columns: repeat(auto-fill, 56px);
  gap: 8px;
  counter-reset: viewer-reference;
}

body.create-page .image-viewer-reference {
  width: 56px;
  border-color: var(--tap-line) !important;
  border-radius: 4px !important;
  background: var(--tap-bg-deep) !important;
  counter-increment: viewer-reference;
}

body.create-page .image-viewer-reference::after {
  content: counter(viewer-reference);
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--tap-line);
  border-radius: 4px;
  background: rgba(8, 10, 12, 0.82);
  color: var(--tap-text-soft);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
}

body.create-page .image-viewer-reference-status {
  color: var(--tap-text-muted) !important;
}

body.create-page .image-viewer-reference.is-recovering .image-viewer-reference-status {
  color: var(--tap-text-soft) !important;
}

body.create-page .image-viewer-reference.is-error .image-viewer-reference-status {
  color: #ff7464 !important;
}

body.create-page .image-viewer-spec-list {
  gap: 6px;
}

body.create-page .image-viewer-spec {
  min-width: 0;
  min-height: 26px;
  max-width: 100%;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid var(--tap-line);
  border-radius: 4px;
  background: var(--tap-surface-raised);
  color: var(--tap-text-soft) !important;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.create-page .image-viewer-spec + .image-viewer-spec::before {
  display: none;
  content: none;
}

body.create-page .image-viewer-detail-section:has(.image-viewer-elapsed) {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding-block: 16px;
}

body.create-page .image-viewer-elapsed {
  margin: 0;
  color: var(--tap-text) !important;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1.4;
  letter-spacing: 0;
}

body.create-page .image-viewer-detail-empty {
  color: var(--tap-text-muted) !important;
}

@media (max-width: 900px) {
  body.create-page .image-viewer-detail-body {
    padding: 0 20px 20px;
  }

  body.create-page .image-viewer-detail-section {
    padding: 16px 0;
  }
}

@media (max-width: 560px) {
  body.create-page .image-viewer-detail-body {
    padding-inline: 16px;
  }

  body.create-page .image-viewer-reference-list {
    grid-template-columns: repeat(auto-fill, 52px);
  }

  body.create-page .image-viewer-reference {
    width: 52px;
  }

  body.create-page .image-viewer-spec {
    min-height: 28px;
  }
}

/* Keyboard and system preferences */
body.create-page :is(button, a, input, textarea, select, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--tap-focus) !important;
  outline-offset: 3px !important;
}

body.create-page,
body.create-page .chat-container,
body.create-page .gallery-content,
body.create-page .create-select-menu {
  scrollbar-color: #4c4c4c transparent;
}

@media (max-width: 700px) {
  body.create-page .bg-glow,
  body.create-page .bg-glow.floating-lines-fallback,
  body.create-page .gallery-view {
    background-size: auto !important;
  }

  body.create-page .input-panel {
    border-radius: 16px !important;
    background: rgba(29, 29, 29, 0.97) !important;
  }

  body.create-page .tabs,
  body.create-page .create-select-menu,
  body.create-page .model-dropdown-inline,
  body.create-page .media-mention-popover,
  body.create-page .user-dropdown {
    border-radius: 12px !important;
  }

  body.create-page .message-content,
  body.create-page .task-card,
  body.create-page .task-message .task-card,
  body.create-page .gallery-card {
    border-radius: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.create-page .btn-send:hover:not(:disabled),
  body.create-page .ai-result-image:hover,
  body.create-page .gallery-card:hover {
    transform: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body.create-page .input-panel,
  body.create-page .message-content,
  body.create-page .create-select-menu,
  body.create-page .model-dropdown-inline,
  body.create-page .media-mention-popover,
  body.create-page .user-dropdown,
  body.create-page .gallery-topbar,
  body.create-page .gallery-filters,
  body.create-page .gallery-date-search {
    background-color: var(--tap-surface) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
