/*
THESIS: Keep the existing creation workstation intact and replace its neon glass skin with TapNow's quiet, content-first dark workspace.
OWN-WORLD: Near-black graphite field, solid #1d1d1d surfaces, restrained white hairlines, 16-20px corners, inset top highlights, and neutral controls.
STORY: The user's own image/video workflow remains immediately recognizable; surfaces recede, output media carries color, and state changes stay legible.
FIRST VIEWPORT: Existing brand, task rail, mode switcher, composer, settings, and send action keep their exact composition while adopting the new material system.
FORM: User-pinned TapNow reference applied as a CSS-only overlay; the incumbent layout is fixed, so no concept seed or replacement structure is used.
*/

body.create-page {
  --tap-bg: #0a0a0a;
  --tap-bg-deep: #0f0f0f;
  --tap-surface: #1f1f1f;
  --tap-surface-soft: #222;
  --tap-surface-raised: #262626;
  --tap-surface-hover: #2b2b2b;
  --tap-line: rgba(255, 255, 255, 0.1);
  --tap-line-strong: rgba(255, 255, 255, 0.15);
  --tap-highlight: rgba(255, 255, 255, 0.16);
  --tap-text: #f5f5f5;
  --tap-text-soft: #e6e6e6;
  --tap-text-muted: #a3a3a3;
  --tap-text-dim: #737373;
  --tap-focus: rgba(255, 255, 255, 0.35);
  --tap-inset: inset 0 0.5px 0 rgba(255, 255, 255, 0.16);
  --tap-float-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 10px -1px rgba(0, 0, 0, 0.1);
  background: var(--tap-bg) !important;
  color: var(--tap-text);
  color-scheme: dark;
}

body.create-page ::selection {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

body.create-page .bg-glow,
body.create-page .bg-glow.floating-lines-fallback {
  background-color: var(--tap-bg) !important;
  background-image:
    radial-gradient(
      ellipse 62% 38% at 50% 38%,
      rgba(48, 57, 61, 0.14),
      transparent 72%
    ),
    linear-gradient(
      180deg,
      #07090a 0%,
      #090c0d 52%,
      #050607 100%
    ) !important;
  background-position: center !important;
  background-size: auto !important;
  animation: none !important;
}

body.create-page .bg-glow::after {
  background: none !important;
}

body.create-page .bg-glow::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 230px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.9) 12%,
    rgba(0, 0, 0, 0.7) 26%,
    rgba(0, 0, 0, 0.38) 42%,
    rgba(0, 0, 0, 0.14) 58%,
    rgba(0, 0, 0, 0) 78%
  );
}

body.create-page .bg-glow .floating-lines-canvas {
  display: none !important;
}

body.create-page .particle {
  display: none !important;
}

body.create-page :is(
  .media-mode-btn,
  .tab-item,
  .upload-card,
  .video-upload-card,
  .btn-add-image,
  .image-add-tile,
  .btn-clear-images,
  .btn-send,
  .model-selector-trigger,
  .create-select-trigger,
  .create-select-option,
  .model-option-inline,
  .dropdown-item,
  .gallery-filter,
  .gallery-action-btn,
  .gallery-close-btn
) {
  transition-property: color, background-color, border-color, outline-color, box-shadow !important;
  transition-duration: 150ms !important;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Brand and shared account shell */
body.create-page .create-floating-brand {
  color: var(--tap-text) !important;
  text-shadow: none !important;
}

body.create-page .create-floating-brand::after {
  border-left-color: var(--tap-line-strong);
  color: #808080;
}

body.create-page .create-floating-brand .logo-icon {
  border: 0;
  border-radius: 5px;
  background: var(--studio-gradient) !important;
  color: #fff !important;
  box-shadow: none;
}

body.create-page .nav-user-area .nav-login-btn,
body.create-page .nav-membership-btn,
body.create-page .nav-points,
body.create-page .user-avatar-trigger {
  border-color: var(--tap-line-strong) !important;
  background-color: rgba(29, 29, 29, 0.85) !important;
  color: var(--tap-text-soft) !important;
  box-shadow: var(--tap-inset) !important;
  -webkit-backdrop-filter: blur(20px) saturate(110%) !important;
  backdrop-filter: blur(20px) saturate(110%) !important;
}

body.create-page .nav-user-area .nav-login-btn:hover,
body.create-page .nav-membership-btn:hover,
body.create-page .nav-membership-btn:focus-visible,
body.create-page .nav-points:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
  background-color: var(--tap-surface-raised) !important;
  color: var(--tap-text) !important;
  box-shadow: var(--tap-inset) !important;
}

