/* ══════════════════════════════════════════════════════════════
   Pages CSS — Page-specific Styles
   ══════════════════════════════════════════════════════════════ */

/* ── Content Header ── */
.content-header {
  padding: var(--space-5) var(--space-7) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.content-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: 0;
}

.content-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

.page-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.page-heading-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 40px;
  flex: 0 0 34px;
  color: var(--accent);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.page-heading-mark::after {
  content: none;
}

.page-heading-mark svg {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-heading-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.page-heading-kicker {
  display: block;
  margin: 0;
  color: var(--accent);
  font-size: 8px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: .88;
}

.page-heading-copy > strong,
.page-heading-copy > .content-title {
  display: block;
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.2;
}

.page-heading-copy > span:not(.page-heading-kicker),
.page-heading-copy > .content-subtitle {
  display: block;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.page-heading-header {
  min-height: 72px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--accent-light), transparent 42%);
}

/* ── Dashboard Header ── */
.dashboard-header {
  display: block;
  padding: 12px var(--space-7) 0;
  background: linear-gradient(100deg, var(--accent-light), transparent 48%);
}

.dashboard-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-title-block {
  flex: 0 0 auto;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.dashboard-action {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default), background var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default);
}

.dashboard-action:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.dashboard-action-icon {
  width: 14px;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.dashboard-action.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,122,255,0.2);
}

