* {
  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;
}
.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;
}
.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;
}
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;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.day-heading h2 {
  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;
}
/* 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}
}

.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 .heart {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 .heart::before {content:"";position:absolute;inset:10px;background:#ffffffe0;border-radius:14px;z-index:-1}
#photos .heart:hover::before {background:#fff}
#photos .heart svg {width:14px;height:14px;flex: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}
.gallery-selection-controls {position:sticky;top:12px;z-index:12;display:flex;justify-content:flex-end;align-items:center;gap:8px;min-height:44px;margin:12px 0;pointer-events:none}
.gallery-selection-controls:empty {display:none}
.gallery-selection-controls>* {pointer-events:auto}
.gallery-selection-controls .selection-toggle {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}
#photo-selection-status:not(:empty) {padding:7px 12px;border-radius:20px;background:var(--surface);font-size:11px;box-shadow:0 2px 10px #0000000d}
#photos:not(.selection-mode) .photo-select-control,#photos:not(.selection-mode) .select-day,.toolbar:not(.selection-active) #select-all {display:none}
#photos.selection-mode .photo-select-control {opacity:1;pointer-events:auto}
#photos.selection-mode .open-photo {cursor:copy}
.floating-download {position:fixed;z-index:20;bottom:calc(16px + env(safe-area-inset-bottom));right:24px;display:flex;align-items:center;gap:6px;padding:6px;border:1px solid var(--line);border-radius:30px;background:var(--surface);box-shadow:0 4px 20px #0002}
.floating-download button {min-height:44px;min-width:44px;border-radius:24px}
#floating-download-count {font-size:11px;margin-left:5px}
@media (hover:hover) and (pointer:fine) {
 #photos .heart {opacity:0;pointer-events:none}
 #photos .photo:is(:hover,:focus-within) .heart {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 .heart {opacity:1;pointer-events:auto}
 .floating-download {right:12px;max-width:calc(100% - 24px)}
 #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 .selection-toggle { 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; }

  .client-gallery-intro ~ #gallery-tools #clear-selection { display: none; }
}

/* 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; }
}

/* One compact gallery row; each icon reveals its own controls below it. */
#gallery-tools { display: contents; }
.gallery-tool-row {
  position: sticky;
  top: 12px;
  z-index: 12;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  margin: 6px 0 8px;
  padding: 6px 0;
  background: var(--bg);
}
.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 .selection-toggle.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}

/* Workspace settings: important controls first, processing is secondary. */
.settings-layout {display:grid;grid-template-columns:190px minmax(0,1fr);gap:28px;align-items:start;max-width:1120px}
.settings-nav {position:sticky;top:20px;display:flex;flex-direction:column;gap:4px;min-width:0;padding:6px 0}
.settings-nav a {display:block;min-height:44px;padding:12px 14px;border-radius:7px;color:var(--muted);font-size:13px;font-weight:600;text-decoration:none}
.settings-nav a:hover,.settings-nav a:focus-visible {background:var(--surface);color:var(--text)}
.settings-nav a:focus-visible {outline:2px solid var(--accent);outline-offset:2px}
.settings-nav a:first-child {color:var(--text)}
.settings-content {display:grid;gap:18px;min-width:0}
.settings-content > :is(section,details) {min-width:0;scroll-margin-top:24px}
.settings-content > :target {outline:2px solid var(--accent);outline-offset:3px}
.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}
.settings-source-list {max-height:260px;overflow:auto;padding-right:8px}
.settings-processing > summary {display:list-item;cursor:pointer;min-height:44px}
.settings-processing > summary span {display:inline-grid;gap:6px;vertical-align:middle;margin-left:8px}
.settings-processing > summary strong {font-size:17px}
.settings-processing > summary small {font-size:12px;color:var(--muted)}
.settings-processing-content {margin-top:20px;min-width:0}
.settings-processing-content > .actions {justify-content:flex-end;margin-bottom:12px}
.settings-job-table {max-height:360px;overflow:auto}
.settings-job-table th {position:sticky;top:0;background:var(--surface);z-index:1}
@media (max-width:800px) {
 .settings-layout {display:block}
 .settings-nav {top:8px;z-index:10;flex-direction:row;overflow-x:auto;max-width:100%;gap:4px;padding:6px;background:var(--bg);border:1px solid var(--line);border-radius:10px;scrollbar-width:thin}
 .settings-nav a {flex:none;white-space:nowrap;padding:12px}
 .settings-content {margin-top:18px}
 .settings-content > :is(section,details) {scroll-margin-top:86px}
 .settings-content .card {padding:22px}
}

/* 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 .settings-layout {max-width:none;grid-template-columns:155px minmax(0,1fr);gap:22px}
.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}
 .backoffice .settings-layout {display:block}
}
@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}}