/* 购买积分：实心白 chip（10px 圆角、hover 微灰），无气泡特效。 */
body.create-page .nav-purchase-btn {
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background-color: #fff !important;
  color: #17191c !important;
  font-weight: 600;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.create-page .nav-purchase-btn:hover,
body.create-page .nav-purchase-btn:focus-visible {
  border-color: transparent !important;
  background-color: #f2f4f6 !important;
  color: #000 !important;
  box-shadow: none !important;
  transform: none;
}

body.create-page .nav-purchase-btn .ui-icon,
body.create-page .nav-purchase-btn:hover .ui-icon {
  color: #17191c !important;
}

body.create-page .nav-membership-btn {
  border-color: rgba(196, 181, 253, 0.72) !important;
  background: linear-gradient(135deg, #a66cff 0%, #7257ff 52%, #5848e8 100%) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(88,72,232,0.22) !important;
}

body.create-page .nav-membership-btn:hover,
body.create-page .nav-membership-btn:focus-visible {
  border-color: rgba(237, 233, 254, 0.82) !important;
  background: linear-gradient(135deg, #b584ff 0%, #806cff 52%, #6557ef 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(88,72,232,0.3) !important;
}

body.create-page .nav-membership-btn .ui-icon,
body.create-page .nav-membership-btn:hover .ui-icon {
  color: #fff !important;
}

body.create-page .user-dropdown {
  border: 1px solid var(--tap-line-strong) !important;
  border-radius: 12px !important;
  background: rgba(21, 21, 21, 0.95) !important;
  box-shadow: var(--tap-inset), var(--tap-float-shadow) !important;
  -webkit-backdrop-filter: blur(28px) saturate(110%) !important;
  backdrop-filter: blur(28px) saturate(110%) !important;
}

body.create-page .dropdown-header,
body.create-page .dropdown-divider {
  border-color: var(--tap-line) !important;
}

body.create-page .dropdown-points {
  border-color: var(--tap-line) !important;
  background: #1b1b1b !important;
}

body.create-page .dropdown-point-icon,
body.create-page .dropdown-points b,
body.create-page .dropdown-points-team b {
  color: var(--tap-text) !important;
}

body.create-page .point-label,
body.create-page .dropdown-header .user-tier,
body.create-page .dropdown-item,
body.create-page .dropdown-item .ui-icon {
  color: var(--tap-text-muted) !important;
}

body.create-page .dropdown-item:hover,
body.create-page .dropdown-item:focus-visible {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--tap-text) !important;
}

body.create-page .dropdown-item:hover .ui-icon,
body.create-page .dropdown-item:focus-visible .ui-icon {
  color: var(--tap-text) !important;
}

/* Composer material — geometry intentionally remains owned by existing CSS. */
body.create-page .input-panel {
  border: 1px solid var(--tap-line) !important;
  border-radius: 20px !important;
  background: #1d1d1d !important;
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.16), 0 4px 16px rgba(0, 0, 0, 0.16) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  backdrop-filter: blur(28px) !important;
}

body.create-page .input-panel-content,
body.create-page .image-composer-panel,
body.create-page .video-composer-panel {
  background: transparent !important;
}

body.create-page .media-mode-switcher {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.create-page .media-mode-btn {
  position: relative;
  isolation: isolate;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--tap-text-muted) !important;
  box-shadow: none !important;
}

body.create-page .media-mode-btn:hover,
body.create-page .media-mode-btn:focus-visible {
  border-color: transparent !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--tap-text) !important;
}