.dashboard-action.is-primary:hover { background: #0066d6; color: #fff; }
.dashboard-action.is-warning { border-color: rgba(245,158,11,0.35); color: #b45309; }
.dashboard-action.is-warning:hover { background: rgba(245,158,11,0.08); border-color: #f59e0b; color: #92400e; }
.dashboard-action.is-danger { border-color: rgba(239,68,68,0.32); color: #b91c1c; }
.dashboard-action.is-danger:hover { background: rgba(239,68,68,0.08); border-color: #ef4444; color: #991b1b; }

.dashboard-network-row {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  min-width: 0;
}

#netStatusBar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.network-status-label,
.network-status-chip {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 10px;
  white-space: nowrap;
}

.network-status-label { color: var(--text-muted); cursor: help; }
.network-status-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; }
.network-status-chip.is-good .network-status-dot { background: #22c55e; }
.network-status-chip.is-warn .network-status-dot { background: #f59e0b; }
.network-status-chip.is-error .network-status-dot { background: #ef4444; }
.network-status-chip.is-good .network-status-value { color: #16a34a; }
.network-status-chip.is-warn .network-status-value { color: #d97706; }
.network-status-chip.is-error .network-status-value { color: #dc2626; }
.network-status-value { font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.network-status-message { font-size: 10px; color: var(--text-muted); }
.network-status-message.is-error { color: #dc2626; }

.dashboard-stats-grid,
.dashboard-two-column,
.dashboard-quick-grid,
.ip-info-grid {
  display: grid;
  min-width: 0;
}

.dashboard-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.ip-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}

@media (max-width: 900px) {
  .dashboard-header-main { align-items: flex-start; flex-direction: column; }
  .dashboard-actions { width: 100%; justify-content: flex-start; }
  .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-two-column { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .page-heading-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .page-heading-kicker { font-size: 8px; }
  .dashboard-header,
  .page-heading-header { padding-left: 16px; padding-right: 16px; }
  .dashboard-action { flex: 1 1 auto; }
  .dashboard-actions { gap: 6px; }
  .dashboard-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ip-info-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Content Scroll ── */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-7) calc(var(--space-6) + 80px);
}

/* ── Generate Layout ── */
.generate-layout {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 60px);
  min-height: 400px;
  overflow: hidden;
  gap: 0;
}

.generate-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--space-2);
  width: 240px;
  min-width: 200px;
  flex-shrink: 0;
}

.generate-center {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  padding-right: var(--space-1);
  flex: 1 1 0;
  min-width: 300px;
}

.generate-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  flex: 2 1 0;
  min-width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
}

.generate-bottom-row {
  display: flex;
  gap: var(--space-3);
  min-height: 0;
  flex: 1 1 0;
  overflow: hidden;
}

/* ── Preview Grid ── */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-items: start;
}

/* ── Preview Card (image frame) ── */
.prev-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  border: 2px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.prev-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ── Border Progress Animation ── */
.prev-card-border {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  pointer-events: none;
  z-index: 2;
}
.prev-card-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    var(--accent) 15%,
    var(--accent) 30%,
    transparent 45%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-spin 1.2s linear infinite;
  opacity: 0;
}
.prev-card.generating .prev-card-border::before {
  opacity: 0;
}
.prev-card.completed .prev-card-border::before {
  opacity: 0;
  background: #22c55e;
}
.prev-card.completed {
  border-color: #22c55e44;
}

@keyframes border-spin {
  to { transform: rotate(360deg); }
}

/* ── Placeholder (generating) ── */
.prev-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-card);
  animation: placeholder-pulse 1.8s ease-in-out;
}
.prev-placeholder .spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.prev-placeholder .ph-text {
  font-size: 9px;
  color: var(--text-muted);
}

@keyframes placeholder-pulse {
  0%, 100% { background: var(--bg-card); }
  50% { background: var(--bg-base); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Completed Image ── */
.prev-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  transition: transform 0.2s;
}
.prev-img:hover {
  transform: scale(1.03);
}

/* ── Card Footer ── */
.prev-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.prev-footer .provider-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prev-footer .provider-name {
  font-size: 9px;
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prev-footer .elapsed-badge {
  font-size: 8px;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.4);
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Retry Button (on failed cards) ── */
.prev-retry-btn {
  position: absolute;
  bottom: 30px;
  right: 6px;
  z-index: 10;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(239,68,68,0.85);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
  opacity: 0;
}
.prev-card.failed:hover .prev-retry-btn {
  opacity: 1;
}
.prev-retry-btn:hover {
  background: rgba(239,68,68,1);
  transform: scale(1.05);
}

/* ── Arrow Nav ── */
.prev-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s;
}
.prev-card:hover .prev-arrow {
  opacity: 1;
}
.prev-arrow-left { left: 6px; }
.prev-arrow-right { right: 6px; }

/* ── Thumbnail Row ── */
.prev-thumbs {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  overflow-x: auto;
}
.prev-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: all 0.15s;
  flex-shrink: 0;
}
.prev-thumb.active {
  opacity: 1;
  border-color: var(--accent);
}

/* ── Preview Log Grid (vertical card) ── */
.prev-log-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  max-height: 140px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 10px;
  line-height: 1.6;
}
.prev-log-card .log-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
}
.prev-log-card .log-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prev-log-card .log-line {
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 9px;
}

/* ── Divider Drag ── */
.divider-drag {
  width: 6px;
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  background: transparent;
  z-index: 10;
}

.divider-drag::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
  transition: all var(--duration-fast) var(--ease-default);
}

.divider-drag:hover::after,
.divider-drag.active::after {
  background: var(--accent);
  width: 3px;
  left: 1.5px;
}

body.dragging-divider {
  user-select: none;
  cursor: col-resize;
}

/* ── Provider Card ── */
.provider-card {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  user-select: none;
}

.provider-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.provider-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.provider-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.provider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.provider-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.provider-model {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.provider-check {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-default);
}

.provider-card.selected .provider-check {
  background: var(--accent);
  border-color: var(--accent);
}

.provider-card.selected .provider-check::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

/* ── Input Area ── */
.prompt-area {
  position: relative;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
  font-family: inherit;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  font-family: inherit;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.btn-ghost {
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  font-family: inherit;
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

/* ── Image Settings Button Group ── */
.quality-btn, .qty-btn {
  padding: 6px 12px;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  font-family: inherit;
  white-space: nowrap;
}

.quality-btn:hover, .qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.quality-btn.active, .qty-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: var(--weight-semibold);
}

.ratio-btn {
  padding: 8px 4px;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  font-family: inherit;
  text-align: center;
  white-space: nowrap;
}

.ratio-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.ratio-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: var(--weight-semibold);
}

