:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface2: #1c1c1c;
  --surface3: #242424;
  --text: #f4f4f5;
  --muted: #71717a;
  --accent: #2ea6ff;
  --accent-hover: #1d8fe6;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --dock-height: 132px;
  --space: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  font-size: 15px;
}

body.access-blocked .app {
  display: none;
}

/* ── Access blocker ── */
.access-blocker {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.access-blocker[hidden] {
  display: none !important;
}

.access-blocker-card {
  max-width: 340px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.access-blocker-card h2 {
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.access-blocker-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.access-blocker-id {
  margin-top: 12px !important;
  font-family: ui-monospace, monospace;
  color: var(--text) !important;
}

/* ── App shell ── */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--dock-height) + var(--safe-bottom) + 8px);
}

.app-header {
  padding: 10px var(--space) 0;
}

.app-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

body.telegram-webapp .app-title {
  display: none;
}

body.telegram-webapp .app-header {
  padding-top: 4px;
}

/* ── Preview hero ── */
.preview-hero {
  padding: 8px var(--space) 0;
}

.preview-hero.batch-active .preview-single-wrap {
  display: none;
}

.preview-frame {
  position: relative;
  width: min(100%, 240px);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.preview-placeholder.visible {
  display: flex;
}

.preview-loading {
  z-index: 5;
}

.preview-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  background: #000;
}

.preview-frame video.visible {
  display: block;
  position: relative;
  z-index: 1;
}

.preview-play,
.batch-preview-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
}

.preview-play[hidden],
.batch-preview-play[hidden] {
  display: none !important;
}

.tiktok-overlay-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% * var(--tiktok-overlay-scale, 1) * (1 + var(--tiktok-overlay-crop, 0.03)));
  height: calc(100% * var(--tiktok-overlay-scale, 1) * (1 + var(--tiktok-overlay-crop, 0.03)));
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  display: none;
}

.tiktok-overlay-img.visible {
  display: block;
}

.photos-info {
  margin: 6px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.6875rem;
}

/* Batch preview grid */
.batch-preview-panel {
  width: 100%;
}