body.create-page .media-mode-btn.active {
  border-color: transparent !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--tap-text) !important;
  box-shadow: none !important;
}

body.create-page .media-mode-btn.active::before,
body.create-page .tab-item.active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block !important;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(
    from 270deg at 50% 50%,
    transparent 0%,
    rgba(144, 144, 144, 0.45) 25%,
    transparent 50%,
    rgba(144, 144, 144, 0.45) 75%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

body.create-page .tabs {
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.create-page .tab-item {
  position: relative;
  isolation: isolate;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--tap-text-muted) !important;
  box-shadow: none !important;
}

body.create-page .tab-item:hover,
body.create-page .tab-item:focus-visible {
  border-color: transparent !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--tap-text) !important;
}

body.create-page .tab-item.active {
  border-color: transparent !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--tap-text) !important;
  box-shadow: none !important;
}

body.create-page .tab-item:disabled,
body.create-page .media-mode-btn:disabled {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--tap-text-dim) !important;
  opacity: 0.52;
}

body.create-page .upload-card,
body.create-page .video-upload-card {
  border-color: var(--tap-line) !important;
  background: var(--tap-surface-soft) !important;
  color: var(--tap-text) !important;
  box-shadow: none !important;
}

body.create-page .prompt-textarea,
body.create-page .media-mention-editor {
  border-color: transparent !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.9) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
}

body.create-page .setting-select-inline,
body.create-page .model-selector-trigger,
body.create-page .create-select-trigger {
  border-color: var(--tap-line) !important;
  background: var(--tap-surface-soft) !important;
  color: var(--tap-text) !important;
  box-shadow: none !important;
}

body.create-page .upload-card,
body.create-page .video-upload-card {
  border-radius: 14px !important;
}

body.create-page .prompt-textarea,
body.create-page .media-mention-editor {
  border-radius: 16px !important;
}

body.create-page .model-selector-trigger,
body.create-page .create-select-trigger,
body.create-page .setting-select-inline {
  border-radius: 11px !important;
}

body.create-page .upload-card:hover,
body.create-page .video-upload-card:hover,
body.create-page .model-selector-trigger:hover,
body.create-page .create-select-trigger:hover,
body.create-page .create-select-shell.is-open .create-select-trigger {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: var(--tap-surface-hover) !important;
  box-shadow: none !important;
}

body.create-page .prompt-textarea:focus,
body.create-page .media-mention-editor:focus,
body.create-page .setting-select-inline:focus,
body.create-page .model-selector-trigger:focus {
  border-color: var(--tap-line-strong) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  box-shadow: 0 0 0 2px var(--tap-focus) !important;
}

body.create-page .prompt-textarea::placeholder,
body.create-page .media-mention-editor:empty::before {
  color: var(--tap-text-muted) !important;
}

