* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
.button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  line-height: 1.4;
}
button:hover,
.button:hover {
  border-color: var(--accent);
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.danger {
  color: #ad3834;
}
.small {
  font-size: 13px;
  padding: 5px 10px;
}
header {
  min-height: 84px;
  height: auto;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 5vw;
  background: var(--surface);
}
header nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
}
.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.mark {
  font-size: 31px;
}
.brand small {
  font:
    11px/1.4 -apple-system,
    sans-serif;
  display: block;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 56px 5vw 90px;
}
h1 {
  font-size: 42px;
  letter-spacing: -1.6px;
  line-height: 1.15;
  font-weight: 550;
  margin: 0 0 14px;
}
h2 {
  font-size: 22px;
  font-weight: 550;
  letter-spacing: -0.5px;
  margin: 0 0 18px;
}
h3 {
  font-size: 17px;
  margin: 0 0 10px;
}
p {
  margin: 0 0 16px;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}
.intro {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.intro p {
  max-width: 650px;
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.cards .card {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.cards h2 {
  margin: 0;
}
.card footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: auto;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 24px;
}
.metrics {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin: 26px 0;
}
.metrics strong {
  display: block;
  font-size: 27px;
  font-weight: 550;
  letter-spacing: -1px;
}
.metrics span {
  font-size: 12px;
  color: var(--muted);
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 17px;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 7px;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
input[type="color"] {
  height: 43px;
  padding: 4px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.row {
  display: flex;
  gap: 16px;
}
.row > label {
  flex: 1;
}
.disk-capacity {
  flex: 1;
  min-width: 0;
}
.disk-capacity .progress {
  width: 100%;
}
.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.good {
  color: var(--accent);
}
.login {
  max-width: 440px;
  margin: 5vh auto;
}
.login h1 {
  font-size: 34px;
}
.login .card {
  padding: 34px;
}
.login button {
  width: 100%;
}
.login .muted {
  font-size: 13px;
}
.empty {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.upload {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px dashed var(--accent);
  padding: 25px;
  background: var(--surface);
  border-radius: 12px;
  margin: 26px 0;
  gap: 20px;
}
.upload p {
  margin: 0;
}
.upload input {
  max-width: 320px;
  font-size: 13px;
}
.upload:has(input:disabled) .file-picker .button { opacity: .55; cursor: progress; }
.upload-progress { margin: -10px 0 26px; padding: 22px 25px; }
.upload-progress-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.upload-progress-heading h2 { font-size: 17px; margin: 0 0 12px; }
.upload-progress-heading strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.upload-progress .progress { display: block; width: 100%; height: 12px; margin: 0 0 12px; accent-color: var(--accent); }
.upload-progress p { margin: 7px 0; font-size: 13px; }
.upload-progress a { display: inline-block; margin-top: 8px; font-size: 12px; }
.upload-error { color: var(--danger, #a83232); }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
#photos .photo .image {
  aspect-ratio: auto;
}
#photos .photo img {
  height: auto;
}
#photos.masonry {
  display: block;
  position: relative;
}
#photos.masonry > * {
  position: absolute;
  margin: 0;
}
.photo {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.photo .image {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  aspect-ratio: 4 / 3;
  height: auto;
}
.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.photo footer {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.photo footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo label {
  margin: 0;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-top: 30px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
}
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
td p {
  margin: 3px 0;
}
.activity-photo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.activity-photo > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.activity-thumbnail {
  flex: 0 0 64px;
  width: 64px;
  height: 48px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg);
}
.break {
  overflow-wrap: anywhere;
}
.progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
  margin: 16px 0;
}
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 17px;
  background: var(--surface);
  font-size: 13px;
  margin: 15px 0;
}
#notice {
  position: fixed;
  right: 25px;
  bottom: 25px;
  max-width: min(480px, 90vw);
  z-index: 10;
}
#notice:not(:empty) {
  background: var(--text);
  color: var(--bg);
  padding: 16px 24px;
  border-radius: 10px;
  box-shadow: 0 5px 30px #0002;
}
dialog {
  max-width: min(1100px, 95vw);
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  padding: 28px;
  max-height: 92vh;
  overflow: auto;
}
dialog::backdrop {
  background: #0009;
}
.hidden-dropbox-photo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.hidden-dropbox-photo > div { min-width: 0; }
.hidden-dropbox-photo p { margin: 4px 0 0; }
.hidden-dropbox-photo button { flex-shrink: 0; }
@media (max-width: 500px) {
  .hidden-dropbox-photo { align-items: flex-start; flex-direction: column; gap: 8px; }
}
dialog .close {
  float: right;
}
dialog .view {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 24px;
  clear: both;
  padding-top: 18px;
}
dialog .view img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: var(--bg);
  border-radius: 8px;
}
.comment {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
}
.comment p {
  white-space: pre-wrap;
  margin: 5px 0;
}
.gallery-description {
  white-space: pre-wrap;
}
.space {
  margin-top: 24px;
}
.pagination {
  margin-top: 24px;
}
.folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 20px;
}
.hidden {
  display: none !important;
}
summary {
  cursor: pointer;
  font-weight: 600;
  margin: 12px 0;
}
details .card {
  margin-top: 15px;
}
code {
  font-size: 12px;
  word-break: break-all;
}
.credit {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 55px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 800px) {
  header {
    padding: 14px 5vw;
    min-height: 74px;
    height: auto;
  }
  header nav {
    gap: 12px;
    font-size: 13px;
  }
  .brand {
    font-size: 20px;
  }
  .brand small {
    font-size: 9px;
  }
  main {
    padding-top: 32px;
  }
  h1 {
    font-size: 34px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .row {
    flex-direction: column;
    gap: 0;
  }
  .upload {
    align-items: flex-start;
    flex-direction: column;
  }
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  dialog .view {
    grid-template-columns: 1fr;
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .metrics {
    gap: 25px;
  }
  header nav .workspace-name {
    display: none;
  }
}

@media (max-width: 600px) {
  header {
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px 5vw;
  }
  header nav {
    justify-content: space-between;
  }
  header nav:empty {
    display: none;
  }
  .brand span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand small {
    white-space: nowrap;
  }
}

.language-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
}
.language-picker select {
  width: auto;
  max-width: 125px;
  font-size: 12px;
  padding: 6px 8px;
}
header nav {
  flex-wrap: wrap;
}
@media (min-width: 601px) and (max-width: 1000px) {
  header {
    flex-wrap: wrap;
    gap: 18px;
  }
}
@media (max-width: 600px) {
  .language-picker {
    margin-left: auto;
  }
}

.file-picker {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  margin-bottom: 0;
}
.file-picker .button {
  pointer-events: none;
}
.file-picker:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gallery-filters {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.gallery-filters.without-marks {
  grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(110px, 1fr));
}
.gallery-filters label {
  margin: 0;
}
.gallery-actions {
  margin: 18px 0 8px;
}
.day-heading {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.day-heading h2 {
  flex: 1 1 200px;
  margin: 0;
  font-size: 19px;
}
.photo-marks {
  padding: 0 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.photo-labels {
  padding: 0 12px 12px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.heart.is-favorite {
  color: #ba4661;
}
.color-chip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
  display: inline-block;
}
.color-chip.red {
  background: #cc4756;
}
.color-chip.orange {
  background: #d89535;
}
.color-chip.green {
  background: #438a62;
}
.color-chip.blue {
  background: #438bc0;
}
.color-chip.purple {
  background: #8c62b3;
}
.color-chip.final {
  background: #343b44;
  border: 2px solid #b9c9d2;
}
.photo-navigation {
  clear: both;
  padding-top: 15px;
}
.photo-navigation span {
  font-size: 12px;
}
.zoom-photo {
  display: block;
  width: 100%;
  padding: 0;
  overflow: auto;
  cursor: zoom-in;
}
.zoom-photo.zoomed {
  max-height: 70vh;
  cursor: zoom-out;
}
dialog .view .zoomed img {
  width: auto;
  max-width: none;
  max-height: none;
}
.metadata {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.metadata dt {
  font-weight: 700;
  color: var(--muted);
  margin-top: 8px;
}
.metadata dd {
  margin: 0;
  white-space: pre-wrap;
}
.comment .remove-comment {
  margin: 10px 0 0 12px;
}
/* Pins share the image's own box, including when a portrait reaches 70vh. */
@media (min-width: 801px) {
  .photo-review-image { position: sticky; top: 16px; align-self: start; }
}
.annotation-image {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.zoom-photo:not(.zoomed) { overflow: visible; }
.photo-surface {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  line-height: 0;
  background: transparent;
  cursor: zoom-in;
}
dialog .view .photo-surface img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}
.zoomed .annotation-image { max-width: none; width: max-content; }
.zoomed .photo-surface { width: auto; cursor: zoom-out; }
dialog .view .zoomed .photo-surface img { width: auto; max-width: none; max-height: none; }
.photo-surface.placing-point { cursor: crosshair; outline: 2px solid var(--accent); outline-offset: 2px; }
#photo-points { position: absolute; inset: 0; pointer-events: none; }
.photo-point {
  position: absolute;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #20242b;
  color: #fff;
  font: 700 13px/1 sans-serif;
  box-shadow: 0 1px 6px #0008;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 1;
}
.photo-point::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.photo-point.resolved { background: #216544; }
.photo-point.pending { background: #275ac5; pointer-events: none; }
.point-check { position: absolute; right: -6px; top: -7px; border-radius: 50%; background: #216544; padding: 2px; font-size: 11px; }
.photo-point.annotation-active, .photo-point:focus-visible { outline: 3px solid #fff; outline-offset: 3px; z-index: 2; }
.annotation-tools { margin-top: 12px; }
#photo-point-hint { font-size: 13px; }
.comment-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-status { margin-left: auto; color: var(--muted); font-size: 12px; }
.comment.resolved .comment-status { color: #216544; }
.comment.annotation-active { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.comment .actions { margin-top: 10px; }
.comment .resolve-comment-control { margin: 0; font-size: 13px; }
.comment .remove-comment { margin: 0; }
/* The legacy slideshow: quiet chrome, full photo stage and persistent branding. */
dialog.slideshow {
  max-width: 100vw;
  width: 100vw;
  max-height: 100dvh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
  background: #212326;
  color: #fff;
  overflow: hidden;
  color-scheme: dark;
}
dialog.slideshow[open] { display: flex; flex-direction: column; }
.slideshow .slide-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 64px;
  padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  border-bottom: 1px solid #ffffff12;
}
.slide-file, .slide-controls { display: flex; align-items: center; gap: 12px; }
.slide-file { min-width: 0; flex: 1; }
.slide-filename { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.slide-controls { flex-shrink: 0; }
.slide-count { font-size: 11px; white-space: nowrap; color: #b9bcc2; }
.slideshow .slide-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  box-shadow: none;
}
.slideshow .slide-icon svg { width: 20px; height: 20px; }
.slideshow .slide-icon:hover { background: #ffffff12; border: 0; }
.slideshow .slide-icon:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.slideshow #slide-shuffle[aria-pressed="true"] { background: #ffffff24; }
.slideshow #slide-favorite[aria-pressed="true"] { color: #f5a4b2; background: #ffffff14; }
.slideshow #slide-favorite[aria-pressed="true"] svg { fill: currentColor; }
.slideshow .slide-image {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
  touch-action: pan-y;
}
.slide-frame { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.slide-frame img { max-width: calc(100% - 100px); max-height: calc(100% - 70px); object-fit: contain; user-select: none; }
.slideshow .slide-prev, .slideshow .slide-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; border-radius: 50%; background: #ffffff0b; }
.slideshow .slide-prev { left: max(18px, env(safe-area-inset-left)); }
.slideshow .slide-next { right: max(18px, env(safe-area-inset-right)); }
.slide-footer { display: flex; align-items: center; flex-shrink: 0; min-height: 62px; padding: 10px max(24px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); border-top: 1px solid #ffffff12; }
.slideshow .slide-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; max-width: 100%; color: #fff; border-radius: 4px; }
.slide-brand img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.slide-brand > span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.slide-brand strong { font-size: 13px; font-weight: 600; line-height: 1.3; }
.slide-brand > span > span { font-size: 10px; line-height: 1.3; color: #b9bcc2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slideshow #dialog-notice:empty { display: none; }
.slideshow #dialog-notice:not(:empty) { position: absolute; bottom: calc(72px + env(safe-area-inset-bottom)); left: 16px; right: 16px; margin: 0; padding: 10px; background: #212326ed; color: #fff; font-size: 12px; z-index: 2; }
@media (max-width: 700px) {
  .slideshow .slide-top { min-height: 56px; gap: 6px; padding-right: max(10px, env(safe-area-inset-right)); padding-left: max(10px, env(safe-area-inset-left)); }
  .slide-file, .slide-controls { gap: 4px; }
  .slide-filename { font-size: 11px; }
  .slide-frame img { max-width: calc(100% - 60px); max-height: calc(100% - 30px); }
  .slideshow .slide-prev { left: max(8px, env(safe-area-inset-left)); }
  .slideshow .slide-next { right: max(8px, env(safe-area-inset-right)); }
  .slide-footer { min-height: 58px; padding: 8px max(14px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
}
.gallery-cover {
  display: block;
  width: calc(100% + 52px);
  margin: -26px -26px 8px;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.home-search {
  max-width: 500px;
  margin-bottom: 22px;
}
@media (max-width: 1000px) {
  .gallery-filters,
  .gallery-filters.without-marks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gallery-filters label:first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 600px) {
  .day-heading h2 {
    font-size: 16px;
  }
}


/* Reveal tools without changing masonry measurements; touch keeps all controls. */
@media (hover: hover) and (pointer: fine) {
  #photos .photo :is(.photo-select, .photo-marks) {
    opacity: 0;
    pointer-events: none;
  }
  #photos .photo:is(:hover, :focus-within) :is(.photo-select, .photo-marks) {
    opacity: 1;
    pointer-events: auto;
  }
}


/* Photo-only masonry cards; metadata is revealed without reserving blank rows. */
#photos.masonry .photo{border:0;background:transparent}
#photos.masonry .photo-details{position:absolute;left:0;right:0;bottom:0;padding-top:28px;background:linear-gradient(transparent,rgba(0,0,0,.8));color:#fff;pointer-events:none}
#photos.masonry .photo-details :is(button,input,a,label){pointer-events:auto}
#photos.masonry .photo-labels{color:#fff}
@media (hover: hover) and (pointer: fine){
 #photos.masonry .photo-details{opacity:0}
 #photos.masonry .photo:is(:hover,:focus-within) .photo-details{opacity:1}
 #photos.masonry .photo:not(:hover):not(:focus-within) .photo-details :is(button,input,a,label){pointer-events:none}
}

.photo-download-frame {position:relative;display:grid;width:fit-content;max-width:100%;padding:6px;margin:16px auto;line-height:0;border-radius:10px}
.save-photo-preview {display:block;width:auto;height:auto;max-width:100%;max-height:min(40vh,320px);object-fit:contain;border-radius:5px}
.photo-download-ring {position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.photo-download-track,.photo-download-outline {fill:none}
.photo-download-track {stroke:#ffffffdf;stroke-width:7}
.photo-download-outline {stroke:var(--accent);stroke-width:4;stroke-dasharray:100;transition:stroke-dashoffset .25s linear}
.photo-download-frame.is-indeterminate .photo-download-outline {stroke-dasharray:18 82;animation:photo-border-orbit 1.6s linear infinite;transition:none}
.photo-download-frame.is-error .photo-download-outline {stroke:var(--muted);opacity:.5;transition:none}
#photo-download-detail {font-size:12px;font-variant-numeric:tabular-nums;margin-bottom:12px}
@keyframes photo-border-orbit {from{stroke-dashoffset:0}to{stroke-dashoffset:-100}}
@media(prefers-reduced-motion:reduce){
 .photo-download-outline {transition:none}
 .photo-download-frame.is-indeterminate .photo-download-outline {animation:none;stroke-dasharray:100;stroke-dashoffset:75}
}

.dropbox-warning { border-color: #c8963d; border-left-width: 3px; }

/* Compact gallery controls, shared with the legacy mobile experience. */
#photos:not(.masonry) .photo {position:relative}
#photos .photo-details:empty {display:none}
#photos .photo-details {position:absolute;left:0;right:0;bottom:0;padding:12px 10px;background:linear-gradient(transparent,rgba(0,0,0,.35));color:#fff;pointer-events:none}
#photos.masonry .photo-details {padding:12px 10px;background:linear-gradient(transparent,rgba(0,0,0,.35))}
#photos .photo-marks {padding:0;gap:6px;font-size:9px}
#photos .photo-marks small {font-size:9px}
#photos .photo-labels {padding:4px 0 0;color:#fff;font-size:9px}
#photos :is(.heart,.photo-download,.photo-visibility) {position:absolute;z-index:3;top:0;right:0;display:inline-flex;align-items:center;justify-content:center;gap:3px;min-width:44px;min-height:44px;height:44px;padding:10px;border:0;border-radius:0;background:transparent;box-shadow:none;color:#282a2d;font-size:9px;isolation:isolate}
#photos :is(.heart,.photo-download,.photo-visibility)::before {content:"";position:absolute;inset:10px;background:#ffffffe0;border-radius:14px;z-index:-1}
#photos :is(.heart,.photo-download,.photo-visibility):hover::before {background:#fff}
#photos :is(.heart,.photo-download,.photo-visibility) svg {width:14px;height:14px;flex:none}
#photos .photo-download {top:auto;bottom:0;width:44px;text-decoration:none}
#photos .heart.is-favorite svg {fill:currentColor}
#photos .heart-count[data-count="0"] {display:none}
#photos .photo-select-control {position:absolute;left:0;bottom:0;z-index:3;display:grid;place-items:center;width:44px;height:44px;cursor:pointer}
#photos .photo-select {position:static;margin:0;width:14px;height:14px;appearance:none;background:#ffffffe0;border:1px solid #fff9;border-radius:4px;box-shadow:0 1px 3px #0002;cursor:pointer;opacity:1}
#photos .photo-select:checked {background:#282a2d;border-color:#fff}
#photos .photo-select:checked::after {content:"";display:block;width:4px;height:7px;border:solid #fff;border-width:0 1.5px 1.5px 0;transform:translate(3.5px,1px) rotate(45deg)}
#photos .photo-select:focus-visible {outline:2px solid #fff;outline-offset:3px}
#photos .selected-photo {box-shadow:inset 0 0 0 3px var(--accent)}
#photos .selected-photo .image {outline:3px solid var(--accent);outline-offset:-3px}
#photos .selected-photo::after {content:"";position:absolute;inset:0;z-index:2;border:3px solid var(--accent);border-radius:inherit;pointer-events:none}
.gallery-selection-controls {display:flex;justify-content:flex-end;align-items:center;gap:8px;min-height:44px;pointer-events:none}
.gallery-selection-controls:empty {display:none}
.gallery-selection-controls>* {pointer-events:auto}
.gallery-selection-controls .gallery-action {min-height:44px;padding:10px 18px;border:1px solid var(--line);border-radius:24px;background:var(--surface);color:var(--text);box-shadow:0 2px 10px #00000012}
.gallery-selection-controls .selection-toggle[aria-pressed="true"] {background:var(--accent);color:#fff}
#photos:not(.selection-mode) .photo-select-control {display:none}
#photos.selection-mode .photo-select-control {opacity:1;pointer-events:auto}
#photos.selection-mode .photo .photo-select {opacity:1;pointer-events:auto}
#photos.selection-mode .open-photo {cursor:copy}
@media (hover:hover) and (pointer:fine) {
 #photos :is(.heart,.photo-download,.photo-visibility) {opacity:0;pointer-events:none}
 #photos .photo:is(:hover,:focus-within) :is(.heart,.photo-download,.photo-visibility) {opacity:1;pointer-events:auto}
 #photos .photo-details {opacity:0}
 #photos .photo:is(:hover,:focus-within) .photo-details {opacity:1}
}
@media(max-width:700px) {
 #photos :is(.heart,.photo-download,.photo-visibility) {opacity:1;pointer-events:auto}
 #photos .photo-details {opacity:0}
 #photos .photo:focus-within .photo-details {opacity:1}
}

/* Match the legacy client gallery's mobile spacing and single-row brand bar. */
@media (max-width: 700px) {
  header.client-header {
    display: flex;
    flex-wrap: nowrap;
    min-height: 60px;
    padding: 8px 16px;
    gap: 8px;
  }
  .client-header .brand { min-width: 0; gap: 8px; font-size: 21px; }
  .client-header .brand > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .client-header .brand img { width: 36px; height: 36px; }
  .client-header .brand small { font-size: 8px; letter-spacing: 1px; }
  .client-header nav { flex: none; }
  .client-header .language-picker span { display: none; }
  .client-header .language-picker select { max-width: 105px; }
  main:has(> .gallery-intro) { padding: 16px 16px 60px; }
  .gallery-intro { gap: 10px; margin-bottom: 14px; }
  .gallery-intro .eyebrow { font-size: 9px; line-height: 1.5; margin-bottom: 4px; }
  .gallery-intro h1 { font-size: 26px; line-height: 1.15; margin-bottom: 6px; }
  .gallery-intro .gallery-description { font-size: 13px; line-height: 1.5; margin: 0; }
  .gallery-description:empty { display: none; }
  main:has(> .gallery-intro) #dropbox-availability {
    font-size: 11px;
    line-height: 1.5;
    padding: 6px 10px;
    margin: 0 0 10px;
  }
  .client-gallery-intro ~ #dropbox-availability.dropbox-ready { display: none; }
  main:has(> .gallery-intro) .toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    padding-bottom: 6px;
    font-size: 11px;
  }
  main:has(> .gallery-intro) .toolbar .actions { margin-left: auto; gap: 6px; }
  main:has(> .gallery-intro) .small { min-height: 42px; padding: 8px 10px; font-size: 11px; }
  .gallery-filters { gap: 8px; margin-top: 10px; }
  .gallery-filters label { min-width: 0; gap: 4px; font-size: 11px; }
  .gallery-filters :is(input, select) { min-width: 0; min-height: 42px; padding: 8px 10px; }
  .gallery-filters input { font-size: 16px; }
  .gallery-filters select { font-size: 12px; }
  .gallery-actions { gap: 6px; margin: 8px 0 4px; }
  .gallery-selection-controls { margin: 8px 0 4px; }
  .gallery-selection-controls .gallery-action { padding: 8px 12px; font-size: 11px; }
  #photos { margin-top: 12px; }
  .day-heading { gap: 8px; margin-top: 4px; padding-bottom: 6px; }
  .day-heading h2 { font-size: 16px; margin: 0; }

}

/* iOS zooms focused form controls below 16px. Cover every form, including
   dialogs and controls whose smaller fonts come from the workspace theme. */
@media (max-width: 800px), (pointer: coarse) {
  input, textarea, select { font-size: 16px !important; }
  input, textarea, select { min-width: 0; max-width: 100%; }
  .client-header .language-picker select { max-width: 125px; }
}

/* Search and selection share one sticky toolbar above the photos. */
#gallery-tools { display: contents; }
.gallery-toolbar {
  position: sticky;
  top: 12px;
  z-index: 12;
  background: var(--bg);
  margin: 6px 0 8px;
  padding: 6px 0;
}
.gallery-tool-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}
.gallery-toolbar.has-selection { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 4px 12px #0000000a; }
.selection-actions { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); }
.selection-actions[hidden] { display: none; }
.selection-actions > p { margin: 0 0 10px; font-size: 12px; line-height: 1.5; }
.selection-action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.selection-action-row > strong { margin-right: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.selection-action-row .selection-group { margin: 0; min-width: 0; }
.selection-group select { width: 100%; min-height: 44px; max-width: 310px; font-size: 12px; }
.selection-action-row button { min-height: 44px; }
@media (max-width: 700px) {
  .gallery-toolbar { top: 6px; }
  .gallery-tool-row { flex-wrap: wrap; }
  .gallery-toolbar.has-selection { padding: 8px; }
  .selection-action-row > strong { flex-basis: 100%; }
  .selection-action-row .selection-group { flex-basis: 100%; }
  .selection-group select { max-width: none; }
  .selection-action-row #download-selection { flex: 1; }
}
.gallery-tool-row .gallery-tool-icon.small {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 7px;
}
.gallery-tool-icon svg { width: 20px; height: 20px; }
.gallery-tool-row .gallery-selection-controls {
  position: static;
  flex: none;
  min-height: 44px;
  margin: 0 0 0 auto;
}
.gallery-tool-row .gallery-action.small {
  min-height: 44px;
  height: 44px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12px;
  box-shadow: none;
}
.gallery-tool-row button[aria-expanded="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.gallery-tool-icon.is-active::after { content: ""; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.gallery-tool-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.gallery-tool-panel[hidden] { display: none; }
.gallery-tool-panel label { min-width: 0; margin: 0; }
.gallery-tool-panel :is(input, select) { min-width: 0; min-height: 44px; background: var(--surface); }
#gallery-tool-panel-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#gallery-tool-panel-filter.without-marks { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 700px) {
  #gallery-tool-panel-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Proofing colors stay visible and separate from the photo/open-selection target. */
.color-swatches {display:flex;align-items:center;flex-wrap:wrap;gap:5px}
.color-swatch {width:34px;min-width:34px;height:36px;min-height:36px;padding:5px;border:1px solid transparent;border-radius:8px;background:transparent;box-shadow:none}
.color-swatch > span {display:grid;place-items:center;width:22px;height:22px;flex:none;border-radius:50%;border:1px solid #0003;background:var(--line);color:#fff;font-size:14px;line-height:1}
.color-swatch.red > span {background:#cc4756}
.color-swatch.orange > span {background:#d89535}
.color-swatch.green > span {background:#438a62}
.color-swatch.blue > span {background:#438bc0}
.color-swatch.purple > span {background:#8c62b3}
.color-swatch.final > span {background:#343b44;border:2px solid #b9c9d2}
.color-swatch.clear > span {background:var(--surface);color:var(--text)}
.color-swatch.clear > span::after {content:"×"}
.color-swatch.all > span,.color-swatch.marked > span {background:conic-gradient(#cc4756 0 60deg,#d89535 60deg 120deg,#438a62 120deg 180deg,#438bc0 180deg 240deg,#8c62b3 240deg 300deg,#343b44 300deg)}
.color-swatch[aria-pressed="true"] > span {outline:2px solid var(--text);outline-offset:2px}
.color-swatch[aria-pressed="true"]:not(.clear) > span::after {content:"✓";text-shadow:0 1px 2px #0009}
.color-swatch:focus-visible {outline:2px solid var(--accent);outline-offset:2px}
.color-swatch:hover {border-color:var(--line);background:var(--bg)}
.color-swatch:disabled {cursor:progress}
.color-filter {display:grid;align-content:start;gap:7px;font-size:13px}
.photo-proof-controls {padding:6px;background:var(--surface)}
.photo-proof-controls .color-swatches {justify-content:center;gap:2px}
.photo-proof-controls .color-swatch {flex:1 0 24px;max-width:34px;min-width:24px;width:24px;height:32px;min-height:32px;padding:3px}
.photo-proof-controls .color-swatch > span {width:18px;height:18px;font-size:12px}
#photos .photo.has-proof-controls .photo-details {position:static;padding:0 8px 7px;opacity:1;background:none;color:var(--muted)}
#photos .photo.has-proof-controls .photo-labels {color:var(--muted)}
#photos .photo > .photo-colors {position:absolute;top:12px;left:12px;z-index:3;display:flex;gap:4px;flex-wrap:wrap;max-width:calc(100% - 68px);pointer-events:none}
#photos .photo-colors .color-chip {width:14px;height:14px;border:2px solid #fff;box-shadow:0 1px 4px #0006}
#photos .photo-colors .color-chip.hidden {display:none}
#photos .photo.has-proof-controls .photo-select-control {top:34px;bottom:auto;left:0}
@media (pointer:coarse) {
 .photo-proof-controls .color-swatch {flex-basis:30px;min-width:30px;height:38px;min-height:38px}
}

.color-swatch.marked {display:inline-flex;align-items:center;gap:6px;width:auto;padding:5px 9px;border-color:var(--line)}
.color-swatch.marked small {font-size:12px;font-weight:600;white-space:nowrap}

/* Focused settings and optional upload details. */
.settings-content { min-width:0; }
.settings-content .card h2 { margin-top:0; }
.settings-disclosure { margin-top:20px; border-top:1px solid var(--line); padding-top:16px; }
.settings-disclosure > summary { min-height:32px; font-size:13px; font-weight:600; cursor:pointer; }

/* The backoffice shares the legacy workspace structure. Client themes stay scoped. */
@font-face {font-family:'Office Sans';src:url('/pilot-static/fonts/open-sans-latin.woff2') format('woff2');font-weight:400 700;font-display:swap}
@font-face {font-family:'Office Raleway';src:url('/pilot-static/fonts/raleway-latin.woff2') format('woff2');font-weight:100 900;font-display:swap}
.ui-icon {width:21px;height:21px;flex-shrink:0;vertical-align:middle}
#backoffice-bar:empty {display:none}
body.backoffice {--bg:#f2f3f5;--surface:#fff;--text:#26282b;--muted:#6f757d;--line:#dce0e5;--accent:#282b2e;background:var(--bg);font-family:'Office Sans',sans-serif;font-size:14px;padding-left:248px}
.backoffice h1,.backoffice h2,.backoffice h3,.backoffice .brand {font-family:'Office Raleway',sans-serif}
.backoffice h1 {font-size:40px;font-weight:500;letter-spacing:-1.5px}
.backoffice .eyebrow {color:#73797e;font-size:11px;letter-spacing:2px}
.backoffice main {max-width:1740px;padding:48px clamp(24px,3.5vw,68px) 80px}
.backoffice-header {position:fixed;inset:0 auto 0 0;width:248px;height:100dvh;min-height:0;border:0;background:#26292c;color:#fff;padding:30px 16px 18px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;z-index:30;overflow-y:auto}
.backoffice-header .brand {color:#fff;align-items:center;gap:12px;font-size:25px;margin:0 0 38px;letter-spacing:-.7px;overflow-wrap:anywhere;line-height:1.2;padding:0 8px}
.backoffice-header .brand img {width:42px;height:42px;border-radius:8px;background:#fff;padding:3px}
.backoffice-header .brand small {color:#c6c8ca;font-size:9px;letter-spacing:1.1px;margin-top:7px}
.backoffice-header nav {display:flex;flex-direction:column;align-items:stretch;gap:6px}
.backoffice-header nav a,.backoffice-header nav button {display:flex;align-items:center;gap:14px;padding:13px 17px;min-height:48px;color:#aeb2b6;background:none;border:0;border-radius:10px;font-size:14px;font-weight:400;line-height:1.4;text-align:left;justify-content:flex-start;text-decoration:none}
.backoffice-header nav a:hover,.backoffice-header nav button:hover {background:#ffffff0a;color:#fff}
.backoffice-header nav a[aria-current=page] {background:#ffffff14;color:#fff;font-weight:600}
.sidebar-bottom {margin-top:auto;padding-top:24px}
.sidebar-storage {display:grid;gap:9px;border:1px solid #53565b;border-radius:11px;padding:14px;color:#fff;font-size:12px;margin-bottom:20px}
.sidebar-storage:empty {display:none}
.sidebar-storage:hover {border-color:#aaa;text-decoration:none}
.sidebar-storage > span {display:flex;align-items:center;justify-content:space-between;font-size:10px;text-transform:uppercase;letter-spacing:1.5px;color:#c9ccd0}
.sidebar-storage strong {font-size:12px;font-weight:500}
.sidebar-storage small {color:#bdc1c5;font-size:11px}
.sidebar-storage progress {width:100%;height:5px;border:0;border-radius:5px;overflow:hidden;appearance:none;background:#55595f}
.sidebar-storage progress::-webkit-progress-bar {background:#55595f}
.sidebar-storage progress::-webkit-progress-value {background:#b5bbc2;border-radius:5px}
.sidebar-storage progress::-moz-progress-bar {background:#b5bbc2}
.sidebar-account {border-top:1px solid #53565b;padding-top:22px;display:flex;align-items:center;gap:11px;min-width:0}
.account-avatar {width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#ffffff14;font-size:12px;flex-shrink:0}
.sidebar-account > span:nth-child(2) {min-width:0;flex:1}
.sidebar-account strong {display:block;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-account small {color:#aeb2b6;font-size:11px}
.sidebar-account button {padding:8px;color:#c5c9cd;background:none;border:0}
#backoffice-bar:not(:empty) {height:72px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px clamp(24px,3.5vw,68px);background:var(--bg)}
.office-breadcrumb {display:flex;align-items:center;gap:18px;color:var(--muted);font-size:12px}
.office-breadcrumb strong {font-weight:400}
#backoffice-bar .language-picker {margin:0}
#backoffice-bar .office-upload {font-size:12px;background:transparent;padding:10px 15px}
.backoffice .primary {background:#282b2e;border-color:#282b2e;color:white}
.backoffice .intro .actions {justify-content:flex-end}
.home-intro {align-items:flex-end;margin-bottom:36px}
.home-intro h1 {margin-bottom:18px}
.home-intro p:last-child {margin:0}
.office-metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin-bottom:42px}
.office-metrics .card {padding:22px 24px;min-height:122px;border-radius:11px}
.office-metrics .card > span {display:flex;justify-content:space-between;align-items:center;color:var(--muted);font-size:12px;gap:8px;margin-bottom:16px}
.office-metrics strong {display:block;font-size:29px;font-weight:550;line-height:1.1}
.home-toolbar {display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:26px}
.gallery-tabs {display:flex;flex-wrap:wrap;align-items:center;gap:3px}
.gallery-tab {font-size:11px;padding:10px;border:0;background:transparent;color:var(--muted);min-height:40px;font-weight:400;white-space:nowrap}
.gallery-tab[aria-pressed=true] {background:#e3e5e8;color:var(--text);font-weight:600}
.gallery-tab span {padding:1px 5px;border-radius:4px;background:#d4d7db;font-size:10px}
.home-toolbar .home-search {margin:0;flex:0 1 240px;min-width:170px}
.home-toolbar input {background:#fff;font-size:12px;min-height:42px}
.source-limit {font-size:11px}
.office-galleries {grid-template-columns:repeat(3,minmax(0,1fr));gap:26px}
.office-galleries .office-gallery {padding:0;display:flex;gap:0;overflow:hidden;border-radius:12px}
.gallery-art {position:relative;background:#e4e6e9}
.gallery-art > a {display:block;aspect-ratio:1.45;overflow:hidden}
.office-galleries .gallery-cover {width:100%;height:100%;aspect-ratio:auto;object-fit:cover;margin:0;border-radius:0;transition:transform .2s}
.gallery-art > a:hover img {transform:scale(1.025)}
.gallery-placeholder {height:100%;width:100%;display:grid;place-items:center;color:#9a9fa5;background:linear-gradient(135deg,#e7e9ec,#d8dde1)}
.gallery-placeholder svg {width:50px;height:50px;stroke-width:1}
.gallery-kind {position:absolute;top:16px;left:16px;display:flex;align-items:center;gap:6px;padding:7px 10px;border-radius:5px;background:#ffffffee;color:#62676c;font-size:10px;max-width:calc(100% - 76px)}
.gallery-kind svg {width:16px;height:16px}
.gallery-art .pin-gallery {position:absolute;right:16px;top:16px;width:38px;height:38px;padding:9px;border-radius:50%;background:#ffffffee;color:#767d84;border:0}
.gallery-art .pin-gallery[aria-pressed=true] {background:#282b2e;color:#fff}
.gallery-card-body {padding:20px 23px;display:flex;flex-direction:column;flex:1;min-width:0}
.gallery-card-heading {display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:12px}
.office-galleries h2 {font-size:18px;line-height:1.4;overflow-wrap:anywhere}
.office-galleries h2 a {color:var(--text)}
.gallery-card-heading .badge {font-size:8px;white-space:nowrap;flex-shrink:0}
.gallery-card-body p {font-size:11px;margin:0 0 12px}
.gallery-size {display:flex;align-items:center;gap:7px}
.gallery-size svg {width:16px;height:16px}
.gallery-description {color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.gallery-card-body footer {display:flex;align-items:center;gap:12px;font-size:11px;color:var(--muted);margin-top:auto;padding-top:17px}
.gallery-card-body footer span {display:inline-flex;align-items:center;gap:5px}
.gallery-card-body footer svg {width:16px;height:16px}
.gallery-card-body footer > a {margin-left:auto;color:var(--muted);padding:3px}
.backoffice :is(#workspace-list,#package-settings,#server-storage,#platform-processing) {scroll-margin-top:24px}
@media (min-width:1500px) {.gallery-tab {font-size:12px;padding:11px 13px}.office-galleries {gap:30px}}
@media (max-width:1150px) {
 body.backoffice {padding-left:210px}
 .backoffice-header {width:210px;padding:24px 12px 16px}
 .backoffice-header .brand {font-size:21px;gap:8px}
 .backoffice-header nav a,.backoffice-header nav button {padding:13px;gap:10px;font-size:12px}
 .office-galleries {grid-template-columns:repeat(2,minmax(0,1fr))}
 .home-toolbar {flex-wrap:wrap}
 .home-toolbar .home-search {flex-basis:100%;max-width:none}
 .office-metrics {gap:12px}
 .office-metrics .card {padding:17px;min-height:110px}
}
@media (max-width:800px) {
 body.backoffice {padding-left:0}
 .backoffice-header {position:static;width:auto;height:auto;padding:18px 20px 12px;overflow:visible;gap:16px}
 .backoffice-header .brand {font-size:23px;margin:0;padding:0}
 .backoffice-header .brand img {width:34px;height:34px}
 .backoffice-header nav {flex-direction:row;overflow-x:auto;gap:5px}
 .backoffice-header nav a,.backoffice-header nav button {flex:none;min-height:44px;padding:10px;font-size:11px;gap:7px}
 .backoffice-header nav svg {width:18px;height:18px}
 .sidebar-bottom {margin:0;padding:0;position:absolute;right:16px;top:20px}
 .sidebar-account {padding:0;border:0}
 .sidebar-account > span,.sidebar-storage {display:none}
 #backoffice-bar:not(:empty) {height:auto;min-height:60px;padding:10px 20px}
 #backoffice-bar .office-upload {display:none}
 .office-breadcrumb {gap:10px;font-size:11px}
 .backoffice main {padding:30px 20px 60px}
 .backoffice h1 {font-size:34px}
 .home-intro {align-items:flex-start;flex-direction:column;gap:20px}
 .backoffice .intro .actions {justify-content:flex-start}
 .office-metrics {grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:24px}
 .office-metrics .card {min-height:102px}
 .office-metrics strong {font-size:26px}
 .gallery-tabs {flex-wrap:nowrap;overflow-x:auto;width:100%;padding-bottom:5px}
 .gallery-tab {flex-shrink:0}
 .home-toolbar {gap:14px;margin-bottom:20px}
}
@media (max-width:520px) {
 .office-galleries {grid-template-columns:minmax(0,1fr)}
 .backoffice-header .brand {padding-right:36px;max-width:100%;font-size:21px}
 .backoffice .split {grid-template-columns:minmax(0,1fr)}
}
@media (prefers-reduced-motion:reduce) {.office-galleries .gallery-cover {transition:none}}

/* Personal gallery access uses the same native form and card styles. */
.access-list { max-height: 18rem; overflow: auto; display: grid; gap: .4rem; }
.access-list .check { margin: .25rem 0; align-items: flex-start; }
#customer-form fieldset, #gallery-form fieldset, #customer-group-form fieldset { min-width: 0; margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius, 8px); }

.gallery-presence { margin: 12px 0; min-height: 36px; font-size: 12px; line-height: 1.5; }
.presence-online { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.presence-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--text); }
.presence-names { display: block; color: var(--muted); overflow-wrap: anywhere; }

.access-disclosure { min-width: 0; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius, 8px); }
.access-disclosure > summary { margin: 0; padding: 12px 14px; }
.access-disclosure > summary small { margin-left: 8px; font-weight: 400; }
.access-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.access-disclosure > .access-list { padding: 12px 14px; }

/* Backoffice destinations use the same page and section structure. */
.office-page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:32px; }
.office-page-header h1 { margin:8px 0 12px; line-height:1.18; }
.office-page-header p:last-child { margin:0; max-width:64ch; }
.office-page-header > .actions { padding-top:28px; flex-shrink:0; }
.office-section,.office-storage,.office-filter-card,.office-permissions { margin-bottom:24px; min-width:0; padding:26px; border-radius:12px; }
.office-section h2,.office-storage h2 { margin-top:0; }
.office-section-header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:22px; }
.office-section-header h2 { margin:0; font-size:21px; }
.office-section-header p { margin:6px 0 0; font-size:13px; }
.office-section-header > small { flex-shrink:0; padding-top:4px; }
.office-tabs { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.office-tabs a { display:block; color:var(--muted); font-size:12px; font-weight:600; padding:10px 13px; border-radius:7px; text-decoration:none; }
.office-tabs a:hover { background:var(--bg); color:var(--text); }
.office-tabs a[aria-current=page] { background:#e6e8eb; color:var(--text); }
.office-tabs a:focus-visible,.office-person-link:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.office-settings-tabs { margin-bottom:24px; border-bottom:1px solid var(--line); border-radius:0; padding-bottom:14px; }
.office-settings-content { display:block; max-width:1040px; }
.office-settings-content > .card { padding:28px; border-radius:12px; }
.office-settings-content form { max-width:760px; }
.office-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:18px; margin-bottom:24px; }
.office-search { display:flex; align-items:center; gap:8px; margin:0; min-width:200px; }
.office-search label { flex:1; margin:0; }
.office-search input { min-width:0; min-height:42px; }
.office-search button { min-height:42px; }
.office-filter-card { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.office-filter-form { display:flex; align-items:flex-end; flex-wrap:wrap; gap:12px; margin:0; }
.office-filter-form label { min-width:220px; margin:0; }
.office-filter-form > a { padding:10px 4px; font-size:12px; }
.office-filter-card > small { flex-shrink:0; }
.office-metric-link { color:var(--text); text-decoration:none; }
.office-metric-link:hover { border-color:var(--muted); text-decoration:none; }
.office-callout { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 24px; border:1px solid var(--line); border-radius:12px; margin-bottom:24px; background:#e9ecef; }
.office-callout strong { font-size:14px; }
.office-callout p { margin:4px 0 0; font-size:12px; color:var(--muted); }
.office-callout > .button { flex-shrink:0; font-size:12px; }
.office-alert:not([hidden]) { display:block; padding:16px 20px; border:1px solid #e0c0bd; background:#fff5f4; border-radius:10px; color:#843e39; margin-bottom:24px; }
.office-table { font-size:12px; }
.office-table th { padding:12px 10px; white-space:nowrap; }
.office-table td { padding:16px 10px; vertical-align:middle; }
.office-table td small { display:block; color:var(--muted); margin-top:4px; font-size:11px; }
.office-table td strong { font-weight:600; }
.office-date { white-space:nowrap; font-size:11px; }
.office-row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; font-size:11px; }
.office-row-actions button { font-size:11px; }
.job-message { min-width:180px; max-width:340px; overflow-wrap:anywhere; color:var(--muted); }
.office-status { display:inline-flex; align-items:center; white-space:nowrap; border-radius:5px; padding:4px 8px; background:#eef0f2; color:#626970; font-size:10px; font-weight:600; }
.office-status-running { background:#edf2f7; color:#386078; }
.office-status-failed { background:#f8edeb; color:#914a40; }
.office-status-done { background:#eef3ef; color:#42664c; }
.office-status-cancelled { background:#f1f1f2; color:#777b80; }
.office-caption { font-size:12px; margin-top:22px; }
.office-empty { padding:34px 12px; color:var(--muted); }
.office-empty h3 { color:var(--text); margin:0 0 8px; font-size:18px; }
.office-empty p { margin:0 0 12px; font-size:13px; }
.office-person-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin:0 0 24px; }
.office-person-heading h2 { margin:0; }
.office-person-heading p { font-size:13px; margin:6px 0 0; }
.office-person-link { display:inline-flex; align-items:center; gap:10px; font-weight:600; }
.office-person-link svg { width:15px; height:15px; color:var(--muted); }
.visitor-code { font-size:10px; color:var(--muted); }
.office-two-column { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; align-items:start; }
.storage-amount { font-size:15px; color:var(--muted); }
.storage-amount strong { font-size:26px; color:var(--text); font-weight:500; }
.office-storage > p { font-size:12px; margin-bottom:0; }
.storage-breakdown { margin:24px 0; }
.storage-breakdown h3 { font-size:13px; margin:0 0 12px; }
.storage-project-bar { display:block; width:100%; height:24px; border-radius:7px; overflow:hidden; background:#e9edf1; }
.storage-project-details { position:relative; margin:0 0 14px; padding-bottom:8px; }
.storage-project-segment { cursor:pointer; outline:none; -webkit-tap-highlight-color:transparent; }
.storage-project-segment:hover rect,.storage-project-segment:focus-visible rect { stroke:var(--text); stroke-width:2px; vector-effect:non-scaling-stroke; }
.storage-project-tooltip { position:absolute; z-index:20; top:calc(100% - 2px); left:0; width:max-content; max-width:min(320px,100%); padding:12px 15px; border-radius:8px; background:#282c32; color:#fff; box-shadow:0 6px 22px #18202c26; font-size:12px; overflow-wrap:anywhere; }
.storage-project-tooltip[hidden] { display:none; }
.storage-project-tooltip a,.storage-project-tooltip > strong { display:block; margin-bottom:5px; color:inherit; font-size:13px; font-weight:600; }
.storage-project-tooltip a { text-decoration:underline; text-underline-offset:3px; }
.storage-project-tooltip > span { display:block; color:#d4dae1; font-variant-numeric:tabular-nums; }
.storage-project-details.item-above { padding-top:8px; padding-bottom:0; }
.storage-project-details.item-above .storage-project-tooltip { top:auto; bottom:calc(100% - 2px); }
.storage-breakdown > p { margin:0; }
.office-trash { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; margin-top:20px; padding-top:20px; border-top:1px solid var(--line); }
.office-trash p { margin:4px 0 0; font-size:13px; }
.upload-detail { display:grid; grid-template-columns:100px minmax(0,1fr) auto; align-items:center; gap:10px; padding:12px 0; border-bottom:1px solid var(--line); font-size:12px; }
.upload-detail code { overflow-wrap:anywhere; }
.upload-detail button { font-size:10px; padding:5px 8px; }
.office-source-list { max-height:300px; overflow:auto; }
.office-source-list > div { padding:12px 0; border-bottom:1px solid var(--line); }
.office-source-list small { display:block; color:var(--muted); font-size:11px; }
.office-customer-search { margin:0 0 16px; max-width:360px; }
.office-customer-search input { font-size:12px; }
.office-permissions > summary { display:flex; align-items:center; gap:12px; margin:0; list-style:none; }
.office-permissions > summary::before { content:'›'; display:inline-block; font-size:20px; width:12px; }
.office-permissions[open] > summary::before { transform:rotate(90deg); }
.office-permissions > summary::-webkit-details-marker { display:none; }
.office-permissions-content { border-top:1px solid var(--line); padding-top:18px; margin-top:18px; font-size:13px; }
.office-permissions-content p:last-child { margin-bottom:0; }
.office-menu-toggle { display:none; }
.office-breadcrumb a { color:var(--muted); text-decoration:none; }
@media(max-width:1100px) {
 .office-two-column { grid-template-columns:minmax(0,1fr); gap:0; }
 .office-filter-card { align-items:flex-start; flex-direction:column; }
 .office-page-header { flex-wrap:wrap; }
 .office-page-header > .actions { padding-top:0; }
}
@media(max-width:800px) {
 .backoffice-header { position:relative; padding-bottom:16px; }
 .backoffice-header #office-navigation { display:none; flex-direction:column; overflow:visible; }
 .office-menu-open .backoffice-header #office-navigation { display:flex; }
 .backoffice-header #office-navigation a { font-size:14px; padding:12px; }
 .office-menu-toggle { display:flex; align-items:center; gap:8px; align-self:flex-start; padding:8px 12px; min-height:40px; color:#e6e7e9; border:1px solid #5d6267; background:transparent; font-size:12px; }
 .office-menu-toggle svg { width:17px; height:17px; }
 .office-page-header { gap:20px; margin-bottom:26px; }
 .office-page-header h1 { font-size:32px; }
 .office-section,.office-storage,.office-filter-card,.office-permissions,.office-settings-content > .card { padding:20px; }
 .office-section-header { flex-wrap:wrap; gap:14px; }
 .office-section-header h2 { font-size:20px; }
 .office-metrics { gap:10px; }
 .office-toolbar > .office-search { flex:1 1 100%; }
 .office-callout { align-items:flex-start; flex-direction:column; padding:20px; }
 .office-filter-form { width:100%; }
 .office-filter-form label { flex:1 1 100%; min-width:0; }
 .office-tabs { gap:3px; }
 .office-tabs a { padding:10px; font-size:11px; }
 .office-person-heading { flex-wrap:wrap; }
 .upload-detail { grid-template-columns:90px minmax(0,1fr) auto; gap:8px; }
}

/* Preserve native visibility for controls, table rows and failed thumbnails. */
.backoffice [hidden] { display:none !important; }

/* Backoffice groups keep their headings visible while their photos are folded. */
.day-heading h2, .folder-heading h3 { min-width: 0; }
.toggle-photo-group { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: var(--text); text-align: left; font: inherit; font-weight: inherit; }
.toggle-photo-group:hover { background: transparent; color: var(--accent); }
.toggle-photo-group span:last-child { overflow-wrap: anywhere; }
.group-chevron { flex: none; width: 18px; transition: transform .15s; }
.toggle-photo-group[aria-expanded="false"] .group-chevron { transform: rotate(-90deg); }
.folder-heading { grid-column: 1 / -1; border-bottom: 1px solid var(--line); margin-top: 8px; padding-left: 16px; }
.folder-heading h3 { margin: 0; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .group-chevron { transition: none; } }

/* Keep hidden images recognisable in the backoffice; controls stay readable. */
#photos .hidden-photo .image img,
.hidden-dropbox-photo .hidden-photo-thumb { opacity: .2; }
#photos .hidden-photo footer { flex-wrap: wrap; }
#photos .hidden-photo footer span { flex: 1; min-width: 90px; }
#photos .hidden-photo footer button { flex-shrink: 0; }
.hidden-dropbox-photo .hidden-photo-thumb { width: 90px; height: 68px; object-fit: contain; flex-shrink: 0; }
.hidden-dropbox-photo > div { flex: 1; }

#photos .hidden-photo .photo-select-control { top: 8px; bottom: auto; }
@media (max-width: 700px) {
  .selection-action-row :is(#selection-hide,#selection-show,#selection-delete) { flex: 1 1 auto; }
}

.gallery-auth-controls { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gallery-auth-controls:empty { display: none; }
@media (max-width: 700px) {
  header.client-header { flex-wrap: wrap; }
  header.client-header .brand { flex: 1 1 120px; }
  header.client-header nav { flex: 0 1 auto; max-width: 100%; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
}

/* Visibility actions belong to the image, including hidden images. */
#photos .photo-image-frame { position: relative; width: 100%; }
#photos .photo-visibility { top: auto; right: auto; bottom: 0; left: 0; width: 44px; }
#photos .photo:has(.photo-visibility) .photo-select-control { top: 0; bottom: auto; }
#photos .hidden-photo:is(:hover,:focus-within) .image img { opacity: .9; }

#photos.selection-mode .photo:has(.photo-visibility) > .photo-colors { left: 44px; max-width: calc(100% - 100px); }

/* Transfer log filters remain readable on small screens. */
.upload-log-filters { align-items:end; flex-wrap:wrap; }
.upload-log-filters label { display:flex; flex-direction:column; gap:6px; min-width:0; }
.upload-log-filters input, .upload-log-filters select { max-width:100%; }
#ftp-log { margin-top:24px; scroll-margin-top:24px; }
#ftp-log .office-date small, #ftp-log td small, #ftp-log .job-message a { display:block; margin-top:5px; }
@media (max-width:600px) { .upload-log-filters label { width:100%; } .upload-log-filters input, .upload-log-filters select { width:100%; } }
@media (max-width:600px) {
  #ftp-log table, #ftp-log tbody, #ftp-log tr, #ftp-log td { display:block; min-width:0; width:100%; }
  #ftp-log thead { display:none; }
  #ftp-log tbody tr { border-bottom:1px solid var(--line); padding:14px 0; }
  #ftp-log td { padding:5px 0; border:0; white-space:normal; overflow-wrap:anywhere; }
  #ftp-log td:nth-child(2), #ftp-log td:nth-child(3) { display:inline-block; width:auto; margin-right:12px; }
  #ftp-log td:last-child { color:var(--muted); font-size:.8rem; }
}