.batch-preview-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.batch-preview-edit-hint {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(46, 166, 255, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.batch-preview-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.batch-preview-play-all,
.batch-preview-exit-edit {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 0.6875rem;
  cursor: pointer;
}

.batch-preview-exit-edit {
  color: var(--accent);
  border-color: rgba(46, 166, 255, 0.35);
}

.batch-preview-tip {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  color: var(--muted);
  text-align: center;
}

.batch-preview-tip[hidden] {
  display: none !important;
}

.batch-preview-grid {
  display: grid;
  gap: 8px;
  width: 100%;
  margin: 0 auto;
}

.batch-preview-grid.count-1 {
  max-width: 240px;
  grid-template-columns: 1fr;
}

.batch-preview-grid.count-2 {
  max-width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-preview-grid.count-multi {
  max-width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-preview-grid.count-many {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.batch-preview-grid.count-many::-webkit-scrollbar {
  display: none;
}

.batch-preview-grid.count-many .batch-preview-item {
  flex: 0 0 130px;
  scroll-snap-align: start;
}

.batch-preview-item {
  transition: transform 0.15s;
}

.batch-preview-item.batch-editing .batch-preview-frame {
  box-shadow: 0 0 0 2px var(--accent);
}

.batch-preview-item.batch-text-editing .batch-preview-item-label {
  color: var(--accent);
}

.batch-preview-item.batch-text-editing .batch-preview-frame {
  box-shadow: 0 0 0 2px rgba(46, 166, 255, 0.55);
}

.batch-preview-item-label.tappable {
  cursor: pointer;
  user-select: none;
}

.batch-preview-item-label.tappable:active {
  opacity: 0.75;
}

.batch-preview-item.batch-customized .batch-preview-item-label::after {
  content: " ·";
  color: var(--accent);
}

.batch-preview-item-label {
  display: block;
  margin-bottom: 4px;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.6875rem;
  color: var(--muted);
  text-align: left;
}

.batch-preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.batch-preview-loading {
  z-index: 2;
}

.inline-progress {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}

.inline-progress[hidden],
.preview-loading:not(.visible) {
  display: none !important;
}

.preview-loading.visible {
  display: flex;
}

.inline-progress-compact {
  padding: 10px 12px;
}

.inline-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.inline-progress-compact .inline-progress-track {
  height: 3px;
}

.inline-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.15s ease-out;
}

.inline-progress-bar.is-error {
  background: var(--danger);
}

.inline-progress-bar.is-complete {
  background: var(--accent);
}

.batch-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.batch-preview-video.visible {
  display: block;
}


/* ── Status ── */
.status-bar {
  margin: 6px var(--space) 0;
  padding: 0 4px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-bar.error {
  color: var(--danger);
}

/* ── Workspace ── */
.workspace {
  flex: 1;
  padding: 12px var(--space) 8px;
}

.section-panel[hidden] {
  display: none !important;
}

.section-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space);
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.panel-tip {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.panel-tip.disabled {
  color: var(--danger);
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

/* ── Fields ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-label strong {
  color: var(--text);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.field-inline {
  gap: 8px;
}

.field-row {
  display: flex;
  gap: 10px;
}

.half {
  flex: 1;
  min-width: 0;
}

textarea,
select,
input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface3);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  appearance: none;
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.45;
}

textarea:focus,
select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 28px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-row select {
  flex: 1;
}

/* ── Style blocks ── */
.style-block {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--surface3);
}

.style-block-last {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.style-block-title {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.font-picker {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding: 2px 2px 6px;
  margin: 0 -2px;
}

.font-upload-tip {
  margin: -2px 0 6px;
}

.font-picker-item {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: min(42vw, 148px);
  min-height: 72px;
  scroll-snap-align: start;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.font-picker-compact .font-picker-item {
  width: min(38vw, 132px);
}

.font-picker-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-height: 72px;
  padding: 10px 28px 9px 10px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.font-picker-compact .font-picker-item,
.font-picker-compact .font-picker-main {
  min-height: 64px;
}

.font-picker-compact .font-picker-main {
  padding: 8px 26px 8px 8px;
}

.font-picker-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.font-picker-delete:active {
  background: rgba(239, 68, 68, 0.3);
}

.font-picker-item.active {
  border-color: rgba(46, 166, 255, 0.45);
  background: rgba(46, 166, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(46, 166, 255, 0.15);
}

.font-picker-name {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-picker-item.active .font-picker-name {
  color: var(--accent);
}

.font-picker-sample {
  display: block;
  min-height: 1.2em;
  font-size: 1.125rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-picker-compact .font-picker-sample {
  font-size: 0.9375rem;
}

.font-picker-sample.font-preview-error {
  color: var(--muted);
  font-size: 0.75rem;
}

.overlay-details {
  margin-top: 4px;
  font-size: 0.8125rem;
}

.overlay-details summary {
  cursor: pointer;
  color: var(--muted);
  padding: 6px 0;
  list-style: none;
}

.overlay-details summary::-webkit-details-marker {
  display: none;
}

.overlay-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  font-size: 0.875rem;
}

.overlay-toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* ── Pills / segments ── */
.segment-pill {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}

.pill-option,
.position-option {
  flex: 1;
  min-height: 40px;
  padding: 8px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.pill-option.active,
.position-option.active {
  background: var(--surface3);
  color: var(--text);
}

/* ── Filters (compact grid) ── */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filter-chip {
  min-height: 42px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.filter-chip.active {
  border-color: rgba(46, 166, 255, 0.45);
  background: rgba(46, 166, 255, 0.08);
}

.filter-chip-btn {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.active .filter-chip-btn {
  color: var(--accent);
}

.filter-card {
  grid-column: span 1;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid transparent;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.filter-card.active {
  grid-column: span 2;
  border-color: rgba(46, 166, 255, 0.35);
  background: rgba(46, 166, 255, 0.05);
}

.filter-card-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.filter-card-label {
  font-size: 0.8125rem;
  font-weight: 600;
}

.filter-card-value {
  font-size: 0.6875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.filter-card.active .filter-card-value {
  color: var(--accent);
}

.filter-card-body {
  padding: 0 12px 10px;
}

.filter-card-body[hidden] {
  display: none !important;
}

.filter-slider {
  width: 100%;
  accent-color: var(--accent);
  height: 24px;
  margin: 0;
}

.filter-slider:disabled {
  cursor: not-allowed;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--surface3);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--surface3);
}

.btn-link {
  width: auto;
  min-height: auto;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn-link-inline {
  align-self: flex-start;
}

.btn-icon {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
}

.btn-compact {
  padding: 0 12px;
  font-size: 0.8125rem;
}

.btn-danger-soft:not(:disabled) {
  color: var(--danger);
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row .btn {
  flex: 1;
}

.btn-dock {
  flex: 1;
}

/* ── Chips ── */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--surface3);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.chip:active:not(:disabled) {
  background: var(--surface3);
}

.chip:disabled {
  opacity: 0.4;
}

/* ── AI panel ── */
.ai-template-row select {
  flex: 1;
  min-width: 0;
}

.ai-editor {
  margin-top: 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--surface3);
  display: flex;
  flex-direction: column;
  gap: var(--space);
}

.ai-editor[hidden] {
  display: none !important;
}

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

.ai-editor-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.ai-editor-close {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
}

.ai-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--surface3);
}

.ai-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ai-result-header-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ai-result-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-result-quick {
  display: flex;
  align-items: center;
  gap: 4px;
}

.text-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.text-link-sep {
  color: var(--surface3);
  font-size: 0.75rem;
}

.ai-variant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(46vh, 320px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.ai-variant-card {
  display: flex;
  align-items: stretch;
  gap: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.ai-variant-card.selected {
  border-color: rgba(46, 166, 255, 0.35);
  background: rgba(46, 166, 255, 0.05);
}

.ai-variant-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 10px 0 10px 10px;
  cursor: pointer;
}

.ai-variant-main input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.ai-variant-text {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-variant-use {
  flex-shrink: 0;
  width: 40px;
  border: none;
  border-left: 1px solid var(--surface3);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.ai-variant-use:active {
  background: var(--surface3);
  color: var(--text);
}

.batch-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--surface3);
}

.batch-bar-style {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--surface3);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.batch-bar-style:active {
  background: var(--surface3);
}

#batchSelectedLabel {
  font-size: 0.8125rem;
  font-weight: 600;
}

.batch-bar-style-meta {
  width: 100%;
  font-size: 0.6875rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-bar-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-batch {
  min-height: 52px;
  min-width: 64px;
  padding: 0 12px;
  font-size: 0.8125rem;
}

/* ── Photos ── */
.photo-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.photo-selection-info {
  flex: 1;
  font-size: 0.75rem;
  color: var(--muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: min(55vh, 400px);
  overflow-y: auto;
  align-content: start;
}

.photo-card {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  background: #111;
}

.photo-card::before {
  content: "";
  display: block;
  padding-top: 100%;
}

.photo-card.selected {
  border-color: var(--accent);
}

.photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card-actions {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 35%, transparent 65%, rgba(0,0,0,0.4));
}

.photo-card-check {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.photo-card-delete {
  align-self: flex-end;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

/* ── Bottom dock ── */
.app-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--surface3);
  padding: 8px var(--space) calc(6px + var(--safe-bottom));
}

.dock-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dock-progress-wrap[hidden] {
  display: none !important;
}

.dock-progress {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.dock-progress.visible {
  display: flex;
}

.btn-cancel-gen {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel-gen:active {
  background: rgba(239, 68, 68, 0.22);
}

.dock-progress .inline-progress-track {
  background: var(--surface3);
}

#previewBtn.hidden-for-progress {
  display: none;
}

.dock-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.nav-tab.active {
  color: var(--accent);
  background: rgba(46, 166, 255, 0.1);
}

.nav-tab-label {
  line-height: 1.2;
}

/* ── Legacy aliases (JS compat) ── */
.segment { /* unused */ }
.preview-progress { /* mapped via id */ }
.status { /* status-bar replaces .status */ }