/* ── Progress Bar ── */
.progress-wrap {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-4);
}

.progress-label {
  font-size: var(--text-sm);
  color: var(--accent);
  margin-bottom: var(--space-2);
  font-weight: var(--weight-medium);
}

.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-green));
  border-radius: 2px;
  transition: width 0.4s var(--ease-default);
}

/* ── Video Progress ── */
@keyframes marquee-progress {
  0% { background-position: 200% 0%; }
  100% { background-position: -200% 0%; }
}

.video-progress-marquee {
  background: linear-gradient(90deg, var(--accent), var(--accent-green), var(--accent), var(--accent-green));
  background-size: 200% 100%;
  animation: marquee-progress 2s linear infinite;
  border-radius: 6px;
  height: 100%;
  transition: width 0.3s var(--ease-default);
}

.video-progress-solid {
  background: var(--accent-green);
  border-radius: 6px;
  height: 100%;
  transition: width 0.3s var(--ease-default);
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.4);
}

/* ── Results Grid ── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.results-header h3 {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

/* ── Gallery Grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-3);
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding-right: var(--space-2);
}

.gallery-grid.gallery-grid-video {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  max-height: none;
}

/* ── Gallery Item ── */
.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  aspect-ratio: 1;
  transition: all var(--duration-normal) var(--ease-default);
  background: var(--bg-surface);
}

.gallery-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.gallery-item:hover .gallery-zoom-hint {
  opacity: 1;
  transform: scale(1);
}

.gallery-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-lg);
}

.gallery-item.selected::after {
  content: '\2713';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 5;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Gallery Item Video ── */
.gallery-item-video {
  aspect-ratio: 16/9;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-default);
}

.gallery-item-video:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-xl);
  z-index: 10;
}

.gallery-item-video .vid-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 4;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  pointer-events: none;
  letter-spacing: 0.3px;
}

.gallery-item-video .vid-play {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-default);
  z-index: 5;
  pointer-events: none;
}

.gallery-item-video:hover .vid-play {
  opacity: 1;
}

.gallery-item-video .vid-play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: transform 0.25s var(--ease-smooth), background 0.25s var(--ease-default);
}

.gallery-item-video:hover .vid-play-btn {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

.gallery-item-video .vid-play-btn span,
.gallery-item-video .vid-play-btn svg {
  font-size: 18px;
  color: #fff;
  margin-left: 3px;
}

.gallery-item-video .vid-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 32px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s var(--ease-smooth);
  pointer-events: none;
}

.gallery-item-video:hover .vid-info {
  opacity: 1;
  transform: translateY(0);
}

/* ── Gallery Overlay ── */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.85));
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-default);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-3);
  pointer-events: none;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-label {
  font-size: var(--text-xs);
  color: #fff;
  font-weight: var(--weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-cloud-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}

.gallery-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  pointer-events: auto;
}

.gallery-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gallery-action-btn:hover {
  background: rgba(255,255,255,0.4);
}

.gallery-zoom-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%) scale(0.8);
  opacity: 0;
  transition: all var(--duration-fast) var(--ease-default);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Lightbox ── */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#lightbox.show {
  display: flex;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  cursor: zoom-in;
}

#lightbox-video {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  outline: none;
}

#lightbox-img.zoomed {
  cursor: zoom-out;
}

#lightbox-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

#lightbox-info {
  margin-top: var(--space-3);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ── Compare Modal (base in app.css) ── */

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1000px;
  margin-bottom: var(--space-4);
}

.compare-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: #fff;
}

.compare-scroll {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  max-width: 1000px;
  width: 100%;
  padding-bottom: var(--space-3);
}

