/* Step 1's sources: a shared album's link, the customer's own files uploaded from this device (upload/photo-upload.js),
   and a tab for each photo service she can pick photos in (upload/photo-pick.js). One even row the field's width, each
   choice an icon over a short name: two or three choices side by side read as choices, where a pill whose names
   wrapped onto two lines read as a button and a line of text. */
.source-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; margin: 6px 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); width: 100%; box-sizing: border-box; }
.source-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 64px;
  border: 0; border-radius: calc(var(--r-lg) - 4px); padding: 8px 6px; cursor: pointer; font: inherit; font-weight: 700;
  line-height: 1.2; text-align: center; overflow-wrap: anywhere; color: var(--ink-dim); background: none; position: relative; }
.source-tab-ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.source-tab[aria-selected="true"] { color: #0b0b0f; background: linear-gradient(100deg, var(--gold), var(--gold-deep)); }
.source-tab:not([aria-selected="true"]):hover { color: var(--ink); }
/* A photo service that lost its connection (upload/photo-pick.js): a status of that source, not a look of its own. The
   tab stays as it is with a small dot (the word is there for a screen reader); the panel says it and offers Reconnect,
   its one primary action. */
.source-tab[data-state="disconnected"]::after { content: ""; position: absolute; top: 8px; right: 10px; width: 8px;
  height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
.source-tab-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.source-tab-state[hidden] { display: none; }
.pick-panel.pick-disconnected .pick-status { display: flex; align-items: baseline; gap: 8px; }
.pick-panel.pick-disconnected .pick-status[hidden] { display: none; }
.pick-panel.pick-disconnected .pick-status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); transform: translateY(-1px); }
.pick-panel.pick-disconnected .pick-open { color: #0b0b0f; border: 0;
  background: linear-gradient(100deg, var(--gold), var(--gold-deep)); }
.pick-panel.pick-disconnected .pick-next { display: none; }
.source-panel[hidden] { display: none; }

/* The drop zone: the whole area opens the file picker (it is the input's label). */
.photo-upload-drop { display: grid; justify-items: center; gap: 6px; margin: 18px 0 12px; padding: 30px 18px; cursor: pointer;
  text-align: center; font-weight: 400; color: var(--ink-dim); border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg); background: rgba(var(--wash-rgb), .02); transition: border-color .18s ease, background .18s ease; }
.photo-upload-drop:hover { border-color: var(--accent); background: rgba(240, 177, 85, .06); }
.photo-upload-drop:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }   /* its input is invisible */
.photo-upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-upload-drop svg { width: 34px; height: 34px; color: var(--accent); }
.photo-upload-drop strong { color: var(--ink); font-size: 1.05rem; }
.photo-upload-choose { color: var(--accent); font-weight: 700; }
/* "or choose a folder", under the zone: a computer's (photo-upload-drop.js). */
.photo-upload-folder { display: inline-block; margin: 0 0 10px; cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--accent); }
.photo-upload-folder[hidden] { display: none; }
.photo-upload-folder input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-upload-folder:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.photo-upload-folder:hover { text-decoration: underline; }

/* Files dragged over the page: the whole window says it takes them. Clicks pass through; the page handles the drop. */
.photo-upload-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  pointer-events: none; background: color-mix(in srgb, var(--bg) 82%, transparent); }
.photo-upload-overlay[hidden] { display: none; }
.photo-upload-overlay > div { display: grid; justify-items: center; gap: 12px; width: min(560px, 100%); padding: 56px 24px;
  text-align: center; color: var(--ink); border: 2px dashed var(--accent); border-radius: var(--r-lg);
  background: rgba(240, 177, 85, .06); }
.photo-upload-overlay svg { width: 46px; height: 46px; color: var(--accent); }
.photo-upload-overlay strong { font-size: 1.3rem; }

.photo-upload-summary { margin: 4px 0 8px; font-weight: 700; color: var(--ink-dim); }
.photo-upload-summary[hidden] { display: none; }
.photo-upload-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.photo-upload-list:empty { display: none; }
.photo-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 10px;
  padding: 8px 2px; border-bottom: 1px solid var(--line); }
.photo-upload-name, .photo-upload-size, .photo-upload-remove { grid-row: 1; }   /* the name, its size and the remove button on one line */
.photo-upload-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.photo-upload-size { color: var(--muted); font-size: .85rem; }
.photo-upload-remove { width: 30px; height: 30px; padding: 0; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--muted);
  background: none; border: 1px solid var(--line-strong); border-radius: 50%; }
.photo-upload-remove:hover { color: var(--ink); border-color: var(--accent); }
.photo-upload-bar { grid-column: 1 / -1; width: 100%; height: 5px; appearance: none; -webkit-appearance: none; border: 0;
  border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.photo-upload-bar::-webkit-progress-bar { background: var(--line); }
.photo-upload-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--gold), var(--violet)); }
.photo-upload-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--gold), var(--violet)); }
.photo-upload-state { grid-column: 1 / -1; min-width: 0; font-size: .8rem; color: var(--muted); }
.photo-upload-row[data-state="complete"] .photo-upload-state { color: var(--accent); }
.photo-upload-row[data-state="failed"] .photo-upload-state { color: var(--danger); }
.photo-upload-row[data-state="failed"] .photo-upload-bar { visibility: hidden; }

.photo-upload-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 14px; }
.photo-upload-actions .next { margin-left: auto; }
#upload-discard[hidden] { display: none; }

/* A photo service's tab (upload/photo-pick.js): its button opens the service's sign-in in a new tab. */
.pick-open { display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0 10px;
  max-width: 100%; min-height: 48px; padding: 12px 22px; white-space: normal; text-align: center; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-pill); }
.pick-open:hover { border-color: var(--accent); }
.pick-open img { width: 22px; height: 22px; flex: none; }
.pick-link { display: inline-block; margin: 0 0 10px; font-weight: 700; color: var(--accent); }
.pick-link[hidden], .pick-status[hidden], .pick-bar[hidden], .pick-left-out[hidden], .pick-discard[hidden] { display: none; }
.pick-bar { display: block; margin: 0 0 10px; }
.pick-left-out { margin: 6px 0; color: var(--ink-dim); }
.pick-left-out p { margin: 0 0 4px; font-weight: 700; }
.pick-left-out-list { margin: 0; padding-left: 18px; max-height: 30vh; overflow-y: auto; font-size: .9rem; overflow-wrap: anywhere; }
.pick-left-out-list strong { color: var(--ink); }
@media (max-width: 700px) {
  .source-tab { font-size: .9rem; }
  .photo-upload-drop { padding: 24px 14px; }
}