/* Inline media references use the same quiet graphite material as current controls. */
body.create-page .media-mention-chip {
  gap: 5px;
  height: 26px;
  margin: 0 3px;
  padding: 2px 7px 2px 2px;
  border: 1px solid var(--tap-line-strong) !important;
  border-radius: 6px !important;
  background: #292929 !important;
  color: var(--tap-text-soft) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: 0;
  cursor: default;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.create-page .media-mention-chip:hover {
  border-color: var(--tap-highlight) !important;
  background: #313131 !important;
  color: var(--tap-text) !important;
}

body.create-page .media-mention-chip :is(img, video) {
  width: 20px;
  height: 20px;
  border-radius: 4px !important;
  background: #111;
  box-shadow: inset 0 0 0 1px var(--tap-line);
}

body.create-page .media-mention-chip span {
  letter-spacing: 0;
}

body.create-page .btn-add-image,
body.create-page .image-add-tile,
body.create-page .btn-clear-images {
  border: 1px solid var(--tap-line) !important;
  border-radius: 11px !important;
  background: #0f0f0f !important;
  color: var(--tap-text-soft) !important;
  box-shadow: none !important;
}

body.create-page .btn-add-image:hover,
body.create-page .image-add-tile:hover,
body.create-page .btn-clear-images:hover {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: #161616 !important;
  color: var(--tap-text) !important;
  box-shadow: none !important;
}

/* Keep both reference-image add affordances inside the graphite theme. */
body.create-page .image-upload-area :is(.reference-add-button, .image-add-tile) {
  border-style: solid !important;
  border-color: var(--tap-line) !important;
  background: var(--tap-bg-deep) !important;
  color: var(--tap-text-muted) !important;
  box-shadow: var(--tap-inset) !important;
}

body.create-page .image-upload-area :is(.reference-add-button, .image-add-tile):hover:not(:disabled) {
  border-color: var(--tap-line-strong) !important;
  background: var(--tap-surface-raised) !important;
  color: var(--tap-text) !important;
  box-shadow: var(--tap-inset), var(--tap-float-shadow) !important;
}

body.create-page .image-upload-area :is(.reference-add-button, .image-add-tile):active:not(:disabled) {
  background: var(--tap-surface) !important;
  box-shadow: var(--tap-inset) !important;
  transform: translateY(0) scale(0.98);
}

body.create-page .image-upload-area :is(.reference-add-button, .image-add-tile):focus-visible {
  outline: 2px solid var(--tap-focus) !important;
  outline-offset: 3px !important;
}

body.create-page .image-upload-area :is(.reference-add-button, .image-add-tile):disabled {
  border-color: var(--tap-line) !important;
  background: var(--tap-bg-deep) !important;
  color: var(--tap-text-dim) !important;
  box-shadow: none !important;
  opacity: 0.48;
  transform: none;
}

body.create-page .image-thumb-wrapper,
body.create-page .reference-image-reorder-ghost {
  border-color: var(--tap-line) !important;
  border-radius: 12px !important;
  background: #111 !important;
  box-shadow: var(--tap-inset), 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}

body.create-page .image-thumb-wrapper.is-drop-target {
  border-color: rgba(255, 255, 255, 0.52) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), var(--tap-inset) !important;
}

body.create-page .remove-btn {
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  background: rgba(16, 16, 16, 0.86) !important;
  color: var(--tap-text) !important;
}

body.create-page .btn-send {
  border: 0 !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  box-shadow: none !important;
}

body.create-page .btn-send:hover:not(:disabled),
body.create-page .btn-send:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.2) !important;
  color: var(--tap-text) !important;
  box-shadow: none !important;
  transform: none;
}

body.create-page .btn-send:active:not(:disabled) {
  transform: none;
}

body.create-page .btn-send:disabled {
  border-color: transparent !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--tap-text-dim) !important;
  box-shadow: none !important;
  opacity: 0.5;
}

body.create-page .composer-cue-chip,
body.create-page .point-cost-preview,
body.create-page .image-counter,
body.create-page .task-meta-chip,
body.create-page .task-time-chip,
body.create-page .task-retention-chip,
body.create-page .gallery-source-chip {
  border-color: var(--tap-line) !important;
  border-radius: 999px !important;
  background: #181818 !important;
  color: var(--tap-text-muted) !important;
  box-shadow: var(--tap-inset) !important;
}

body.create-page .point-cost-preview strong,
body.create-page .point-cost-icon {
  color: var(--tap-text) !important;
}

body.create-page .create-select-arrow {
  border-color: var(--tap-text-muted) !important;
}

body.create-page .create-select-shell.is-open .create-select-arrow {
  border-color: var(--tap-text) !important;
}

body.create-page .create-select-menu,
body.create-page .model-dropdown-inline,
body.create-page .media-mention-popover {
  border: 1px solid var(--tap-line) !important;
  border-radius: 12px !important;
  background: rgba(21, 21, 21, 0.95) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  backdrop-filter: blur(24px) !important;
}

body.create-page .create-select-option,
body.create-page .model-option-inline,
body.create-page .media-mention-option {
  border-radius: 8px !important;
  color: var(--tap-text-muted) !important;
}

body.create-page .create-select-option:hover,
body.create-page .create-select-option.is-keyboard-active,
body.create-page .model-option-inline:hover,
body.create-page .media-mention-option:hover,
body.create-page .media-mention-option:focus-visible {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--tap-text) !important;
}