.compare-item {
  flex-shrink: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.compare-item img {
  width: 100%;
  display: block;
  cursor: pointer;
}

.compare-item-info {
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Provider Modal (base in app.css) ── */

.provider-modal-box {
  width: min(1440px, 95vw);
  max-height: 92vh;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
}

.provider-modal-head {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.provider-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6);
}

.provider-modal-foot {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Edit Item ── */
.edit-item {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.edit-item-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.color-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.modal-full {
  grid-column: 1 / -1;
}

/* ── Param Settings ── */
.param-group {
  margin-bottom: var(--space-4);
}

.param-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

/* ── Log Page ── */
.log-entry {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  transition: box-shadow var(--duration-fast) var(--ease-default);
  box-shadow: var(--shadow-xs);
}

.log-entry:hover {
  box-shadow: var(--shadow-sm);
}

/* ── Status Bar ── */
.status-bar {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-7);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── Theme Modal (base in app.css) ── */

.theme-box {
  width: 480px;
  max-height: 80vh;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
}

.theme-head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.theme-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
}

.theme-foot {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Log Modal (base in app.css) ── */

.log-box {
  width: 720px;
  max-height: 80vh;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
}

.log-box-head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.log-box-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--space-5);
}

.log-filter-btn {
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  font-family: inherit;
}

.log-filter-btn:hover {
  background: var(--bg-inset);
}

.log-filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── LLM Modal (base in app.css) ── */

.llm-provider-card {
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.llm-provider-card:hover {
  border-color: var(--border-strong);
}

.llm-provider-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ── Thumbnail Strip ── */
.thumb-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: var(--space-2) 0;
}

.thumb-strip img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: all var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}

.thumb-strip img.active {
  opacity: 1;
  border-color: var(--accent);
}

/* ── Grouped Preview Card ── */
.grouped-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
}

.grouped-card .prev-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.prev-group-label {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  z-index: 2;
  pointer-events: none;
  max-width: calc(100% - 36px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prev-group-count {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,122,255,0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.dashboard-community{display:inline-flex;align-items:center}.dashboard-community .dashboard-action{border-radius:var(--radius-sm)}.dashboard-community-join{border-color:color-mix(in srgb,var(--accent) 42%,var(--border));color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--bg-surface))}.dashboard-community-join:hover{border-color:var(--accent);color:var(--accent)}
@media(max-width:760px){.dashboard-community{flex:1 1 100%}.dashboard-community-join{flex:1}}


/* 2026-07-14 heading rhythm refinement */
.page-heading {
  align-items: flex-start;
  gap: 12px;
}

.page-heading-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  margin-top: 2px;
}

.page-heading-copy {
  gap: 4px;
}

.page-heading-kicker {
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: .16em;
  opacity: .92;
}

.page-heading-copy > strong,
.page-heading-copy > .content-title {
  font-size: 20px;
  line-height: 1.16;
}

.page-heading-copy > span:not(.page-heading-kicker),
.page-heading-copy > .content-subtitle {
  font-size: 12px;
  line-height: 1.5;
  max-width: 68ch;
}

.page-heading-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--space-7) 12px;
  min-height: 96px;
  background: linear-gradient(96deg, var(--accent-light), transparent 46%);
}

.page-heading-header .content-title,
.page-heading-header .content-subtitle {
  margin: 0;
}

.dashboard-header {
  padding: 14px var(--space-7) 0;
}

.dashboard-header-main {
  align-items: flex-start;
  gap: 16px;
}

.dashboard-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

@media (max-width: 760px) {
  .page-heading-header {
    min-height: 0;
    padding: 12px 16px 10px;
  }

  .page-heading {
    gap: 10px;
  }

  .page-heading-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .page-heading-copy > strong,
  .page-heading-copy > .content-title {
    font-size: 18px;
  }

  .page-heading-copy > span:not(.page-heading-kicker),
  .page-heading-copy > .content-subtitle {
    font-size: 11px;
  }
}
