/* TRK-944: the photo picker (photo-picker.js). Tabs on top, then search and industry chips that stay put while the
   large previews scroll under them. Colors come from the app's tokens, so light and dark both follow the theme. */
dialog.confirm-box.photo-picker { width: min(960px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); max-height: none; padding: 20px 20px 0; overflow: hidden; }
dialog.photo-picker[open] { display: flex; flex-direction: column; }
dialog.photo-picker h2 { margin: 0 32px 12px 0; }
.pp-tabs { display: flex; gap: 4px; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.pp-tab { position: relative; margin-bottom: -1px; padding: 8px 4px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.pp-tab + .pp-tab { margin-left: 12px; }
.pp-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
@media (hover: hover) and (pointer: fine) { .pp-tab:hover { background: none; color: var(--text); } }
.pp-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.pp-panel { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.pp-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 0 8px; }
.pp-search { width: 100%; min-width: 0; font-size: 16px; }
/* TRK-1282: one row of chips that scrolls sideways (faded at the cut), with More beside it to open the whole list */
.pp-chiprow { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.pp-chips { display: flex; flex: 1 1 auto; min-width: 0; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.pp-chips::-webkit-scrollbar { display: none; }
.pp-chips.pp-at-end { -webkit-mask-image: none; mask-image: none; }
.pp-chips.pp-open { flex-wrap: wrap; overflow: auto; max-height: min(260px, 35dvh); }
.pp-more { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; touch-action: manipulation; }
.pp-more::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 2px 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }
.pp-more[aria-expanded="true"]::after { margin-bottom: -2px; transform: rotate(-135deg); }
.pp-chip { padding: 4px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); white-space: nowrap; touch-action: manipulation; }
.pp-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .pp-chip[aria-pressed="true"]:hover { background: var(--text); color: var(--bg); } }
.pp-status { min-height: 1.4em; margin: 0 0 8px !important; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pp-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; margin: 0 -20px; padding: 2px 20px 0; }
/* TRK-1282: columns of photos, each at its own shape, so none is cut (a 3:2 cut lost headshots' faces) */
.pp-grid { list-style: none; margin: 0; padding: 0; columns: 4 200px; column-gap: 12px; }
.pp-item { display: grid; gap: 6px; align-content: start; min-width: 0; break-inside: avoid; margin-bottom: 16px; }
.pp-photo { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: border-color 150ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1); }
.pp-photo img { display: block; width: 100%; height: auto; }
.pp-photo:active { transform: scale(0.98); }
.pp-photo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pp-photo[aria-current="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
@media (hover: hover) and (pointer: fine) { .pp-photo:hover { border-color: var(--accent); background: var(--sunken); } }
.pp-in-use { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgb(16 24 40 / 0.78); color: #fff; font-size: 12px; font-weight: 600; }
.pp-missing { aspect-ratio: 3 / 2; display: grid; place-items: center; height: 100%; padding: 8px; color: var(--muted); font-size: 12px; }
dialog.confirm-box .pp-credit { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.pp-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.pp-credit a:hover { color: var(--text); }
.pp-none { column-span: all; display: grid; justify-items: start; gap: 10px; padding: 24px 0; }
dialog.confirm-box .pp-none p { margin: 0; max-width: 52ch; color: var(--muted); text-wrap: pretty; }
.pp-skeleton { display: grid; gap: 6px; }
.pp-skeleton span { display: block; border-radius: 8px; background: var(--sunken); }
.pp-skeleton { break-inside: avoid; margin-bottom: 16px; }
.pp-skeleton span:first-child { aspect-ratio: 3 / 2; }
.pp-skeleton span:last-child { width: 60%; height: 12px; border-radius: 4px; }
dialog.confirm-box .pp-note { margin: 16px 0 0 !important; padding: 12px 0 16px; border-top: 1px solid var(--border); font-size: 12px; }
/* TRK-1282: a photo opens large over the picker, whole and uncut, with Back and Use this photo */
dialog.photo-picker.pp-previewing > :not(.pp-preview, .popup-x) { visibility: hidden; }
dialog.photo-picker.pp-previewing .popup-x { z-index: 1; }
.pp-preview { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: 20px; background: var(--bg); animation: pp-in 160ms cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes pp-in { from { opacity: 0; transform: scale(0.99); } }
@media (prefers-reduced-motion: reduce) { .pp-preview { animation: none; } }
.pp-preview-top { padding-right: 40px; }
.pp-back::before { content: "\2190\00a0"; }
.pp-preview-photo { position: relative; min-height: 0; border-radius: 8px; background: var(--sunken); overflow: hidden; }
.pp-preview-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.pp-preview-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pp-preview-words { min-width: 0; }
dialog.confirm-box .pp-preview-title { margin: 0 0 2px; font-weight: 600; }
.pp-use { flex-shrink: 0; }
@media (max-width: 640px) { .pp-preview { padding: 16px; } .pp-preview-foot { flex-direction: column; align-items: stretch; } }

/* The Photos button beside Upload on a picture field */
.funnel-picture-photos { flex-shrink: 0; }

/* Phones: the picker fills the screen, chips scroll sideways in their own row, and two photos sit side by side */
@media (max-width: 640px) {
  dialog.confirm-box.photo-picker { width: calc(100vw - 16px); max-width: none; height: calc(100dvh - 16px); padding: 16px 16px 0; }
  .pp-scroll { margin: 0 -16px; padding: 2px 16px 0; }
  .pp-chips { margin-left: -16px; padding: 0 0 2px 16px; }
  .pp-chip, .pp-more { padding: 8px 14px; }
  .pp-grid { columns: 2; column-gap: 10px; }
}