body.create-page .create-select-option.is-selected,
body.create-page .model-option-inline.selected,
body.create-page .media-mention-option.is-active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body.create-page .create-select-option.is-selected i {
  color: var(--tap-text) !important;
  border-color: var(--tap-text) !important;
}

/* Aspect-ratio picker keeps the graphite hairline language, not the legacy purple. */
body.create-page .aspect-ratio-frame {
  border-color: rgba(255, 255, 255, 0.45) !important;
  background: transparent !important;
}

body.create-page .create-select-option:hover .aspect-ratio-frame,
body.create-page .create-select-option.is-keyboard-active .aspect-ratio-frame,
body.create-page .create-select-option.is-selected .aspect-ratio-frame {
  border-color: var(--tap-text) !important;
  background: transparent !important;
}

body.create-page .create-select-option:focus-visible {
  box-shadow: inset 0 0 0 1px var(--tap-focus) !important;
}

body.create-page .create-select-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32) !important;
  background-clip: padding-box !important;
}

body.create-page .media-mention-option :is(img, video),
body.create-page .media-mention-option-icon {
  border-radius: 6px !important;
  background: #111 !important;
  box-shadow: inset 0 0 0 1px var(--tap-line) !important;
}

body.create-page .media-mention-option-icon {
  color: var(--tap-text-soft) !important;
  font-weight: 700;
}

body.create-page .media-mention-option-main b {
  color: var(--tap-text-soft) !important;
  font-weight: 650;
  letter-spacing: 0;
}

body.create-page .media-mention-option-main small,
body.create-page .media-mention-empty {
  color: var(--tap-text-muted) !important;
  letter-spacing: 0;
}

/* Task history and generated media */
body.create-page .message-avatar,
body.create-page .message-user .message-avatar,
body.create-page .message-ai .message-avatar {
  border: 1px solid var(--tap-line) !important;
  background: var(--tap-surface-raised) !important;
  color: var(--tap-text) !important;
  box-shadow: var(--tap-inset) !important;
}

body.create-page .task-message {
  --task-rail-gap: 22px;
  --task-rail-x: -28px;
  --task-rail-neutral: rgba(164, 172, 170, 0.16);
  --task-rail-neutral-strong: rgba(164, 172, 170, 0.3);
  --task-rail-accent: rgba(213, 221, 219, 0.92);
  --task-rail-accent-ring: rgba(213, 221, 219, 0.3);
  --task-rail-accent-halo: rgba(213, 221, 219, 0.08);
  --task-rail-leader: rgba(213, 221, 219, 0.28);
  --task-rail-leader-width: 27px;
  position: relative;
}

body.create-page .task-message:has(.ai-result-failed-slot) {
  --task-rail-accent: rgba(229, 145, 153, 0.84);
  --task-rail-accent-ring: rgba(229, 145, 153, 0.3);
  --task-rail-accent-halo: rgba(229, 145, 153, 0.08);
  --task-rail-leader: rgba(229, 145, 153, 0.3);
}

body.create-page .task-message:has(.ai-result-image, .ai-result-video):not(:has(.ai-result-failed-slot)) {
  --task-rail-accent: rgba(113, 194, 154, 0.88);
  --task-rail-accent-ring: rgba(113, 194, 154, 0.3);
  --task-rail-accent-halo: rgba(113, 194, 154, 0.08);
  --task-rail-leader: rgba(113, 194, 154, 0.3);
}

body.create-page .task-message::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: calc(-1 * var(--task-rail-gap));
  left: var(--task-rail-x);
  width: 2px;
  border-radius: 999px;
  background:
    linear-gradient(
      180deg,
      transparent 0,
      var(--task-rail-neutral-strong) 22px,
      var(--task-rail-neutral) 78px,
      rgba(164, 172, 170, 0.08) 72%,
      var(--task-rail-neutral) 100%
    ) 0 0 / 1px 100% no-repeat,
    linear-gradient(
      180deg,
      transparent 0,
      var(--task-rail-accent-ring) 22px,
      transparent 76px
    ) 1px 0 / 1px 100% no-repeat;
  pointer-events: none;
}

