.flow-photo-card,
.photo-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 270px;
  overflow: hidden;
  flex-direction: column;
  border-radius: 8px;
}

.flow-photo-card {
  border: 1px solid var(--line);
  background: var(--surface-solid);
}

.photo-card {
  border: 1px solid var(--line);
  background: var(--panel, var(--surface-solid, #fff));
}

.flow-photo-card.keep,
.photo-card.keep {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), transparent 75%);
}

.flow-sequence-number,
.sequence-number {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: grid;
  min-width: 30px;
  min-height: 26px;
  place-items: center;
  padding-inline: 7px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), black 10%);
  color: white;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
}

button.flow-sequence-number,
button.sequence-number {
  cursor: pointer;
}

.flow-sequence-number.armed,
.sequence-number.armed {
  outline: 3px solid color-mix(in srgb, var(--warn, #9a6700), white 18%);
  outline-offset: 2px;
  background: var(--warn, #9a6700);
  color: var(--ink);
}

.flow-thumb-frame {
  width: 100%;
  background: color-mix(in srgb, var(--accent-soft, #d8eeee), var(--line, #d7e1e8) 48%);
}

.flow-thumb,
.photo-card .thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: color-mix(in srgb, var(--accent-soft, #d8eeee), var(--line, #d7e1e8) 48%);
}

.thumb-button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
}

.flow-card-body,
.photo-card .card-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  padding: 9px;
}

.flow-file-row,
.file-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 6px;
}

.flow-file-name,
.file-row .file-name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.flow-manual-badge,
.manual-badge {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--warn, #9a6700), transparent 42%);
  border-radius: 999px;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--warn, #9a6700), white 76%);
  color: color-mix(in srgb, var(--warn, #9a6700), black 44%);
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.2;
}

.flow-meta-block,
.meta-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  margin-top: 5px;
}

.flow-meta-block span,
.meta-block div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.flow-meta-block b,
.meta-block strong {
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1;
}

.flow-meta-block small,
.meta-block span,
.flow-contributor {
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.flow-contributor {
  display: block;
  margin-top: 4px;
}

.flow-card-actions,
.photo-card .card-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-top: auto;
  padding-top: 7px;
}

.flow-mini,
.photo-card .card-actions .mini {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--line, #cfdce5), #cfdce5 50%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-solid, #fff), #f7fafc 45%);
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.flow-mini:disabled,
.photo-card .card-actions .mini:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.flow-sequence-button,
.sequence-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-sequence-button svg,
.sequence-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-sequence-button.icon-remove,
.sequence-button.icon-remove {
  color: var(--muted);
}

.flow-sequence-button.icon-delete,
.sequence-button.icon-delete {
  border-color: color-mix(in srgb, var(--danger, #b42318), transparent 70%);
  background: color-mix(in srgb, var(--danger, #b42318), transparent 94%);
  color: var(--danger, #b42318);
}

.flow-sequence-button.text-button,
.sequence-button.text-button {
  padding-inline: 2px;
  color: var(--accent);
  font-size: 0.64rem;
  line-height: 1;
}

.flow-sequence-button.text-button.armed,
.sequence-button.text-button.armed {
  border-color: color-mix(in srgb, var(--warn, #9a6700), transparent 52%);
  background: color-mix(in srgb, var(--warn, #9a6700), white 82%);
  color: color-mix(in srgb, var(--warn, #9a6700), black 44%);
}

@media (max-width: 560px) {
  .flow-photo-card,
  .photo-card {
    min-height: 246px;
  }

  .flow-card-body,
  .photo-card .card-body {
    padding: 8px;
  }

  .flow-file-name,
  .file-row .file-name {
    font-size: 0.78rem;
  }

  .flow-card-actions,
  .photo-card .card-actions {
    gap: 3px;
  }
}
