.photo-page {
  display: grid;
  gap: var(--ml-space-4);
  overflow-x: hidden;
}

.page-photo .card {
  min-width: 0;
}

.photo-grid {
  display: grid;
  gap: var(--ml-space-3);
}

.photo-format-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--ml-space-2);
}

.photo-format-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ml-space-1);
  min-width: 0;
  min-height: 58px;
  padding: var(--ml-space-2) var(--ml-space-1);
  border: 1px solid var(--ml-line-800);
  border-radius: var(--ml-radius-sm);
  background: var(--ml-surface-900);
  color: var(--ml-text-400);
  cursor: pointer;
  font-weight: 850;
}

.photo-format-option.is-active {
  border-color: rgba(215, 255, 0, 0.48);
  background: rgba(215, 255, 0, 0.1);
  color: var(--ml-lime-400);
}

.format-icon {
  display: block;
  width: 28px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.format-icon-square { height: 28px; }
.format-icon-portrait { width: 27px; height: 34px; }
.format-icon-landscape { width: 34px; height: 22px; }
.format-icon-story { width: 22px; height: 38px; }
.format-icon-wide { width: 38px; height: 19px; }

.photo-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ml-space-3);
  margin-top: var(--ml-space-3);
}

.photo-actions .file-button {
  grid-column: 1 / -1;
}

.photo-actions .btn,
.photo-actions .file-button {
  width: 100%;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.file-button {
  cursor: pointer;
}

.photo-preview-card {
  display: grid;
  gap: var(--ml-space-3);
}

.photo-preview-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ml-radius-md);
  background: #020617;
}

.photo-format-note {
  color: var(--ml-text-400);
  font-size: 0.82rem;
  line-height: 1.35;
}

@media (max-width: 480px) {
  .photo-format-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