body.create-page .task-message::after {
  content: "";
  position: absolute;
  top: 20px;
  left: calc(var(--task-rail-x) - 7px);
  width: 46px;
  height: 16px;
  background:
    radial-gradient(circle at 8px 50%, var(--task-rail-accent) 0 2.5px, transparent 3px),
    radial-gradient(circle at 8px 50%, transparent 0 5.25px, var(--task-rail-accent-ring) 5.25px 6px, transparent 6px),
    radial-gradient(circle at 8px 50%, var(--task-rail-accent-halo) 0 8px, transparent 8.25px),
    linear-gradient(
      90deg,
      var(--task-rail-leader),
      transparent
    ) 15px 50% / var(--task-rail-leader-width) 1px no-repeat;
  background-repeat: no-repeat;
  transform: translateY(-50%);
  pointer-events: none;
}

body.create-page .task-message:not(:has(~ .task-message))::before {
  bottom: 0;
  background: linear-gradient(
    180deg,
    transparent 0,
    var(--task-rail-neutral-strong) 22px,
    var(--task-rail-neutral) 76px,
    transparent 100%
  );
}

@media (min-width: 821px) {
  body.create-page .chat-messages {
    position: relative;
    left: 24px;
    width: calc(100% - 48px);
  }

  body.create-page .task-message {
    --task-rail-gap: 18px;
  }
}

@media (max-width: 700px) {
  body.create-page .task-message {
    --task-rail-x: -16px;
  }

  body.create-page .task-message::after {
    top: 18px;
    width: 38px;
    --task-rail-leader-width: 21px;
  }
}

body.create-page .message-content {
  border: 1px solid var(--tap-line) !important;
  border-left-color: var(--tap-line) !important;
  border-radius: 12px !important;
  background: #1d1d1d !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.create-page .message-content:hover {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: #222 !important;
}

body.create-page .task-card,
body.create-page .task-message .task-card {
  border: 1px solid transparent !important;
  border-left-color: transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: 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 .task-card:hover,
body.create-page .task-message .task-card:hover {
  border-color: transparent !important;
  background: transparent !important;
}

/* Four-result generations stay on one row at desktop widths. */
body.create-page .ai-result-grid.count-4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 1100px;
}

/* A single 1:1 result uses the same card width as one slot in the four-column grid. */
body.create-page .ai-result-grid.ratio-1-1:not(.count-4) > .ai-result-placeholder,
body.create-page .ai-result-grid.ratio-1-1:not(.count-4) > .ai-result-frame,
body.create-page .task-output > .ai-result-frame.ratio-1-1 {
  width: min(266px, calc((100% - 36px) / 4)) !important;
  max-width: none !important;
}

body.create-page .ai-result-grid.count-4 > .ai-result-frame,
body.create-page .ai-result-grid.count-4 > .ai-result-placeholder {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
}

body.create-page .ai-result-grid.count-4 > .ai-result-placeholder {
  height: auto !important;
}

/* Waiting and completed results share one stable slot geometry per ratio. */
body.create-page .ai-result-grid > .ai-result-frame,
body.create-page .ai-result-grid > .ai-result-placeholder {
  min-width: 0;
  max-width: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.create-page .ai-result-grid > .ai-result-frame > .ai-result-image,
body.create-page .ai-result-grid > .ai-result-frame > .ai-result-video {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
}

body.create-page .task-output > .ai-result-frame {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.create-page .task-output > .ai-result-frame > :is(.ai-result-image, .ai-result-video) {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
}

body.create-page .ai-result-grid.ratio-1-3 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 1 / 3; }
body.create-page .ai-result-grid.ratio-9-21 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 9 / 21; }
body.create-page .ai-result-grid.ratio-1-2 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 1 / 2; }
body.create-page .ai-result-grid.ratio-9-16 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 9 / 16; }
body.create-page .ai-result-grid.ratio-2-3 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 2 / 3; }
body.create-page .ai-result-grid.ratio-3-4 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 3 / 4; }
body.create-page .ai-result-grid.ratio-4-5 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 4 / 5; }
body.create-page .ai-result-grid.ratio-1-1 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 1 / 1; }
body.create-page .ai-result-grid.ratio-3-2 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 3 / 2; }
body.create-page .ai-result-grid.ratio-4-3 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 4 / 3; }
body.create-page .ai-result-grid.ratio-5-4 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 5 / 4; }
body.create-page .ai-result-grid.ratio-16-9 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 16 / 9; }
body.create-page .ai-result-grid.ratio-2-1 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 2 / 1; }
body.create-page .ai-result-grid.ratio-3-1 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 3 / 1; }
body.create-page .ai-result-grid.ratio-21-9 > :is(.ai-result-frame, .ai-result-placeholder) { aspect-ratio: 21 / 9; }

