/* User-triggered motion; photo framing and form layout stay fixed. */
.hero-picker-trigger { margin-top: 18px; }
.hero-crop-dialog { max-width: 560px; }
.hero-crop-frame { width: min(68%, 300px); margin: 0 auto; background: var(--ice); }
.hero-crop-frame img { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.hero-crop-controls { padding: 20px; display: grid; gap: 16px; }
.hero-crop-controls label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; }
.hero-crop-controls input { width: 100%; }
.hero-zoom-input { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hero-zoom-input input { min-width: 0; }
.hero-zoom-input output { flex: 0 0 48px; font-size: 14px; text-align: right; }
.hero-crop-controls small { font-size: 13px; line-height: 1.6; }
.hero-crop-controls > div { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.photo-dialog { padding: 0; margin: auto; border: 2px solid var(--ink); color: var(--ink); background: var(--paper-bright); max-height: 92dvh; width: min(900px, 94vw); overflow: auto; }
.photo-dialog::backdrop { background: rgba(5, 10, 28, .84); }
.photo-dialog-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; color: #fff; background: #173be4; }
.photo-dialog-bar h2 { margin: 0; font-size: 22px; line-height: 1.4; }
.photo-dialog-bar > span { min-width: 0; overflow-wrap: anywhere; }
.photo-dialog button { font-size: 15px; }
.photo-dialog-bar button { flex: 0 0 40px; min-height: 40px; color: #fff; background: transparent; border: 1px solid #fff; }
.photo-dialog-note { margin: 20px; line-height: 1.7; }
.hero-picker > .folder-picker { margin: 0 20px; }
.hero-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; padding: 20px; }
.hero-photo-option { min-width: 0; padding: 6px; border: 2px solid var(--ink); background: var(--paper-bright); color: var(--ink); text-align: left; }
.hero-photo-option img { width: 100%; height: 160px; object-fit: contain; background: var(--ice); }
.hero-photo-option span { display: block; padding: 8px 2px; overflow-wrap: anywhere; line-height: 1.6; }
.hero-photo-option[aria-pressed="true"] { border-color: var(--blue); box-shadow: 4px 4px 0 var(--pink); }
.photo-viewer { width: min(1400px, 96vw); height: 94dvh; max-height: 94dvh; background: #0c1021; color: #fff; }
.photo-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.photo-viewer-stage { overflow: auto; min-height: 0; padding: 12px; }
.photo-viewer-stage img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.photo-viewer-stage.is-original-size img { width: auto; height: auto; max-width: none; max-height: none; margin: auto; cursor: zoom-out; }
.photo-viewer-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; }
.photo-viewer-controls button { min-height: 44px; padding: 8px 16px; color: #fff; background: #173be4; border: 1px solid #aebcff; }
.photo-viewer-controls span { font-size: 13px; text-align: center; }
.detail-photo-zoom { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; background: transparent; cursor: zoom-in; }
.detail-photo-zoom span { position: absolute; top: 12px; right: 12px; padding: 8px; background: #173be4; color: #fff; font-size: 14px; }
.detail-photo-arrow { position: absolute; top: 50%; z-index: 3; width: 44px; height: 44px; background: #173be4; color: #fff; border: 1px solid #fff; }
.detail-photo-prev { left: 12px; }
.detail-photo-next { right: 12px; }
.detail-photo-arrow:disabled { visibility: hidden; }
.is-editing .detail-photo-zoom, .is-editing .detail-photo-arrow { display: none; }
@media (max-width: 600px) { .photo-viewer-controls span { display: none; } }
.backup-connect-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper-bright);
  box-shadow: 8px 8px 0 var(--pink);
}
.backup-connect-dialog::backdrop { background: rgba(8, 15, 45, 0.55); }
.backup-connect-bar { padding: 10px 16px; background: #173be4; color: #fff; font: bold 13px/1.4 var(--mono); }
.backup-connect-content { padding: 26px; }
.backup-connect-content h2 { margin: 0 0 16px; font-size: 30px; line-height: 1.35; }
.backup-connect-content p { margin: 12px 0; font-size: 16px; line-height: 1.65; }
.backup-connect-content small { display: block; font-size: 13px; line-height: 1.7; }
.backup-first-use-steps { padding-left: 1.5em; margin: 16px 0; font-size: 15px; line-height: 1.7; }
.backup-first-use-steps li + li { margin-top: 8px; }
.backup-connect-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.modal-info #modal-title {
  line-height: 1.35;
  padding-block: 0.12em;
  overflow-wrap: anywhere;
  word-break: normal;
}

.modal-info,
.modal-info-view { min-width: 0; }
.modal-info #modal-title.is-single-word {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  max-width: 100%;
  /* Exceptional long words remain readable without forcing the modal wider. */
  overflow-x: auto;
}

.wardrobe-backup-panel {
  margin-top: 10px;
  color: var(--ink);
}
.wardrobe-backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wardrobe-backup-panel p,
.wardrobe-backup-panel > small {
  display: block;
  margin: 8px 0 0;
  font-size: max(13px, var(--font-readable-min, 13px));
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.look-image-ghost {
  z-index: 1;
  pointer-events: none !important;
  user-select: none;
}

.modal-image-count {
  z-index: 2;
}

.cover-position-grid {
  transition: opacity 160ms var(--ease-out);
}

.cover-position-target {
  transition: transform 160ms var(--ease-out);
}

.cover-position-frame.is-dragging .cover-position-grid {
  opacity: 0.8;
  transition-duration: 120ms;
}

.cover-position-frame.is-dragging .cover-position-target {
  transform: translate(-50%, -50%) scale(0.92);
  transition-duration: 120ms;
}

.music-player.is-positioned {
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  width: min(460px, calc(100vw - 28px));
}

.music-player.is-positioned.is-collapsed {
  width: min(270px, calc(100vw - 28px));
}

.music-player-body {
  transform-origin: bottom;
}

.music-player.is-collapsed .music-player-body {
  transform: translate3d(0, 9px, 0);
}

.music-player-titlebar {
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.is-dragging-player .music-player-titlebar { cursor: grabbing; }
.music-drag-dots { font-style: normal; opacity: 0.7; }
.music-dock {
  width: 23px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: rgba(8, 24, 95, 0.34);
  font-size: 14px;
  transition: transform 120ms var(--ease-out);
}
.music-dock:active { transform: scale(0.96); }

.pixel-cat-help {
  position: relative;
  z-index: 3;
  width: min(100%, 330px);
  margin-top: 30px;
}

.pixel-cat-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px 8px 6px;
  border: 1px solid rgba(255,255,255,0.7);
  color: #08185f;
  background: #d9eef5;
  box-shadow: 4px 5px 0 #ff8ac5;
  text-align: left;
  transition: transform 120ms var(--ease-out);
}
.pixel-cat-toggle:active { transform: scale(0.96); }
.pixel-cat-toggle img { flex: 0 0 60px; object-fit: contain; }
.pixel-cat-toggle > span { min-width: 0; }
.pixel-cat-toggle small { display: block; font-size: 10px; letter-spacing: 0.05em; }
.pixel-cat-toggle strong { display: block; margin-top: 5px; font-size: 16px; line-height: 1.4; }
.pixel-cat-toggle > b { margin-left: auto; font: 900 24px Arial, sans-serif; }

.pixel-cat-panel {
  margin-top: 14px;
  border: 1px solid #08185f;
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 5px 6px 0 #ff8ac5;
  transform-origin: top left;
}
.pixel-cat-panel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  color: #fff;
  background: #08185f;
  font-size: 13px;
}
.pixel-cat-panel-bar button {
  padding: 0;
  width: 28px;
  height: 28px;
  font: 20px Arial, sans-serif;
  border: 1px solid #b8ddea;
  color: #fff;
  background: transparent;
}
.pixel-cat-panel dl { margin: 0; padding: 15px; }
.pixel-cat-panel dt { margin: 12px 0 4px; color: var(--blue); font-size: 14px; }
.pixel-cat-panel dt:first-child { margin-top: 0; }
.pixel-cat-panel dd { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.look-meta-topline { display: flex; align-items: center; gap: 8px; min-width: 0; height: 18px; }
.look-meta-topline > small { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.first-archive-stamp {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-4deg);
}
.first-archive-stamp i {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 15px;
  border: 1px solid var(--blue-deep);
  background: var(--pink);
}
.first-archive-stamp.is-awaiting-stamp { opacity: 0; }
.first-archive-stamp i::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 3px;
  width: 6px;
  height: 5px;
  background: var(--ice);
  border: 1px solid var(--blue-deep);
}
.first-archive-stamp i::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 2px;
  width: 8px;
  height: 5px;
  background: var(--paper-bright);
}

@media (max-width: 620px) {
  .music-player-titlebar { gap: 5px; }
  .music-player-titlebar .music-equalizer { display: none; }
  .music-player-titlebar { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .music-dock, .music-collapse { width: 28px; height: 28px; }
  .pixel-cat-help { width: min(100%, 380px); }
}

@media (prefers-reduced-motion: reduce) {
  .cover-position-grid { transition: opacity 100ms ease; }
  .cover-position-target,
  .cover-position-frame.is-dragging .cover-position-target { transform: translate(-50%, -50%); transition: none; }
  .pixel-cat-toggle, .music-dock { transition: opacity 100ms ease; }
  .pixel-cat-toggle:active, .music-dock:active { transform: none; opacity: 0.85; }
  .first-archive-stamp { transform: none; }
}