body.create-page .task-output > .ai-result-frame.ratio-1-3 { aspect-ratio: 1 / 3; }
body.create-page .task-output > .ai-result-frame.ratio-9-21 { aspect-ratio: 9 / 21; }
body.create-page .task-output > .ai-result-frame.ratio-1-2 { aspect-ratio: 1 / 2; }
body.create-page .task-output > .ai-result-frame.ratio-9-16 { aspect-ratio: 9 / 16; }
body.create-page .task-output > .ai-result-frame.ratio-2-3 { aspect-ratio: 2 / 3; }
body.create-page .task-output > .ai-result-frame.ratio-3-4 { aspect-ratio: 3 / 4; }
body.create-page .task-output > .ai-result-frame.ratio-4-5 { aspect-ratio: 4 / 5; }
body.create-page .task-output > .ai-result-frame.ratio-1-1 { aspect-ratio: 1 / 1; }
body.create-page .task-output > .ai-result-frame.ratio-3-2 { aspect-ratio: 3 / 2; }
body.create-page .task-output > .ai-result-frame.ratio-4-3 { aspect-ratio: 4 / 3; }
body.create-page .task-output > .ai-result-frame.ratio-5-4 { aspect-ratio: 5 / 4; }
body.create-page .task-output > .ai-result-frame.ratio-16-9 { aspect-ratio: 16 / 9; }
body.create-page .task-output > .ai-result-frame.ratio-2-1 { aspect-ratio: 2 / 1; }
body.create-page .task-output > .ai-result-frame.ratio-3-1 { aspect-ratio: 3 / 1; }
body.create-page .task-output > .ai-result-frame.ratio-21-9 { aspect-ratio: 21 / 9; }

body.create-page .ai-result-grid > .ai-result-placeholder > .task-wait-indicator {
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 8px;
  padding: 12px;
  text-align: center;
}

body.create-page .ai-result-grid .task-wait-indicator .strands-wait-label {
  display: block;
  max-width: 12em;
  color: var(--tap-text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  text-wrap: balance;
}

body.create-page .task-wait-elapsed {
  display: block;
  min-width: 5ch;
  color: var(--tap-text-dim);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  body.create-page .ai-result-grid.count-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.create-page .ai-result-grid.ratio-1-1:not(.count-4) > .ai-result-placeholder,
  body.create-page .ai-result-grid.ratio-1-1:not(.count-4) > .ai-result-frame,
  body.create-page .task-output > .ai-result-frame.ratio-1-1 {
    width: calc((100% - 10px) / 2) !important;
  }
}

@media (max-width: 380px) {
  body.create-page .ai-result-grid.count-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  body.create-page .ai-result-grid.ratio-1-1:not(.count-4) > .ai-result-placeholder,
  body.create-page .ai-result-grid.ratio-1-1:not(.count-4) > .ai-result-frame,
  body.create-page .task-output > .ai-result-frame.ratio-1-1 {
    width: 100% !important;
  }
}

body.create-page .task-card::before,
body.create-page .task-message .task-card::before {
  content: none !important;
}

body.create-page .task-prompt,
body.create-page .task-card-continuation-title {
  color: var(--tap-text) !important;
}
