:root {
  --bg: #ffffff;
  --surface: #f1f3f4;
  --surface-2: #e8eaed;
  --text: #1f1f1f;
  --muted: #5f6368;
  --accent: #1a73e8;
  --accent-text: #ffffff;
  --danger: #d93025;
  --border: #dadce0;
  --tile: #e8eaed;
  --shadow: 0 4px 24px rgb(0 0 0 / 0.18);
  --gap: 3px;
  --tile-size: 180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #1e1f22;
    --surface-2: #2a2b2f;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --accent: #8ab4f8;
    --accent-text: #0b1b33;
    --danger: #f28b82;
    --border: #3c4043;
    --tile: #26272b;
    --shadow: 0 4px 24px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

svg { width: 24px; height: 24px; fill: currentColor; flex: none; }

button, input, .btn { font: inherit; color: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); }
.btn:focus-visible, .icon-btn:focus-visible, .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: inherit;
}
.icon-btn:hover { background: var(--surface); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small svg { width: 20px; height: 20px; }
.icon-btn.light { color: #fff; }
.icon-btn.light:hover { background: rgb(255 255 255 / 0.12); }

/* Sign in */

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.login-card {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.login-card img { align-self: center; }
.login-card h1 { margin: 0 0 12px; text-align: center; font-size: 22px; font-weight: 600; }
.login-card label { font-size: 13px; color: var(--muted); }
.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.login-card .btn { justify-content: center; margin-top: 6px; }
.error { color: var(--danger); margin: 0; min-height: 1.4em; font-size: 14px; }

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.volume-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 220px;
  margin-left: -8px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.volume-switch:hover, .volume-switch[aria-expanded="true"] { background: var(--surface); }
.volume-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.volume-switch svg { flex: none; width: 20px; height: 20px; fill: currentColor; }
.tabs { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.tab.active { background: var(--surface-2); color: var(--text); }
.actions { display: flex; align-items: center; gap: 4px; position: relative; }

.menu {
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 260px;
  padding: 8px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.menu-stats { margin: 0; padding: 8px 16px 12px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--border); white-space: pre-line; }
.menu-item { display: block; width: 100%; padding: 10px 16px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.menu-item:hover { background: var(--surface); }

@media (max-width: 940px) {
  /* Not room for the tabs beside everything else (tablets, narrow windows, phones): they
     get a row of their own. */
  .topbar { flex-wrap: wrap; gap: 4px 8px; padding-bottom: 4px; }
  .actions { margin-left: auto; }
  .tabs { order: 3; flex: 1 0 100%; }
}

@media (max-width: 560px) {
  /* Phones: the tabs spread across the width (and swipe sideways on the narrowest). The
     Trash is under Albums, so they all fit. */
  .tabs { justify-content: space-between; gap: 0; }
  .tab { padding: 6px 8px; white-space: nowrap; font-size: 14px; }
  .tab[data-view="trash"] { display: none; }
  #upload-button { padding: 8px; }
  #upload-button span { display: none; }
  /* The volume's name says more than "fotobank" does. */
  .has-volumes .brand span { display: none; }
  .volume-switch { margin-left: 0; max-width: 45vw; }
}

/* Timeline */

.timeline { padding: 16px 16px 24px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-size), 1fr));
  gap: var(--gap);
}

/* Phones: edge-to-edge grid, 3 or 4 across. */
@media (max-width: 560px) {
  :root { --gap: 2px; }
  .timeline { padding: 2px 0 24px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 440px) and (max-width: 560px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
.tile {
  position: relative;
  aspect-ratio: 1;
  background: var(--tile);
  overflow: hidden;
  cursor: pointer;
  border: 0;
  padding: 0;
  display: block;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.2s;
}
.tile img.loaded { opacity: 1; }

/* Thumbnails at their own shape (#grid-shape): in rows, each its width (app.js: shapeGrid), as
   tall as its width and shape make it; --row is how tall a row's wanted. */
.timeline.shaped .grid { display: flex; flex-wrap: wrap; --row: 200px; }
.timeline.shaped .tile { flex: none; width: var(--row); height: var(--row); aspect-ratio: auto; }
.timeline.shaped .grid .month { flex-basis: 100%; }
.timeline.shaped .tile .placeholder { position: absolute; inset: 0; }
#grid-shape .shape-on { display: none; }
#grid-shape[aria-pressed='true'] .shape-on { display: block; }
#grid-shape[aria-pressed='true'] .shape-off { display: none; }
@media (max-width: 560px) {
  .timeline.shaped .grid { --row: 120px; }
}
.tile .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px 1px 2px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}
.tile .badge svg { width: 18px; height: 18px; }
/* A favorite: a small star in the corner. */
.tile .tile-star {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 20px;
  height: 20px;
  color: #fff;
  filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.6));
  pointer-events: none;
}
/* Stars and flags (ratings.js): stars after any favorite star, the flag top right; rejected
   ones dimmed, as Lightroom's. */
.tile .tile-rating {
  position: absolute;
  left: 6px;
  bottom: 5px;
  color: #fff;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
  text-shadow: 0 0 3px rgb(0 0 0 / 0.8);
  pointer-events: none;
}
.tile:has(.tile-star) .tile-rating { left: 30px; }
.tile .tile-flag {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.5);
  color: #fff;
  pointer-events: none;
}
.tile .tile-flag svg { width: 16px; height: 16px; }
.tile .tile-flag.reject { background: rgb(217 48 37 / 0.85); }
.tile.rejected img { opacity: 0.35; }
.filter-wrap { position: relative; }
#filter-button.active { background: var(--accent); color: var(--accent-text); }
.filter-menu { left: 0; right: auto; width: max-content; max-width: calc(100vw - 24px); padding: 8px 14px 12px; z-index: 20; }
@media (max-width: 600px) { .filter-menu { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; max-width: none; } }
.filter-head { margin: 8px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-row .chip { padding: 5px 10px; font-size: 13px; }
.filter-row .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 16px 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
}
.filter-bar[hidden] { display: none; }
.viewer-marks { color: #fdd663; margin-left: 6px; }
.rate-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.rate-stars { display: inline-flex; margin-right: 2px; flex: none; }
.rate-star { display: grid; place-items: center; width: 27px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: #5f6368; cursor: pointer; }
.rate-star svg { width: 21px; height: 21px; }
.rate-star.on { color: #fdd663; }
.rate-star:hover { background: rgb(255 255 255 / 0.08); }
.rate-flag { display: inline-flex; flex: none; align-items: center; gap: 3px; padding: 4px 9px 4px 5px; white-space: nowrap; border: 1px solid #5f6368; border-radius: 14px; background: none; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.rate-flag svg { width: 16px; height: 16px; }
.rate-flag.on { background: #e8eaed; color: #202124; border-color: #e8eaed; }
.rate-star:focus-visible, .rate-flag:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 1px; }

/* Star buttons (viewer, selection bar): an outline, filled once starred. */
.star-toggle .star-on, .star-toggle[aria-pressed="true"] .star-off { display: none; }
.star-toggle[aria-pressed="true"] .star-on { display: block; }
#viewer-cover[aria-pressed="true"] { background: rgb(255 255 255 / 0.2); }
/* Archive and Locked folder buttons: in it already, the other way (unarchive, move out). */
.archive-toggle .archive-on, .archive-toggle[aria-pressed="true"] .archive-off,
.lock-toggle .lock-on, .lock-toggle[aria-pressed="true"] .lock-off { display: none; }
.archive-toggle[aria-pressed="true"] .archive-on, .lock-toggle[aria-pressed="true"] .lock-on { display: block; }
/* Favorites, Archive and the Locked folder aren't albums of their own: nothing to rename,
   move or delete. */
.album-bar.special #album-actions { display: none; }
.tile .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sentinel { height: 1px; }
.empty { text-align: center; color: var(--muted); padding: 64px 16px; margin: 0; }

.trash-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 16px 16px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
}
.trash-bar p { margin: 0; color: var(--muted); }

/* Drag & drop */

.dropzone {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(26 115 232 / 0.12);
  pointer-events: none;
}
.dropzone div {
  padding: 28px 40px;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  background: var(--bg);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
}

/* Upload panel */

.uploads {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  padding: 12px 16px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.uploads header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.uploads p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.progress-bar.indeterminate { width: 30%; animation: indeterminate 1.4s ease-in-out infinite; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .progress-bar.indeterminate { width: 100%; opacity: 0.5; animation: none; } }
.upload-errors { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--danger); max-height: 120px; overflow: auto; }
.upload-errors li { overflow-wrap: anywhere; }

/* Viewer */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  touch-action: pan-y pinch-zoom;
}
.viewer-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(rgb(0 0 0 / 0.6), transparent);
  transition: opacity 0.2s;
}
.viewer-title { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-actions { display: flex; gap: 2px; }
.viewer.chrome-hidden .viewer-top, .viewer.chrome-hidden .viewer-nav { opacity: 0; pointer-events: none; }
.viewer-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none; /* pinching and dragging the photo are the viewer's own (zoom.js) */
}
.viewer-stage.zoomed img { cursor: grab; will-change: transform; }
.viewer-stage.zoomed img:active { cursor: grabbing; }
.viewer-stage img, .viewer-stage video {
  max-width: 100%;
  max-height: 100dvh;
  object-fit: contain;
  display: block;
}
.viewer-stage img { width: 100%; height: 100%; }
.viewer-stage .viewer-placeholder { color: #bbb; text-align: center; padding: 16px; }
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 0.35);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}
.viewer-nav:hover { background: rgb(0 0 0 / 0.6); }
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }
.viewer-nav:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .viewer-nav { display: none; } }

.viewer-details {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: min(340px, 100vw);
  padding: 72px 24px 24px;
  padding-top: calc(72px + env(safe-area-inset-top));
  background: #1e1f22;
  color: #e8eaed;
  overflow: auto;
}
@media (min-width: 800px) {
  .viewer.details-open .viewer-stage { margin-right: 340px; }
  .viewer.details-open .viewer-nav.next { right: 352px; }
}
/* As Lightroom: with a photo open on a wide screen, the sidebar (albums and folders) stays on
   the left, the photo in the middle, and Info or Edit, when open, on the right. (The sidebar
   as it is: hidden with ☰, it's hidden here too.) */
@media (min-width: 1100px) {
  body.with-sidebar .viewer { left: var(--sidebar-w); border-left: 1px solid #2a2b2e; }
  body.with-sidebar:has(.viewer:not([hidden])) .sidebar {
    top: 0;
    z-index: 51;
    /* (dark, as the viewer and its panel are) */
    --bg: #1e1f22; --text: #e8eaed; --muted: #9aa0a6; --surface: #2a2b2e; --surface-2: #35363a; --border: #2a2b2e;
    color-scheme: dark;
  }
}
.viewer-details dl { margin: 0; display: grid; gap: 14px; }
.viewer-details dt { font-size: 12px; color: #9aa0a6; }
.viewer-details dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.viewer-details a { color: #8ab4f8; }
.viewer-details .keywords { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* The Edit panel (light.js): Light's sliders, on the right like Lightroom's. */
.viewer-stage canvas { display: block; width: 100%; height: 100%; max-height: 100dvh; object-fit: contain; }
.viewer-edit { padding-left: 20px; padding-right: 20px; }
.edit-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.edit-title { margin: 0; font-size: 16px; font-weight: 600; }
.edit-title { flex: 1; }
.edit-auto {
  margin-right: 4px;
  padding: 4px 12px;
  border: 1px solid #5f6368;
  border-radius: 6px;
  background: #2d2e31;
  color: #e8eaed;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.edit-auto:hover:not(:disabled) { background: #3c4043; }
.edit-auto:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }
.edit-auto:disabled { opacity: 0.4; cursor: default; }
.edit-crop { display: inline-flex; align-items: center; gap: 5px; padding-left: 8px; margin: 0 6px 0 10px; }
.edit-crop svg { width: 16px; height: 16px; fill: currentColor; }
.edit-section + .edit-section { margin-top: 4px; }
.edit-section { border-top: 1px solid #3c4043; padding-top: 8px; }
.edit-section-top { display: flex; align-items: center; gap: 4px; }
.edit-section-head {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.edit-section-head svg { width: 18px; height: 18px; fill: currentColor; transition: transform 0.15s; }
.edit-section-head[aria-expanded='false'] svg { transform: rotate(-90deg); }
.viewer-edit .icon-btn.small svg { width: 18px; height: 18px; }
.edit-reset { border: 0; background: none; color: #8ab4f8; font: inherit; font-size: 13px; cursor: pointer; padding: 6px; }
.edit-reset:hover { text-decoration: underline; }
.edit-section-body { display: grid; gap: 14px; padding: 8px 0 16px; }
.edit-row { display: grid; gap: 4px; }
.edit-row-top { display: flex; justify-content: space-between; font-size: 13px; }
.edit-label { color: #e8eaed; cursor: default; user-select: none; }
.edit-value { color: #9aa0a6; font-variant-numeric: tabular-nums; }
.edit-row input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --track: #5f6368;
}
.edit-row input[type='range']::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--track); }
.edit-row input[type='range']::-moz-range-track { height: 3px; border-radius: 2px; background: var(--track); }
.edit-row input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border: 2px solid #e8eaed;
  border-radius: 50%;
  background: #1e1f22;
}
.edit-row input[type='range']::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #e8eaed; border-radius: 50%; background: #1e1f22; }
.edit-row input[type='range']:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; border-radius: 4px; }
.edit-row input[type='range']:disabled { opacity: 0.4; cursor: default; }
/* Color's tracks show which way each goes, as Lightroom's do. */
.edit-row input.edit-temp { --track: linear-gradient(to right, #3d7bd9, #d9d9d9, #e0b636); }
.edit-row input.edit-tint { --track: linear-gradient(to right, #3fae4a, #d9d9d9, #c94fc9); }
.edit-row input.edit-vibrance, .edit-row input.edit-saturation {
  --track: linear-gradient(to right, #777, #c33, #cc3, #3c3, #3cc, #33c, #c3c);
}
.edit-status { margin: 0 0 8px; font-size: 12px; color: #9aa0a6; }
.edit-status:empty { display: none; }
.edit-status.error { color: #f28b82; font-size: 13px; }
.edit-opening { margin: 0 0 14px; }
.edit-opening + .edit-status, .edit-status + .edit-histogram, .edit-opening:not([hidden]) ~ .edit-histogram { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .edit-section-head svg { transition: none; } }
/* Tone Curve, Color Mixer, Color Grading and the white balance picker (light.js). */
.edit-tabs { display: flex; gap: 4px; }
.edit-tab {
  flex: 1;
  padding: 5px 4px;
  border: 1px solid #3c4043;
  border-radius: 6px;
  background: none;
  color: #bdc1c6;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.edit-tab[aria-pressed='true'] { background: #3c4043; color: #e8eaed; border-color: #5f6368; }
.edit-tab:focus-visible, .edit-picker:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }
.edit-curve { width: 100%; aspect-ratio: 1; touch-action: none; cursor: crosshair; background: #18191b; border-radius: 6px; }
.edit-hint { margin: 0; color: #9aa0a6; font-size: 12px; }
.edit-subhead { margin: 4px 0 -6px; color: #bdc1c6; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.edit-check { display: flex; align-items: center; gap: 8px; color: #e8eaed; font-size: 13px; cursor: pointer; }
.edit-check input { width: 16px; height: 16px; margin: 0; accent-color: #8ab4f8; }
.edit-uprights { display: grid; gap: 6px; }
.edit-uprights .edit-tabs .edit-tab { padding-inline: 4px; }
.edit-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  padding: 5px 10px 5px 6px;
  border: 1px solid #3c4043;
  border-radius: 6px;
  background: none;
  color: #e8eaed;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.edit-picker svg { width: 18px; height: 18px; fill: currentColor; }
.edit-picker[aria-pressed='true'] { background: #8ab4f8; color: #202124; border-color: #8ab4f8; }
.edit-canvas.picking { cursor: crosshair; }
/* Remove: the spots over the photo, the same size as it (as the canvas shows it). */
/* The photo being edited fills the stage (and, before and after, each half of it). */
.viewer-stage:has(> .edit-photo) { position: relative; }
.edit-photo { position: absolute; inset: 0; display: flex; gap: 8px; }
.edit-photo.stacked { flex-direction: column; }
.edit-side { position: relative; flex: 1; min-width: 0; min-height: 0; }
.edit-side > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.edit-side[hidden] { display: none; }
.edit-tag { position: absolute; bottom: 8px; left: 8px; padding: 2px 8px; border-radius: 10px; background: rgb(0 0 0 / 0.55); color: #e8eaed; font-size: 12px; pointer-events: none; }
.edit-tag[hidden] { display: none; }
/* The histogram, under the panel's title. */
.edit-histogram { display: grid; gap: 4px; margin-top: -6px; }
.edit-histogram-box { position: relative; border-radius: 6px; background: #121314; overflow: hidden; }
.edit-histogram-graph { display: block; width: 100%; height: 96px; cursor: ew-resize; touch-action: none; }
.edit-histogram-label { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); color: #bdc1c6; font-size: 11px; pointer-events: none; }
.edit-clip { position: absolute; top: 4px; width: 0; height: 0; padding: 0; border: 7px solid transparent; background: none; cursor: pointer; opacity: 0.35; }
.edit-clip-shadows { left: 4px; border-top-color: #5f8cff; border-left-color: #5f8cff; }
.edit-clip-highlights { right: 4px; border-top-color: #ff6b6b; border-right-color: #ff6b6b; }
.edit-clip.lit { opacity: 1; }
.edit-clip[aria-pressed='true'] { outline: 2px solid #e8eaed; outline-offset: 1px; }
.edit-camera, .edit-lens { margin: 0; color: #bdc1c6; font-size: 12px; text-align: center; }
.edit-lens { color: #9aa0a6; font-size: 11px; }
.edit-camera:empty, .edit-lens:empty { display: none; }
.edit-spots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.edit-spots.brushing { pointer-events: auto; cursor: none; touch-action: none; }
/* The brush's circle (light.js showRing): the size it paints, where the pointer is. */
.edit-brush-ring { pointer-events: none; }
.edit-brush-ring circle { fill: none; vector-effect: non-scaling-stroke; }
.edit-brush-ring-dark { stroke: rgb(0 0 0 / 0.55); stroke-width: 3px; }
.edit-brush-ring-light { stroke: rgb(255 255 255 / 0.95); stroke-width: 1.25px; }
.edit-spots path { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; }
/* A spot done shows nothing over what it's removed (light.js drawSpots): pointed at, faintly,
   to choose it; the one chosen, an outline (and its source's, fainter); still being painted or
   made, it shows. Transparent, not none: still there to click. */
.edit-spot { stroke: rgb(255 255 255 / 0); }
.edit-spot:hover { stroke: rgb(255 255 255 / 0.14); }
.edit-spot.chosen { stroke: rgb(255 255 255 / 0); cursor: pointer; }
.edit-spot.painting { stroke: rgb(138 180 248 / 0.3); }
/* Being made (Generative): it pulses till it's done, and the Remove section says so with a
   spinner (light.js showWorking). */
.edit-spot.making { animation: spot-making 1.1s ease-in-out infinite; }
@keyframes spot-making { 50% { stroke: rgb(138 180 248 / 0.6); } }
/* Generative's painted, waiting for Remove (light.js showPending). */
.edit-pending[hidden] { display: none; }
.edit-pending { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; color: #bdc1c6; }
.edit-pending-text { margin-right: auto; }
.edit-remove-go { background: #8ab4f8; border-color: #8ab4f8; color: #202124; }
.edit-remove-go:hover:not(:disabled) { background: #aecbfa; }
.edit-working[hidden] { display: none; }
.edit-working.error { color: #f28b82; }
.edit-working.error .edit-spinner { display: none; }
.edit-working { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: #8ab4f8; font-size: 13px; }
.edit-spinner { flex: none; width: 14px; height: 14px; border: 2px solid rgb(138 180 248 / 0.3); border-top-color: #8ab4f8; border-radius: 50%; animation: edit-spin 0.8s linear infinite; }
@keyframes edit-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .edit-spot.making, .edit-spinner { animation-duration: 3s; } }
.edit-spot-from { stroke: rgb(255 255 255 / 0); cursor: move; }
.edit-spot-outline { fill: #fff; pointer-events: none; filter: drop-shadow(0 0 1px rgb(0 0 0 / 0.8)); }
.edit-spot-outline.source { fill: rgb(255 255 255 / 0.7); }
.edit-spot-actions { display: flex; gap: 16px; align-items: center; }
/* Copy and paste, the groups to include, presets. */
.edit-copy { display: flex; gap: 16px; margin-top: -8px; }
.edit-copy .edit-reset:disabled, .edit-top .icon-btn:disabled { opacity: 0.35; cursor: default; }
.edit-chooser { display: grid; gap: 8px; padding: 12px; border: 1px solid #3c4043; border-radius: 8px; background: #18191b; }
.edit-chooser[hidden] { display: none; }
.edit-chooser-name { padding: 7px 9px; border: 1px solid #5f6368; border-radius: 6px; background: #202124; color: #e8eaed; font: inherit; font-size: 13px; }
.edit-presets { display: grid; gap: 2px; }
.edit-preset { display: flex; align-items: center; border-radius: 6px; }
.edit-preset:hover { background: #2a2b2e; }
.edit-preset-name { flex: 1; padding: 7px 8px; border: 0; background: none; color: #e8eaed; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.edit-preset-delete { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: #9aa0a6; font-size: 18px; line-height: 1; cursor: pointer; }
.edit-preset-delete:hover { color: #f28b82; }
.edit-spot-actions .edit-reset:disabled { opacity: 0.4; cursor: default; }
.edit-dot::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--dot); vertical-align: 1px; }
.edit-dot-red { --dot: #e53935; }
.edit-dot-orange { --dot: #fb8c00; }
.edit-dot-yellow { --dot: #fdd835; }
.edit-dot-green { --dot: #43a047; }
.edit-dot-aqua { --dot: #00acc1; }
.edit-dot-blue { --dot: #1e88e5; }
.edit-dot-purple { --dot: #8e24aa; }
.edit-dot-magenta { --dot: #d81b60; }
.edit-row input.edit-mix-sat { --track: linear-gradient(to right, #9e9e9e, var(--sat-end, #e53935)); }
.edit-row input.edit-mix-lum { --track: linear-gradient(to right, #202124, #9e9e9e, #ffffff); }
.edit-row input.edit-mix-hue { --track: linear-gradient(to right, #8e24aa, #e53935, #fb8c00, #fdd835, #43a047, #00acc1, #1e88e5, #8e24aa); }
.edit-row input.edit-swatch-orange { --sat-end: #fb8c00; }
.edit-row input.edit-swatch-yellow { --sat-end: #fdd835; }
.edit-row input.edit-swatch-green { --sat-end: #43a047; }
.edit-row input.edit-swatch-aqua { --sat-end: #00acc1; }
.edit-row input.edit-swatch-blue { --sat-end: #1e88e5; }
.edit-row input.edit-swatch-purple { --sat-end: #8e24aa; }
.edit-row input.edit-swatch-magenta { --sat-end: #d81b60; }
.edit-row input.edit-hue { --track: linear-gradient(to right, #e53935, #fdd835, #43a047, #00acc1, #1e88e5, #8e24aa, #e53935); }
/* On a phone, along the bottom, under the photo. */
@media (max-width: 799px) {
  .viewer-edit { top: auto; height: 45dvh; width: 100%; padding-top: 16px; border-radius: 12px 12px 0 0; }
  .viewer.editing .viewer-stage { margin-bottom: 45dvh; }
}
.keyword-list { display: contents; }
.keyword { display: inline-flex; align-items: center; gap: 2px; min-width: 0; padding: 1px 2px 1px 10px; border: 1px solid #5f6368; border-radius: 14px; }
.keyword a { text-decoration: none; }
.keyword a:hover { text-decoration: underline; }
.keyword-remove {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #9aa0a6;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.keyword-remove:hover, .keyword-remove:focus-visible { background: rgb(255 255 255 / 0.12); color: #e8eaed; }
.keyword-add { flex: 1 0 100%; }
.keyword-add input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #5f6368;
  border-radius: 8px;
  background: #2a2b2e;
  color: #e8eaed;
  font: inherit;
}
.keyword-add input::placeholder { color: #9aa0a6; }
.keyword-add input:focus { outline: none; border-color: #8ab4f8; }
/* A photo's notes, under its keywords (app.js: notesEditor). */
.notes { position: relative; }
.notes-box { display: block; box-sizing: border-box; width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid #5f6368; border-radius: 8px; background: #2a2b2e; color: #e8eaed; font: inherit; line-height: 1.4; resize: none; overflow-y: auto; }
.notes-box::placeholder { color: #9aa0a6; }
.notes-box:focus { outline: none; border-color: #8ab4f8; }
.notes-said { position: absolute; right: 8px; bottom: -18px; color: #9aa0a6; font-size: 12px; }
@media (pointer: coarse) {
  .keyword-remove { width: 32px; height: 32px; }
  .keyword-add input { font-size: 16px; } /* no zooming in on iPhone */
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 18px;
  border-radius: 8px;
  background: #323232;
  color: #fff;
  box-shadow: var(--shadow);
}
.toast button { border: 0; background: none; color: #8ab4f8; font-weight: 600; cursor: pointer; padding: 6px 8px; }

/* Setup and Settings */

.setup-card {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.setup-card > img { align-self: center; }
.setup-card h1 { margin: 0 0 4px; text-align: center; font-size: 22px; font-weight: 600; }
.setup-card h2, .settings h2 { margin: 18px 0 4px; font-size: 16px; font-weight: 600; }
.setup-card section, #setup-steps { display: flex; flex-direction: column; gap: 8px; }
.setup-card label, .stack label { font-size: 13px; color: var(--muted); }
.setup-card input, .stack input, .stack select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font: inherit;
  color: inherit;
}
.setup-card .btn.primary { justify-content: center; margin-top: 8px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.hint.center { text-align: center; }
.hint.ok { color: var(--accent); }
.hint.error { color: var(--danger); }
/* Choosing a name for the secure address: https:// [name] .fotobank.app */
.name-row { flex-wrap: nowrap; gap: 6px; margin: 8px 0 4px; }
.name-row .field { flex: 1 1 auto; min-width: 6em; max-width: 16em; }
.name-row span { color: var(--muted); white-space: nowrap; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

.locs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.loc {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button.loc:hover:not(:disabled) { background: var(--surface); }
.loc.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--surface); }
.loc:disabled { cursor: not-allowed; opacity: 0.6; }
.loc-icon { width: 28px; height: 28px; color: var(--muted); }
.loc.selected .loc-icon { color: var(--accent); }
.loc-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.loc-title { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loc-badge { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.loc-detail { font-size: 13px; color: var(--muted); }
.volume-tag { margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 500; vertical-align: 2px; }
div.loc { cursor: default; flex-wrap: wrap; }
.loc .loc-text { flex: 1; }
.loc .row { margin: 0; }
.loc-path { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.settings { max-width: 640px; margin: 0 auto; padding: 8px 16px 48px; }
.settings h1 { font-size: 24px; font-weight: 500; margin: 20px 0 4px; }
.settings-section { padding: 8px 0 20px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.settings-section:last-child { border-bottom: 0; }
.settings-section > div { display: flex; flex-direction: column; gap: 10px; }
.settings-section > div > p { margin: 0; }
/* Settings → Devices */
.pair { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pair > div { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.pair p { margin: 0; }
.qr { width: 180px; height: 180px; border-radius: 12px; border: 1px solid var(--border); background: #fff; flex: none; }
.pair-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.pair-other summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.pair-other[open] summary { margin-bottom: 12px; }
.code { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; white-space: nowrap; }
/* The secure address on its way: wait, and the code appears (settings.js). */
.pair-wait { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.pair-wait p { margin: 0; }
.pair-wait .edit-spinner { width: 20px; height: 20px; }
/* The address to type on another device, and its code: large and bold (settings.js pairLink). */
.pair-link { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.pair-url-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pair-url { flex: 1 1 auto; min-width: 0; font-size: 20px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; user-select: all; }
.pair-code { font-size: 20px; font-weight: 700; color: var(--text); }
.settings h3 { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.devices li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.devices li:first-child { border-top: 0; }
.devices .loc-badge { margin-left: 8px; }
.login-card .link.center { align-self: center; font-size: 14px; margin-top: 4px; }
.login-card .hint { text-align: center; line-height: 1.45; }
.code-input { font-size: 22px; text-align: center; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.stack .row { margin-top: 8px; }
.move { display: flex; flex-direction: column; gap: 8px; }
.move p { margin: 0; }

.problem-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin: 16px 16px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 12%, var(--bg));
  color: var(--text);
}
.problem-bar p { margin: 0; }
.problem-bar.notice { background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }

.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dialog-body { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.dialog-body h2 { margin: 0; font-size: 18px; font-weight: 600; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.folder-shortcuts { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font: inherit;
  font-size: 13px;
  color: inherit;
  cursor: pointer;
}
.chip .loc-icon { width: 18px; height: 18px; }
.folder-path { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.folder-list { list-style: none; margin: 0; padding: 0; max-height: 45dvh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.folder-list li + li { border-top: 1px solid var(--border); }
.folder-list .hint { padding: 12px; }
.folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.folder-item:hover { background: var(--surface); }
.folder-item .loc-icon { width: 20px; height: 20px; }

/* Selecting photos */

.tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.tile img { -webkit-user-drag: none; }
.tile-check {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgb(0 0 0 / 0.25);
  color: transparent;
  opacity: 0;
  transition: opacity 0.12s;
}
.tile-check svg { width: 18px; height: 18px; }
.tile:hover .tile-check, body.selecting .tile-check { opacity: 1; }
.tile.selected .tile-check { background: var(--accent); border-color: var(--accent); color: var(--accent-text); opacity: 1; }
.tile.selected img, .tile.selected .placeholder { transform: scale(0.88); border-radius: 6px; }
.tile img, .tile .placeholder { transition: opacity 0.2s, transform 0.12s; }
.tile.selected { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); }
@media (hover: none) { .tile:hover .tile-check { opacity: 0; } body.selecting .tile-check { opacity: 1; } }

.select-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 57px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.08);
}
.select-bar strong { font-weight: 600; white-space: nowrap; }
.select-actions { display: flex; gap: 8px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.select-actions .btn { white-space: nowrap; }
@media (max-width: 560px) {
  .select-bar { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .select-actions { gap: 4px; }
  .select-actions .btn { padding: 8px; }
  .select-actions .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Albums tab */

.albums { padding: 8px 16px 48px; }
.albums-head, .album-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
}
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; font-size: 18px; }
.crumb { padding: 4px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
a.crumb:hover { background: var(--surface); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 600; }
.crumb.drop { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); color: var(--text); }
.crumb-sep { color: var(--muted); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px 16px; }
.acard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  margin: -6px;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}
.acard:hover { background: var(--surface); }
.acard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acard.dragging { opacity: 0.4; }
.acard.drop { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); box-shadow: 0 0 0 2px var(--accent); }
.acard-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--tile);
  overflow: hidden;
}
.acard-cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s; }
.acard-cover img.loaded { opacity: 1; }
.acard-icon { width: 44%; height: 44%; color: var(--muted); }
.folder .acard-cover { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.folder .acard-icon { color: var(--accent); }
.acard-text { display: flex; flex-direction: column; min-width: 0; padding: 0 2px; }
.acard-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard-detail { font-size: 13px; color: var(--muted); }
.acard-menu { position: absolute; top: 12px; right: 12px; background: rgb(0 0 0 / 0.45); color: #fff; opacity: 0; }
.acard:hover .acard-menu, .acard-menu:focus-visible { opacity: 1; }
.acard-menu:hover { background: rgb(0 0 0 / 0.6); }
@media (hover: none) { .acard-menu { opacity: 1; } }
@media (max-width: 560px) {
  .albums { padding: 4px 12px 40px; }
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .crumbs { font-size: 16px; }
}

/* An album's (or a person's) name and buttons stay in sight under the top bar; scrolled
   down, they shrink to one row. */
.album-bar { position: sticky; top: var(--topbar-h, 57px); z-index: 9; padding: 4px 16px 0; background: var(--bg); }
.album-bar.stuck { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.album-bar.stuck .crumbs, .album-bar.stuck .album-title-row .hint, .album-bar.stuck .person-face { display: none; }
.album-bar.stuck .album-title-row { flex-wrap: nowrap; padding: 4px 0 0; }
.album-bar.stuck .album-title-row > :first-child { min-width: 0; }
.album-bar.stuck .album-title-row h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-bar.stuck .album-title-row .row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.album-bar.stuck .album-title-row .row::-webkit-scrollbar { display: none; }
.album-bar.stuck .album-title-row .btn { white-space: nowrap; }
.album-title-row { padding: 4px 0 0; }
.album-title-row h1 { margin: 0; font-size: 26px; font-weight: 600; overflow-wrap: anywhere; }
.album-title-row .hint { margin: 2px 0 0; }
.album-bar .crumbs { font-size: 14px; padding-top: 8px; }
@media (max-width: 560px) {
  .album-bar { padding: 4px 14px 0; }
  .album-title-row h1 { font-size: 22px; }
  .album-title-row .btn { padding: 6px 12px; font-size: 14px; }
  .album-bar.stuck .album-title-row h1 { font-size: 16px; }
}

/* Search: a bar under the top bar, with suggestions below the field */

.search-bar { position: relative; padding: 12px 16px 0; }
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  padding: 2px 6px 2px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.search-form:focus-within { border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search-icon { flex: none; width: 20px; height: 20px; fill: var(--muted); }
.search-form input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: none; font: inherit; color: inherit; }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-suggest {
  position: absolute;
  z-index: 30;
  left: 16px;
  right: 16px;
  max-width: 720px;
  margin: 4px 0 0;
  padding: 6px 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.search-option button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 16px;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.search-option button:hover, .search-option.highlighted button { background: var(--surface); }
.search-option-detail { flex: none; font-size: 13px; color: var(--muted); }
.search-understood { margin: 10px 4px 0; }
.search-chip strong { color: var(--text); font-weight: 600; }
.search-note { display: block; margin-top: 4px; }
@media (max-width: 560px) {
  .search-bar { padding: 8px 12px 0; }
  .search-suggest { left: 12px; right: 12px; }
  #search-button { width: 36px; height: 36px; }
}

/* Map tab: the map, with the photos in the part of the world shown below it */

.map-view { padding: 16px 16px 0; }
.map { height: min(56vh, 560px); border-radius: 14px; overflow: hidden; background: var(--tile); }
.map-note { margin: 8px 2px 0; font-size: 12px; }
.map-marker {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 10px;
  background: var(--tile);
  box-shadow: 0 1px 5px rgb(0 0 0 / 0.45);
  cursor: pointer;
}
.map-marker img { display: block; width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.map-marker:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-count {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}
@media (max-width: 560px) {
  .map-view { padding: 0; }
  .map { height: 46vh; border-radius: 0; }
  .map-note { margin: 6px 12px 0; }
  .map-marker { width: 44px; height: 44px; }
}

/* People tab */

.people-title { margin: 0; font-size: 18px; font-weight: 600; padding: 4px 8px; }
.people-status { display: flex; flex-direction: column; gap: 8px; max-width: 520px; margin: 0 0 20px; }
.people-status p { margin: 0; }
.people-status .btn { align-self: flex-start; }
.people-intro { max-width: 560px; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.people-intro h2 { margin: 0 0 8px; font-size: 20px; }
.people-intro p { margin: 0 0 12px; }
.people-grid, .people-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 20px 12px; }
#people-hidden-toggle { margin: 24px 0 12px -8px; }
.pcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.pcard:hover { background: var(--surface); }
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcard-face { width: 100%; max-width: 112px; aspect-ratio: 1; margin-bottom: 6px; border-radius: 50%; background: var(--tile); overflow: hidden; }
.pcard-face img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s; }
.pcard-face img.loaded { opacity: 1; }
.pcard-name { max-width: 100%; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-name.unnamed { color: var(--accent); font-weight: 400; }
.pcard-detail { font-size: 13px; color: var(--muted); }
.pcard.is-hidden .pcard-face { opacity: 0.5; }
.people-choices { max-height: 55dvh; overflow: auto; padding: 4px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.person-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.person-face { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--tile); }
#person-name.unnamed { color: var(--muted); font-weight: 500; }
@media (max-width: 560px) {
  .people-grid { grid-template-columns: repeat(3, 1fr); gap: 12px 4px; }
  .person-face { width: 52px; height: 52px; }
}
@media (max-width: 420px) {
  .tab { padding: 6px; }
}

.popover {
  position: absolute;
  z-index: 40;
  min-width: 180px;
  padding: 6px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.danger-text { color: var(--danger); }
.upload-menu, .volume-menu { min-width: 260px; }
.volume-menu .menu-item { display: flex; flex-direction: column; gap: 2px; padding-left: 40px; position: relative; }
.volume-menu .menu-item[aria-checked="true"]::before { content: "✓"; position: absolute; left: 16px; font-weight: 600; }
.volume-menu .hint { font-size: 12px; }
.volume-menu .manage { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; color: inherit; text-decoration: none; }
.upload-menu .menu-item { display: flex; flex-direction: column; gap: 2px; }
.upload-menu .hint { font-size: 12px; }

.dialog.small { width: min(420px, calc(100vw - 32px)); }
.share-about, .share-views { margin: 0; color: var(--muted); font-size: 14px; }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.dialog-body > input[type="text"], .dialog-body > input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.dialog-actions .spacer { flex: 1; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 50dvh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.pick-list li + li { border-top: 1px solid var(--border); }
.pick-list .hint { padding: 12px; }
.pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.pick-item:hover, .pick-item:focus-visible { background: var(--surface); }
.pick-icon { width: 20px; height: 20px; color: var(--muted); }
.pick-text { display: flex; flex-direction: column; min-width: 0; }
.pick-detail { font-size: 13px; color: var(--muted); }
.pick-item.depth-1 { padding-left: 32px; }
.pick-item.depth-2 { padding-left: 52px; }
.pick-item.depth-3 { padding-left: 72px; }
.pick-item.depth-4 { padding-left: 92px; }
.pick-item.depth-5 { padding-left: 112px; }
.pick-item.depth-6 { padding-left: 132px; }

.btn.link { border: 0; padding: 6px 8px; color: var(--accent); }

/* Duplicates (duplicates.js): sets of the same photo, and of similar shots. */
.dupes-tabs { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.dupes-tabs .chip { padding: 6px 14px; font-size: 14px; }
.dupes-tabs .chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dupes-summary { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 0 20px; }
.dupes-summary p { margin: 0; }
.dupes-list { display: flex; flex-direction: column; gap: 16px; }
.dupe-set { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.dupe-head { display: flex; align-items: baseline; gap: 10px; }
.dupe-title { font-weight: 600; }
.dupe-when { font-size: 13px; color: var(--muted); }
.dupe-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.dupe-photo { position: relative; flex: 0 0 auto; width: 172px; display: flex; flex-direction: column; gap: 4px; }
.dupe-pick {
  position: relative;
  width: 172px;
  height: 172px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.dupe-pick:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.dupe-pick img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s; }
.dupe-pick img.loaded { opacity: 1; }
.dupe-photo.going .dupe-pick { outline: none; }
.dupe-photo.going .dupe-pick img.loaded { opacity: 0.45; }
.dupe-mark {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
}
.dupe-mark svg { width: 18px; height: 18px; fill: currentColor; }
.dupe-photo.going .dupe-mark { background: rgb(0 0 0 / 0.6); }
.dupe-best { position: absolute; bottom: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 12px; font-weight: 600; }
.dupe-open {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 0.45);
  color: #fff;
  cursor: pointer;
}
.dupe-open:hover { background: rgb(0 0 0 / 0.65); }
.dupe-open svg { width: 18px; height: 18px; fill: currentColor; }
.dupe-info { font-size: 13px; }
.dupe-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dupes-more { align-self: center; margin: 20px auto; display: block; }
.dupes-photo { width: min(900px, calc(100vw - 32px)); }
.dupes-photo img { width: 100%; max-height: calc(100dvh - 180px); object-fit: contain; border-radius: 8px; background: var(--surface-2); }
.dupes-photo p { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .dupe-set { padding: 12px; margin: 0 -4px; }
  .dupe-photo, .dupe-pick { width: 140px; }
  .dupe-pick { height: 140px; }
}

/* Months in the grid, and the date scrubber (scrubber.js). The page keeps still by itself
   when newer photos go in above (app.js, loadNewer), so the browser mustn't move it too. */
.timeline { overflow-anchor: none; }
.grid .month { grid-column: 1 / -1; margin: 18px 2px 2px; font-size: 15px; font-weight: 600; }
/* A month's thumbnails while it's far from the screen (app.js: windowGrid): as tall as they were. */
.grid .month-spacer { grid-column: 1 / -1; }
.timeline.shaped .grid .month-spacer { flex-basis: 100%; }
.grid .month:first-child { margin-top: 0; }
@media (max-width: 560px) {
  .grid .month { margin: 14px 10px 4px; }
}
.scrubber {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 64px;
  z-index: 6;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.scrubber:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.scrubber-years { position: absolute; inset: 8px 0 8px 0; }
.scrubber-year { position: absolute; right: 12px; font-size: 12px; line-height: 1; color: var(--muted); }
.scrubber:hover .scrubber-year, .scrubber.dragging .scrubber-year { color: var(--text); }
.scrubber-handle {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
}
.scrubber-bubble {
  position: absolute;
  right: 60px;
  margin-top: 8px;
  transform: translateY(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow);
  pointer-events: none;
}
@media (min-width: 561px) {
  body.scrubbing .timeline { padding-right: 72px; }
}
/* Phones and tablets: a handle at the edge, there while scrolling; the years show while
   it's dragged. The rest of the bar lets taps through to the photos under it. */
@media (pointer: coarse) {
  .scrubber { width: 56px; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
  .scrubber.awake, .scrubber.dragging { opacity: 1; }
  .scrubber:not(.dragging) .scrubber-years { visibility: hidden; }
  .scrubber-year {
    right: 48px;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    color: var(--text);
    font-weight: 500;
    transform: translateY(-50%);
  }
  .scrubber-handle {
    right: 0;
    width: 40px;
    height: 48px;
    border-radius: 24px 0 0 24px;
    background: color-mix(in srgb, var(--accent) 92%, transparent);
    box-shadow: var(--shadow);
  }
  .scrubber-handle::before, .scrubber-handle::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 10px;
    height: 2px;
    border-radius: 1px;
    background: #fff;
  }
  .scrubber-handle::before { top: 19px; }
  .scrubber-handle::after { top: 27px; }
  .scrubber.awake .scrubber-handle, .scrubber.dragging .scrubber-handle { pointer-events: auto; }
  .scrubber-bubble { right: 52px; }
}

/* Locked folder: choosing its PIN and opening it (locked.js) */

.locked-screen { max-width: 480px; margin: 24px auto 0; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.locked-head { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 8px; text-align: center; }
.locked-head svg { width: 40px; height: 40px; color: var(--accent); }
.pin-form { display: flex; flex-direction: column; gap: 10px; }
.pin-form p { margin: 0; line-height: 1.45; }
.pin-form label { display: flex; flex-direction: column; gap: 4px; }
.pin-form .dialog-actions { align-items: center; }
.locked-cover .acard-icon { color: var(--accent); }

/* The viewer's menu: downloading, archiving, the Locked folder. */
.viewer-more { position: relative; }
.viewer-menu { top: 46px; min-width: 250px; z-index: 5; color: var(--text); }
.viewer-menu .menu-item { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.viewer-menu .menu-item svg { width: 20px; height: 20px; flex: none; fill: currentColor; }

/* Crop and rotate (crop.js) */
.crop {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
}
.crop[open] { display: flex; flex-direction: column; }
.crop::backdrop { background: #000; }
.crop-area { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.crop-photo { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-photo img { position: absolute; max-width: none; transform-origin: center; pointer-events: none; }
.crop-clip { position: absolute; inset: 0; overflow: hidden; background: #000; }
/* While straightening, a finer grid to line the horizon up with, as Lightroom's. */
.crop-grid {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  --line: rgb(255 255 255 / 0.3);
  background:
    repeating-linear-gradient(to right, transparent 0 calc(12.5% - 1px), var(--line) calc(12.5% - 1px) 12.5%),
    repeating-linear-gradient(to bottom, transparent 0 calc(12.5% - 1px), var(--line) calc(12.5% - 1px) 12.5%);
}
.crop-box.straightening .crop-grid { display: block; }
.crop-box.straightening .crop-thirds { display: none; }
.crop-straighten { display: flex; align-items: center; gap: 12px; color: #e8eaed; font-size: 14px; }
.crop-straighten input { flex: 1; min-width: 0; max-width: 420px; accent-color: #e8eaed; }
.crop-angle-value { min-width: 4.5em; color: #9aa0a6; font-variant-numeric: tabular-nums; }
.crop-box {
  position: absolute;
  outline: 1px solid rgb(255 255 255 / 0.9);
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.6);
  cursor: move;
}
.crop-thirds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --line: rgb(255 255 255 / 0.35);
  background:
    linear-gradient(to right, transparent 33.2%, var(--line) 33.2% 33.5%, transparent 33.5% 66.5%, var(--line) 66.5% 66.8%, transparent 66.8%),
    linear-gradient(to bottom, transparent 33.2%, var(--line) 33.2% 33.5%, transparent 33.5% 66.5%, var(--line) 66.5% 66.8%, transparent 66.8%);
}
.crop-handle { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; }
.crop-handle::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 3px rgb(0 0 0 / 0.6);
}
.crop-handle.n, .crop-handle.s { cursor: ns-resize; }
.crop-handle.e, .crop-handle.w { cursor: ew-resize; }
.crop-handle.nw, .crop-handle.se { cursor: nwse-resize; }
.crop-handle.ne, .crop-handle.sw { cursor: nesw-resize; }
.crop-handle.n::after, .crop-handle.s::after { inset: 13px 8px; border-radius: 3px; }
.crop-handle.e::after, .crop-handle.w::after { inset: 8px 13px; border-radius: 3px; }
.crop-handle.nw { left: 0; top: 0; }
.crop-handle.n { left: 50%; top: 0; }
.crop-handle.ne { left: 100%; top: 0; }
.crop-handle.e { left: 100%; top: 50%; }
.crop-handle.se { left: 100%; top: 100%; }
.crop-handle.s { left: 50%; top: 100%; }
.crop-handle.sw { left: 0; top: 100%; }
.crop-handle.w { left: 0; top: 50%; }
/* Keeping to a shape: only the corners. */
.crop-box.fixed .crop-handle.n, .crop-box.fixed .crop-handle.e, .crop-box.fixed .crop-handle.s, .crop-box.fixed .crop-handle.w { display: none; }
@media (pointer: coarse) {
  .crop-handle { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .crop-handle::after { inset: 15px; }
  .crop-handle.n::after, .crop-handle.s::after { inset: 19px 12px; }
  .crop-handle.e::after, .crop-handle.w::after { inset: 12px 19px; }
}
.crop-bar { display: grid; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #111; }
.crop-shapes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.crop-shapes::-webkit-scrollbar { display: none; }
.crop-shape {
  flex: none;
  padding: 6px 14px;
  border: 1px solid #5f6368;
  border-radius: 999px;
  background: none;
  color: #e8eaed;
  font: inherit;
  cursor: pointer;
}
.crop-shape[aria-pressed="true"] { background: #e8eaed; border-color: #e8eaed; color: #202124; }
.crop-group { display: flex; gap: 6px; flex: none; }
.crop-group + .crop-group { padding-left: 10px; margin-left: 4px; border-left: 1px solid #3c4043; }
.crop-for { align-self: center; padding-right: 2px; color: #9aa0a6; font-size: 13px; white-space: nowrap; }
.crop-way { display: inline-flex; align-items: center; gap: 6px; }
.crop-way svg { width: 16px; height: 16px; fill: currentColor; }
.crop-shape:disabled { opacity: 0.4; cursor: default; }
.crop-actions { display: flex; align-items: center; gap: 8px; }
.crop-actions .spacer { flex: 1; }
.crop-actions .btn { color: inherit; border-color: #5f6368; }
.crop-actions .btn.primary { color: var(--accent-text); border-color: var(--accent); }
.crop-actions .btn:disabled { opacity: 0.6; cursor: default; }
.crop-actions .icon-btn:hover { background: rgb(255 255 255 / 0.12); }
.crop-note { margin: 0; color: #f28b82; }
.crop-note:empty { display: none; }
/* In the viewer, as Lightroom's (crop.js open({ stage, panel })): the box over the photo in the
   middle, under the viewer's top bar; the controls at the top of the Edit panel, the panel's
   others (and the viewer's buttons) waiting till it's done. */
.crop-area.inline { position: absolute; top: 0; left: 0; bottom: 0; right: 340px; z-index: 3; padding-top: 56px; background: #000; }
/* The photo on its way (crop.js load): said so, and the shapes wait. */
.crop-area { position: relative; }
.crop-area.inline { position: absolute; }
.crop-area[data-loading='yes']::after { content: 'Loading the photo…'; position: absolute; inset: 0; display: grid; place-items: center; color: #9aa0a6; font-size: 15px; }
.crop-area[data-loading] .crop-photo { visibility: hidden; }
.crop-area[data-loading='failed']::after { content: 'Couldn’t load the photo'; position: absolute; inset: 0; display: grid; place-items: center; color: #f28b82; font-size: 15px; }
.crop-bar.loading .crop-shapes, .crop-bar.loading .crop-straighten, .crop-bar.loading .crop-actions > :not(.crop-cancel) { opacity: 0.4; pointer-events: none; }
.crop-retry { margin-left: 6px; padding: 2px 10px; color: inherit; border-color: #5f6368; }
.crop-bar.inline { gap: 12px; margin: 4px 0 16px; padding: 14px 0 16px; border-top: 1px solid #3c4043; border-bottom: 1px solid #3c4043; background: none; }
.crop-bar.inline .crop-shapes { flex-wrap: wrap; overflow: visible; gap: 8px; }
.crop-bar.inline .crop-group { flex: 1 1 100%; flex-wrap: wrap; }
.crop-bar.inline .crop-group + .crop-group { padding-left: 0; margin-left: 0; border-left: 0; }
.crop-bar.inline .crop-socials { padding-top: 8px; border-top: 1px solid #3c4043; }
.crop-bar.inline .crop-straighten { gap: 8px; }
.viewer-edit.cropping > :not(.edit-top, .edit-histogram, .crop-bar), .viewer-edit.cropping .edit-top > :not(.edit-title, .edit-crop) { opacity: 0.35; pointer-events: none; }
.viewer-edit.cropping .edit-crop { background: #e8eaed; border-color: #e8eaed; color: #202124; }
body.cropping .viewer-actions, body.cropping .viewer-nav { opacity: 0.35; pointer-events: none; }

/* Export is in the ⋮ menu on a phone, where the viewer's bar is full. */
@media (max-width: 560px) { #viewer-export { display: none; } }

/* Bought or free (settings.js) */
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 4px 0 12px; max-width: 420px; }
.meter span { display: block; height: 100%; background: var(--accent); }
.license-form input { flex: 1; min-width: 0; max-width: 320px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: inherit; font: inherit; }
.upload-full { color: inherit; }
a.btn { text-decoration: none; }

/* Memories: cards at the top of All, each a slideshow */

.memories { padding: 16px 16px 0; }
.memories-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.memories-row::-webkit-scrollbar { display: none; }
.memory-card {
  position: relative;
  flex: 0 0 auto;
  width: 150px;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--tile);
  cursor: pointer;
  scroll-snap-align: start;
  color: #fff;
  font: inherit;
  text-align: left;
}
.memory-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.memory-card:hover img { transform: scale(1.04); }
.memory-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.memory-card-text {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 28px 10px 10px;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.7));
}
.memory-card-text strong { font-size: 15px; line-height: 1.2; }
.memory-card-text span { font-size: 12px; opacity: 0.85; }
@media (max-width: 560px) {
  .memories { padding: 10px 10px 0; }
  .memory-card { width: 118px; border-radius: 12px; }
  .memory-card-text strong { font-size: 13px; }
}

.memory-player {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: #000;
  color: #fff;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}
.memory-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: pointer; }
.memory-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.6s;
  -webkit-user-drag: none;
}
.memory-photo.first { transition: none; }
.memory-photo.current { opacity: 1; animation: memory-drift 7s ease-out forwards; }
.memory-photo.paused { animation-play-state: paused; }
@keyframes memory-drift { from { transform: scale(1); } to { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) {
  .memory-photo { transition: none; }
  .memory-photo.current { animation: none; }
}
.memory-top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  padding: 8px 8px 24px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(rgb(0 0 0 / 0.65), transparent);
}
.memory-bars { display: flex; gap: 3px; padding: 4px 4px 8px; }
.memory-bar { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / 0.35); overflow: hidden; }
.memory-bar span { display: block; height: 100%; width: 0; background: #fff; }
.memory-head { position: relative; display: flex; align-items: center; gap: 2px; }
.memory-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 8px; }
.memory-heading strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memory-heading span { font-size: 13px; opacity: 0.8; }
.memory-menu { top: 44px; color: var(--text); }
.memory-menu .menu-item { color: inherit; }

/* Settings → Memories: what's hidden */
.hidden-list { list-style: none; margin: 4px 0 12px; padding: 0; max-width: 520px; }
.hidden-list li { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.hidden-list li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.memories-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.memories-form input, .memories-form select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: inherit; font: inherit; }
.hidden-list .btn { padding: 4px 12px; font-size: 13px; }

/* The viewer's info panel: the file name, changed by clicking it */
.file-name { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: text; overflow-wrap: anywhere; border-bottom: 1px dashed transparent; }
.file-name:hover, .file-name:focus-visible { border-bottom-color: currentColor; outline: none; }
.file-name-form { display: flex; align-items: center; gap: 2px; }
.file-name-form input { flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: inherit; font: inherit; }

/* The sidebar (sidebar.js): on wide screens, the library's lists and the albums, in place of
   the tabs. */
:root { --sidebar-w: 260px; }
.sidebar {
  position: fixed;
  top: var(--topbar-h, 57px);
  bottom: 0;
  left: 0;
  z-index: 8;
  width: var(--sidebar-w);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 8px 32px max(8px, env(safe-area-inset-left, 0px));
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
}
body.with-sidebar #main { padding-left: var(--sidebar-w); }
body.with-sidebar .topbar { margin-left: calc(-1 * var(--sidebar-w)); }
body.with-sidebar .tabs { display: none; }
.side-group { display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.side-group:last-child { border-bottom: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 4px 10px; }
.side-head a, .side-head > span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; }
.side-head a:hover, .side-head a.active { color: var(--text); }
.side-add { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.side-add:hover { background: var(--surface); color: var(--text); }
.side-add svg { width: 18px; height: 18px; fill: currentColor; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 4px 10px 4px calc(10px + var(--depth, 0) * 16px);
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.side-link:hover { background: var(--surface); }
.side-link.active { background: var(--surface-2); font-weight: 600; }
.side-link:focus-visible, .side-add:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.side-icon { flex: none; width: 20px; height: 20px; fill: var(--muted); }
.side-link.active .side-icon { fill: var(--text); }
.side-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side-count { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.side-cover { flex: none; width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--tile); }
.side-cover.empty { display: grid; place-items: center; }
.side-cover.empty .side-icon { width: 16px; height: 16px; }
.side-album { min-height: 42px; }
.side-row { position: relative; }
.side-row .side-folder { padding-left: calc(30px + var(--depth, 0) * 16px); }
.side-chevron {
  position: absolute;
  top: 50%;
  left: calc(4px + var(--depth, 0) * 16px);
  z-index: 1;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.side-chevron:hover { background: var(--surface-2); }
.side-chevron:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.side-chevron svg { width: 16px; height: 16px; fill: var(--muted); transition: transform 0.15s; }
.side-row.open .side-chevron svg { transform: rotate(90deg); }
.side-empty { margin: 4px 10px; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .side-chevron svg { transition: none; } }

/* Photos dragged onto a sidebar album (photo-drag.js). */
body.photo-dragging, body.photo-dragging * { cursor: grabbing !important; user-select: none; }
.side-link.drop-over { background: var(--accent); color: var(--accent-text); }
.side-link.drop-over .side-count { color: inherit; }
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--tile);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  opacity: 0.85;
}
.drag-ghost img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.drag-ghost.can-drop { opacity: 1; outline: 2px solid var(--accent); }
.drag-count {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

/* Paste edit: what to paste, the edit copied or a preset. */
.paste-choices { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.paste-choice { display: flex; align-items: center; gap: 10px; padding: 6px 4px; cursor: pointer; }
.paste-choice input { margin: 0; }

/* Export's options. */
#export-dialog { width: min(560px, calc(100vw - 32px)); }
.export-form fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.export-form legend, .export-row > label:first-child, .export-presets > label { font-size: 13px; font-weight: 600; color: var(--muted, #5f6368); }
.export-form fieldset label { display: flex; align-items: baseline; gap: 8px; }
.export-looks { display: grid; gap: 10px; padding: 12px; border-radius: 8px; background: var(--surface-2, rgb(127 127 127 / 0.08)); }
.export-looks[hidden] { display: none; }
.export-row, .export-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.export-row > label:first-child { min-width: 128px; }
.export-presets > label { min-width: auto; }
.export-row select, .export-row input[type=text], .export-row input[type=number], .export-presets select { padding: 6px 8px; border: 1px solid var(--border, #c4c7c5); border-radius: 6px; background: transparent; color: inherit; font: inherit; }
.export-row input[type=text] { flex: 1; min-width: 160px; }
.export-px input { width: 90px; }
.export-quality { display: flex; align-items: center; gap: 6px; }
.export-quality output { min-width: 2.5ch; }
.export-check { display: flex; align-items: center; gap: 8px; min-width: 128px; font-weight: 600; font-size: 13px; }
.btn.small { padding: 4px 10px; font-size: 13px; }

/* Masks: the list, a mask's own tools, and on the photo its handles and the red tint. */
.edit-mask-adds { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.edit-mask-pick { fill: #888; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6)); }
.edit-mask-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.edit-mask-colours { display: flex; gap: 4px; }
.edit-mask-colour { width: 20px; height: 20px; border: 2px solid #5f6368; border-radius: 50%; }
.edit-mask-select:disabled { opacity: 0.5; cursor: progress; }
.edit-mask-list { display: grid; gap: 2px; }
.edit-mask-item { display: flex; align-items: center; border-radius: 6px; }
.edit-mask-item:hover, .edit-mask-item.chosen { background: #2a2b2e; }
.edit-mask-item.chosen .edit-preset-name { color: #8ab4f8; }
.edit-mask-editor { display: grid; gap: 14px; padding-top: 4px; border-top: 1px solid #3c4043; }
.edit-mask-editor[hidden], .edit-mask-brush[hidden] { display: none; }
.edit-mask-options { display: flex; gap: 18px; }
.edit-mask-brush { display: grid; gap: 14px; }
.edit-masks, .edit-mask-tint { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.edit-mask-tint { object-fit: contain; }
.edit-mask-tint[hidden] { display: none; }
.edit-masks.active { pointer-events: auto; cursor: crosshair; touch-action: none; }
.edit-masks.active.brushing { cursor: none; } /* (its circle instead: masking.js showRing) */
.edit-mask-handle { fill: #fff; stroke: #1a73e8; stroke-width: 2; cursor: move; pointer-events: all; vector-effect: non-scaling-stroke; }
.edit-mask-line { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.edit-mask-line.middle { stroke-dasharray: 6 6; }
.edit-mask-paint { fill: none; stroke: rgba(255, 70, 70, 0.35); stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.edit-mask-paint.erasing { stroke: rgba(138, 180, 248, 0.35); }

/* Merge to Panorama */
#panorama-dialog { width: min(960px, calc(100vw - 32px)); }
.panorama-preview { display: grid; place-items: center; min-height: 200px; max-height: 50vh; border-radius: 8px; background: var(--surface); overflow: hidden; }
.panorama-preview img { display: block; max-width: 100%; max-height: 50vh; object-fit: contain; }
.panorama-preview.busy img { opacity: 0.5; }
.panorama-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.panorama-tabs { display: flex; gap: 4px; }
.panorama-tab { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.panorama-tab[aria-pressed='true'] { background: var(--surface-2); border-color: var(--muted); font-weight: 600; }
.panorama-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Trimming a video (trim.js): the video, and the trim bar under it. */
.trim-wrap { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 14px; width: 100%; height: 100%; padding: 12px 64px 16px; box-sizing: border-box; }
.trim-wrap video { flex: 1; min-height: 0; width: 100%; max-height: none; object-fit: contain; }
.trim-bar { display: grid; gap: 10px; color: #e8eaed; }
.trim-track { position: relative; height: 64px; touch-action: none; user-select: none; cursor: pointer; }
.trim-strip { position: absolute; inset: 0; overflow: hidden; border-radius: 8px; background: #202124; }
.trim-strip img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.trim-shade { position: absolute; top: 0; bottom: 0; background: rgb(0 0 0 / 0.62); pointer-events: none; }
.trim-before { left: 0; border-radius: 8px 0 0 8px; }
.trim-after { right: 0; border-radius: 0 8px 8px 0; }
.trim-window { position: absolute; top: -3px; bottom: -3px; box-sizing: border-box; border: 3px solid #fdd663; border-radius: 6px; pointer-events: none; }
.trim-handle { position: absolute; top: -3px; bottom: -3px; width: 16px; margin-left: -8px; border-radius: 5px; background: #fdd663; cursor: ew-resize; touch-action: none; }
.trim-handle::after { content: ''; position: absolute; left: 6px; top: 35%; bottom: 35%; width: 4px; border-radius: 2px; background: #3c3000; }
.trim-handle:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }
.trim-playhead { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 3px #000; pointer-events: none; }
.trim-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.trim-row .spacer { flex: 1; }
.trim-times { font-variant-numeric: tabular-nums; font-size: 14px; }
.trim-status { color: #bdc1c6; font-size: 13px; }
@media (max-width: 700px) {
  .trim-wrap { padding: 8px 12px 12px; }
  .trim-times { flex-basis: 100%; }
  .trim-row .spacer { display: none; }
  .trim-row .btn { flex: 1; justify-content: center; text-align: center; }
}
@media (pointer: coarse) { .trim-handle { width: 24px; margin-left: -12px; } .trim-handle::after { left: 10px; } }

/* Text (texting.js): the fonts, to show each by name in itself; on the photo, each text's outline. */
@font-face { font-family: 'fb-poppins'; src: url('/fonts/Poppins-SemiBold.ttf') format('truetype'); font-display: swap; }
.font-poppins { font-family: 'fb-poppins', sans-serif; }
@font-face { font-family: 'fb-serif'; src: url('/fonts/DMSerifDisplay-Regular.ttf') format('truetype'); font-display: swap; }
.font-serif { font-family: 'fb-serif', sans-serif; }
@font-face { font-family: 'fb-bebas'; src: url('/fonts/BebasNeue-Regular.ttf') format('truetype'); font-display: swap; }
.font-bebas { font-family: 'fb-bebas', sans-serif; }
@font-face { font-family: 'fb-anton'; src: url('/fonts/Anton-Regular.ttf') format('truetype'); font-display: swap; }
.font-anton { font-family: 'fb-anton', sans-serif; }
@font-face { font-family: 'fb-pacifico'; src: url('/fonts/Pacifico-Regular.ttf') format('truetype'); font-display: swap; }
.font-pacifico { font-family: 'fb-pacifico', sans-serif; }
@font-face { font-family: 'fb-marker'; src: url('/fonts/PermanentMarker-Regular.ttf') format('truetype'); font-display: swap; }
.font-marker { font-family: 'fb-marker', sans-serif; }
@font-face { font-family: 'fb-typewriter'; src: url('/fonts/SpecialElite-Regular.ttf') format('truetype'); font-display: swap; }
.font-typewriter { font-family: 'fb-typewriter', sans-serif; }
@font-face { font-family: 'fb-archivo'; src: url('/fonts/ArchivoBlack-Regular.ttf') format('truetype'); font-display: swap; }
.font-archivo { font-family: 'fb-archivo', sans-serif; }
@font-face { font-family: 'fb-lilita'; src: url('/fonts/LilitaOne-Regular.ttf') format('truetype'); font-display: swap; }
.font-lilita { font-family: 'fb-lilita', sans-serif; }
@font-face { font-family: 'fb-russo'; src: url('/fonts/RussoOne-Regular.ttf') format('truetype'); font-display: swap; }
.font-russo { font-family: 'fb-russo', sans-serif; }
@font-face { font-family: 'fb-staatliches'; src: url('/fonts/Staatliches-Regular.ttf') format('truetype'); font-display: swap; }
.font-staatliches { font-family: 'fb-staatliches', sans-serif; }
@font-face { font-family: 'fb-bungee'; src: url('/fonts/Bungee-Regular.ttf') format('truetype'); font-display: swap; }
.font-bungee { font-family: 'fb-bungee', sans-serif; }
@font-face { font-family: 'fb-abril'; src: url('/fonts/AbrilFatface-Regular.ttf') format('truetype'); font-display: swap; }
.font-abril { font-family: 'fb-abril', serif; }
@font-face { font-family: 'fb-slab'; src: url('/fonts/AlfaSlabOne-Regular.ttf') format('truetype'); font-display: swap; }
.font-slab { font-family: 'fb-slab', serif; }
@font-face { font-family: 'fb-lobster'; src: url('/fonts/Lobster-Regular.ttf') format('truetype'); font-display: swap; }
.font-lobster { font-family: 'fb-lobster', cursive; }
@font-face { font-family: 'fb-vibes'; src: url('/fonts/GreatVibes-Regular.ttf') format('truetype'); font-display: swap; }
.font-vibes { font-family: 'fb-vibes', cursive; }
@font-face { font-family: 'fb-satisfy'; src: url('/fonts/Satisfy-Regular.ttf') format('truetype'); font-display: swap; }
.font-satisfy { font-family: 'fb-satisfy', cursive; }
@font-face { font-family: 'fb-kaushan'; src: url('/fonts/KaushanScript-Regular.ttf') format('truetype'); font-display: swap; }
.font-kaushan { font-family: 'fb-kaushan', cursive; }
@font-face { font-family: 'fb-bangers'; src: url('/fonts/Bangers-Regular.ttf') format('truetype'); font-display: swap; }
.font-bangers { font-family: 'fb-bangers', sans-serif; }
@font-face { font-family: 'fb-luckiest'; src: url('/fonts/LuckiestGuy-Regular.ttf') format('truetype'); font-display: swap; }
.font-luckiest { font-family: 'fb-luckiest', sans-serif; }
@font-face { font-family: 'fb-brush'; src: url('/fonts/CaveatBrush-Regular.ttf') format('truetype'); font-display: swap; }
.font-brush { font-family: 'fb-brush', cursive; }
@font-face { font-family: 'fb-amatic'; src: url('/fonts/AmaticSC-Bold.ttf') format('truetype'); font-display: swap; }
.font-amatic { font-family: 'fb-amatic', sans-serif; }
@font-face { font-family: 'fb-neon'; src: url('/fonts/Monoton-Regular.ttf') format('truetype'); font-display: swap; }
.font-neon { font-family: 'fb-neon', sans-serif; }
@font-face { font-family: 'fb-pixel'; src: url('/fonts/PressStart2P-Regular.ttf') format('truetype'); font-display: swap; }
.font-pixel { font-family: 'fb-pixel', monospace; }
.edit-texts { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.edit-text-box { fill: transparent; stroke: transparent; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: all; cursor: move; }
.edit-text-box:hover { stroke: rgba(255, 255, 255, 0.6); stroke-dasharray: 5 4; }
.edit-text-box.chosen { stroke: #8ab4f8; stroke-dasharray: 6 4; }
.edit-texts .edit-mask-handle { pointer-events: all; }
.edit-text-words { width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px; padding: 8px; border: 1px solid #5f6368; border-radius: 8px; background: #202124; color: #e8eaed; font: inherit; font-size: 14px; }
.edit-text-words:focus { outline: 2px solid #8ab4f8; outline-offset: 1px; }
/* Text styles: each shown in itself (its colours set on it). */
.edit-text-styles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 4px 0 8px; }
.edit-text-style { padding: 6px 8px; border: 1px solid #3c4043; border-radius: 6px; background: #2b2c2f; font-size: 16px; text-align: center; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-text-style[aria-pressed='true'] { border-color: #8ab4f8; box-shadow: 0 0 0 1px #8ab4f8; }
.edit-text-style.font-pixel { font-size: 11px; }
.edit-text-fonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.edit-text-font { padding: 6px 8px; border: 1px solid #3c4043; border-radius: 6px; background: none; color: #e8eaed; font-size: 16px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-text-font[aria-pressed='true'] { background: #3c4043; border-color: #8ab4f8; }
/* The widest fonts, smaller, so their names fit. */
.edit-text-font.font-pixel { font-size: 11px; }
.edit-text-font.font-neon { font-size: 14px; }
/* Fonts of your own: each shown in itself, with a × to remove it; added from a file. */
.edit-text-myfonts { margin-top: 4px; }
.edit-text-myfont { display: flex; min-width: 0; }
.edit-text-myfont .edit-text-font { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.edit-text-removefont { padding: 0 8px; border: 1px solid #3c4043; border-left: none; border-radius: 0 6px 6px 0; background: none; color: #9aa0a6; font-size: 16px; cursor: pointer; }
.edit-text-removefont:hover { color: #e8eaed; background: #3c4043; }
.edit-text-fontadd { margin-top: 6px; }
.edit-text-fontstatus:empty { display: none; }
.edit-text-colours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.edit-text-swatch { width: 24px; height: 24px; padding: 0; border: 2px solid #5f6368; border-radius: 50%; cursor: pointer; }
.edit-text-swatch.chosen { border-color: #8ab4f8; box-shadow: 0 0 0 2px #202124, 0 0 0 4px #8ab4f8; }
/* No colour (no outline): a circle struck through. */
.edit-text-none { background: linear-gradient(135deg, transparent calc(50% - 1.5px), #f28b82 calc(50% - 1.5px), #f28b82 calc(50% + 1.5px), transparent calc(50% + 1.5px)), #202124; }
.edit-text-rowlabel { display: block; margin-top: 4px; }
.edit-text-picker { width: 32px; height: 26px; padding: 0; border: none; background: none; cursor: pointer; }
.edit-text-looks { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.edit-text-looks label { display: grid; gap: 4px; }
.edit-text-looks .edit-check { display: flex; }

/* Frame, and Shapes & stickers (decorating.js). */
.edit-frames { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.edit-frame { display: grid; gap: 3px; justify-items: center; padding: 4px 2px; border: 1px solid #3c4043; border-radius: 6px; background: none; color: #bdc1c6; font: inherit; font-size: 11px; cursor: pointer; }
.edit-frame[aria-pressed='true'] { background: #3c4043; border-color: #8ab4f8; color: #e8eaed; }
.edit-frame-picture { width: 48px; height: 32px; }
.edit-frame-photo { fill: #5f7a8a; }
.edit-frame-more { display: grid; gap: 10px; margin-top: 10px; }
.edit-graphic-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; margin-bottom: 8px; }
.edit-graphic-kind { display: grid; place-items: center; aspect-ratio: 1; padding: 4px; border: 1px solid #3c4043; border-radius: 6px; background: none; color: #e8eaed; cursor: pointer; }
.edit-graphic-kind:hover:not(:disabled) { background: #3c4043; }
.edit-graphic-kind:disabled { opacity: 0.4; cursor: default; }
/* Animated stickers: each button's picture moving as the sticker will (motion.js's loops). */
.edit-graphic-kind.animated .edit-graphic-picture { transform-origin: center; transform-box: fill-box; }
.loop-bounce .edit-graphic-picture { animation: loop-bounce 0.7s ease-in-out infinite; }
.loop-pulse .edit-graphic-picture { animation: loop-pulse 0.9s ease-in-out infinite; }
.loop-spin .edit-graphic-picture { animation: loop-spin 2s linear infinite; }
.loop-wobble .edit-graphic-picture { animation: loop-wobble 0.9s ease-in-out infinite; }
.loop-float .edit-graphic-picture { animation: loop-float 2.4s ease-in-out infinite; }
.loop-shake .edit-graphic-picture { animation: loop-shake 0.36s linear infinite; }
.loop-twinkle .edit-graphic-picture { animation: loop-twinkle 1.2s ease-in-out infinite; }
@keyframes loop-bounce { 50% { transform: translateY(-25%); } }
@keyframes loop-pulse { 20% { transform: scale(1.16); } 40% { transform: scale(1); } }
@keyframes loop-spin { to { transform: rotate(360deg); } }
@keyframes loop-wobble { 25% { transform: rotate(12deg); } 75% { transform: rotate(-12deg); } }
@keyframes loop-float { 25% { transform: translateY(12%); } 75% { transform: translateY(-12%); } }
@keyframes loop-shake { 25% { transform: translateX(5%) rotate(4deg); } 75% { transform: translateX(-5%) rotate(-4deg); } }
@keyframes loop-twinkle { 50% { transform: scale(0.85); opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .edit-graphic-kind.animated .edit-graphic-picture { animation: none; } }
.edit-graphic-picture { width: 26px; height: 26px; overflow: visible; }
.edit-graphic-shape { display: grid; gap: 10px; }
.edit-graphic-shape[hidden] { display: none; }
.edit-graphic-order { display: flex; flex-wrap: wrap; gap: 6px; }
.edit-graphics { pointer-events: none; }
.edit-mask-handle.side { cursor: ew-resize; }

/* Upload's review (review.js). */
.review-dialog { width: min(980px, calc(100vw - 32px)); }
.review-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.review-tools { display: flex; gap: 6px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; max-height: min(58vh, 640px); overflow-y: auto; padding: 2px; }
.review-tile { position: relative; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--surface); overflow: hidden; cursor: pointer; }
.review-tile[aria-pressed='true'] { border-color: var(--accent); }
.review-tile[aria-pressed='false'] .review-thumb { opacity: 0.35; filter: grayscale(0.6); }
.review-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.review-thumb { display: block; width: 100%; height: 100%; object-fit: cover; }
.review-kind { display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0.05em; }
.review-check { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; border: 2px solid #fff; border-radius: 50%; background: rgba(0, 0, 0, 0.35); box-shadow: 0 0 2px rgba(0, 0, 0, 0.6); }
.review-tile[aria-pressed='true'] .review-check { background: var(--accent); }
.review-tile[aria-pressed='true'] .review-check::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.review-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 11px; text-align: left; }
.review-label:empty { display: none; }

/* Collage (collaging.js). */
.collage-dialog { width: min(720px, calc(100vw - 32px)); }
.collage-stage { display: grid; place-items: center; padding: 8px; border-radius: 8px; background: var(--surface); }
.collage-stage canvas { display: block; max-width: 100%; max-height: 46vh; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3); cursor: grab; touch-action: none; }
.collage-stage canvas.dragging { cursor: grabbing; }
.collage-layouts { display: flex; flex-wrap: wrap; gap: 6px; }
.collage-layout { width: 48px; height: 48px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.collage-layout svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.collage-layout[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }
.collage-shapes { flex-wrap: wrap; }
.collage-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.collage-slider { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.collage-colours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.collage-swatch { width: 22px; height: 22px; padding: 0; border: 2px solid var(--border); border-radius: 50%; cursor: pointer; }
.collage-swatch.chosen { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.collage-picker { width: 30px; height: 24px; padding: 0; border: none; background: none; cursor: pointer; }

/* Filters (filters.js): the photo in each, in a strip. */
.edit-filters { display: grid; grid-auto-flow: column; grid-auto-columns: 76px; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.edit-filter { display: grid; gap: 4px; justify-items: center; padding: 0; border: none; background: none; color: #bdc1c6; font: inherit; font-size: 12px; cursor: pointer; }
.edit-filter-picture { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; background: #202124; }
.edit-filter[aria-pressed='true'] { color: #8ab4f8; }
.edit-filter[aria-pressed='true'] .edit-filter-picture { border-color: #8ab4f8; }
.edit-filter:focus-visible .edit-filter-picture { outline: 2px solid #8ab4f8; outline-offset: 2px; }

/* The Calendar (calendar.js): a year of months, each day with photos its best one. */
.calendar-view { padding: 8px 16px 48px; }
/* The Studio: its tools, as cards (studio.js); and the bar for choosing from the Bank for one. */
.studio { padding: 8px 16px 48px; max-width: 1100px; }
.studio-head h1 { margin: 0; font-size: 22px; font-weight: 500; }
.studio-head .hint { margin: 4px 0 20px; max-width: 640px; }
.studio-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.studio-tool { display: grid; grid-template-rows: auto auto 1fr; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.studio-tool:hover, .studio-tool:focus-visible { border-color: var(--accent); }
.studio-tool-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--accent-text); }
.studio-tool-icon svg { width: 24px; height: 24px; fill: currentColor; }
.studio-tool-name { font-size: 16px; font-weight: 600; }
.studio-tool-what { font-size: 13px; color: var(--muted); }
.studio-templates { margin-top: 32px; }
.studio-templates h2 { margin: 0; font-size: 17px; font-weight: 500; }
.studio-templates .hint { margin: 4px 0 12px; }
.studio-template-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.studio-template { display: grid; grid-template-rows: auto auto 1fr; gap: 2px; padding: 0 0 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.studio-template:hover, .studio-template:focus-visible { border-color: var(--accent); }
.studio-template-face { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; margin-bottom: 6px; }
.studio-template-shape { position: absolute; top: 8px; left: 8px; height: 18px; border: 2px solid rgb(255 255 255 / 85%); border-radius: 3px; }
.studio-template-shape.shape-9x16 { width: 10px; }
.studio-template-shape.shape-16x9 { width: 32px; }
.studio-template-shape.shape-1x1 { width: 18px; }
.studio-template-title { padding: 0 10px; color: #fff; font-size: 17px; font-weight: 700; text-align: center; text-shadow: 0 1px 4px rgb(0 0 0 / 45%); }
.studio-template-name, .studio-template-what { padding: 0 10px; }
.studio-template-name { font-weight: 600; }
.studio-template-what { font-size: 12px; color: var(--muted); }
.studio-projects { margin-top: 32px; }
.studio-projects h2 { margin: 0 0 12px; font-size: 17px; font-weight: 500; }
.studio-project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.studio-project { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.studio-project:hover, .studio-project:focus-within { border-color: var(--accent); }
.studio-project-open { display: grid; gap: 2px; width: 100%; padding: 0 0 10px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.studio-project-thumb { display: block; aspect-ratio: 16 / 10; margin-bottom: 6px; background: var(--border); }
.studio-project-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.studio-project-name, .studio-project-when { padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-project-name { font-weight: 600; }
.studio-project-when { font-size: 12px; color: var(--muted); }
.studio-project-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.studio-project-actions .icon-btn { width: 32px; height: 32px; border-radius: 50%; background: rgb(0 0 0 / 55%); color: #fff; }
.studio-project-actions .icon-btn svg { fill: currentColor; }
.pick-bar { z-index: 21; }
.pick-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-count { color: var(--muted); }
.pick-why { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .pick-why { display: none; }
  .pick-bar #pick-next { margin-left: auto; }
}
.calendar-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.calendar-head h1 { margin: 0; font-size: 22px; font-weight: 500; }
.calendar-head .hint { margin: 4px 0 0; }
.calendar-switch { display: flex; align-items: center; gap: 6px; }
.calendar-switch .btn { min-width: 36px; justify-content: center; font-size: 18px; padding: 4px 10px; }
.calendar-years { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.calendar-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 24px 20px; }
.calendar-month h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.calendar-month.quiet h2 { color: var(--muted); font-weight: 500; }
.calendar-month-count { color: var(--muted); font-size: 12px; font-weight: 400; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.calendar-weekday { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.calendar-day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--tile);
  color: inherit;
  text-decoration: none;
}
.calendar-day.no-photos { background: none; }
.calendar-day img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.calendar-num { position: absolute; left: 4px; top: 2px; font-size: 11px; line-height: 1.3; }
.calendar-day.no-photos .calendar-num { left: 0; right: 0; text-align: center; top: 50%; transform: translateY(-50%); color: var(--muted); }
a.calendar-day .calendar-num, .calendar-count { color: #fff; text-shadow: 0 0 3px rgb(0 0 0 / 0.8); font-weight: 600; }
.calendar-count { position: absolute; right: 3px; bottom: 1px; font-size: 10px; }
a.calendar-day:hover img, a.calendar-day:focus-visible img { filter: brightness(1.1); }
a.calendar-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* A day with an event: a bar along its foot. */
.calendar-day.has-event::after { content: ''; position: absolute; left: 3px; right: 3px; bottom: 0; height: 3px; border-radius: 2px; background: var(--accent); }
.calendar-events { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.calendar-events a { display: flex; gap: 8px; padding: 3px 6px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 13px; }
.calendar-events a:hover { background: var(--tile); }
.calendar-event-when { flex: none; min-width: 64px; color: var(--accent); font-weight: 500; }
.calendar-event-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-note { margin-top: 24px; }
.calendar-sources { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.calendar-source { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; }
.calendar-source .hint { margin: 2px 0 0; }
.calendar-error { color: #d93025; }
.calendar-add { flex-wrap: nowrap; }
.calendar-link { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.calendar-how { margin-top: 12px; }
.calendar-how ul { padding-left: 18px; }
.calendar-how li { margin: 4px 0; }

/* Share (sharing.js): what they'll look like, and the choices. */
.social-dialog { width: min(620px, calc(100vw - 32px)); }
.share-preview { min-height: 120px; display: flex; justify-content: safe center; align-items: center; padding: 12px; border-radius: 10px; background: var(--surface-2, rgb(127 127 127 / 0.08)); overflow-x: auto; }
.share-previews { display: flex; gap: 8px; align-items: center; }
.share-previews figure { position: relative; margin: 0; flex: none; }
.share-previews img { display: block; max-height: 200px; max-width: 100%; border-radius: 4px; background: var(--tile); box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); }
.share-row-preview img { max-height: 160px; max-width: 160px; }
.share-strip { gap: 3px; width: 100%; }
.share-strip figure { flex: 1 1 0; min-width: 0; }
.share-strip img { width: 100%; max-height: none; border-radius: 0; }
.share-grid { display: grid; grid-template-columns: repeat(3, 72px); gap: 2px; }
.share-grid img { width: 72px; height: auto; border-radius: 0; }
.share-previews figcaption { position: absolute; left: 4px; top: 3px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 11px; text-align: center; }
.share-options { display: grid; gap: 10px; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { min-width: 56px; font-size: 13px; font-weight: 600; color: var(--muted); }
.share-choices { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.share-choice { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: none; font-size: 13px; cursor: pointer; }
.share-choice[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }
.share-row select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.share-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.share-options .hint { margin: 0; }

/* Text and stickers on a video (videoediting.js): the video, what's on it, and its timeline. */
.vedit { display: flex; flex-direction: column; gap: 12px; width: 100%; height: 100%; padding: 12px 16px 14px; box-sizing: border-box; }
.vedit-side { flex: 1; min-height: 0; }
.vedit-side > video, .vedit-side > canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: contain; }
.vedit-side > canvas { pointer-events: none; }
.vedit-bar { display: grid; gap: 8px; color: #e8eaed; }
.vedit-controls { display: flex; align-items: center; gap: 10px; }
.vedit-time { font-variant-numeric: tabular-nums; font-size: 13px; color: #bdc1c6; }
.vedit-track { position: relative; display: grid; gap: 4px; touch-action: none; user-select: none; }
.vedit-frames { position: relative; height: 44px; cursor: pointer; }
.vedit-strip { position: absolute; inset: 0; }
.vedit-strip img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.vedit-lanes { display: grid; gap: 3px; max-height: 120px; overflow-y: auto; }
.vedit-lanes[hidden] { display: none; }
.vedit-lane { position: relative; height: 24px; border-radius: 6px; background: rgb(255 255 255 / 0.06); }
.vedit-piece { position: absolute; top: 0; bottom: 0; min-width: 12px; display: flex; align-items: center; box-sizing: border-box; border-radius: 6px; background: #5f6368; color: #fff; font-size: 12px; cursor: grab; touch-action: none; overflow: hidden; }
.vedit-text { background: #3367d6; }
.vedit-graphic { background: #b0459a; }
.vedit-piece.chosen { outline: 2px solid #fdd663; outline-offset: -2px; }
.vedit-label { flex: 1; min-width: 0; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.vedit-end { flex: none; align-self: stretch; width: 10px; background: rgb(255 255 255 / 0.35); cursor: ew-resize; }
.vedit-end:focus-visible { outline: 2px solid #8ab4f8; }
.vedit-playhead { top: -4px; bottom: -4px; }
.vedit-intro { margin: 0 0 4px; }
.video-wrap { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.video-wrap > video { width: 100%; height: 100%; max-height: 100dvh; }
.video-wrap > .video-on-top { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
/* Another shape (reframe.js): the video drawn on a canvas, its own bar under it. */
.video-wrap > video.video-source, .vedit-side > video.video-source { opacity: 0; pointer-events: none; }
.video-wrap > .video-picture { position: absolute; inset: 0 0 52px; width: 100%; height: calc(100% - 52px); object-fit: contain; cursor: pointer; }
.video-wrap.reframed > .video-on-top { inset: 0 0 52px; height: calc(100% - 52px); }
.video-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 12px; box-sizing: border-box; color: #e8eaed; }
.video-seek { flex: 1; min-width: 60px; accent-color: #8ab4f8; }
.vedit-look-row { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.vedit-look-row .vedit-way-label { min-width: 76px; }
.vedit-look-slider { flex: 1; min-width: 80px; accent-color: #fdd663; }
.vedit-look-value { min-width: 34px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: #bdc1c6; }
.vedit-pip-name { display: block; width: 100%; margin: 0 0 6px; padding: 6px 10px; border: 1px solid rgb(255 255 255 / 0.18); border-radius: 8px; background: none; color: inherit; text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.vedit-pip-name.chosen { border-color: #fdd663; color: #fdd663; }
.vedit-pip-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; margin: 0 0 8px; }
.vedit-pip-choice { padding: 0; border: 2px solid transparent; border-radius: 6px; background: #000; aspect-ratio: 1; overflow: hidden; cursor: pointer; }
.vedit-pip-choice:hover, .vedit-pip-choice:focus-visible { border-color: #fdd663; }
.vedit-pip-choice img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vedit-piece.vedit-pip { background: #00897b; }
.vedit-sfx-piece { background: #c5221f; cursor: pointer; }
.vedit-sfx-name { min-width: 64px; font-size: 13px; }
.vedit-place { flex: 1; min-width: 80px; max-width: 220px; accent-color: #fdd663; }
.vedit-controls { flex-wrap: wrap; }
.vedit-motion { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-left: auto; }
.vedit-motion[hidden] { display: none; }
.vedit-way { display: inline-flex; align-items: center; gap: 4px; }
.vedit-way-label { font-size: 12px; color: #bdc1c6; margin-right: 2px; }
.vedit-way-choice { padding: 3px 10px; border: 1px solid rgb(255 255 255 / 0.25); border-radius: 999px; background: none; color: #e8eaed; font-size: 12px; cursor: pointer; }
.vedit-way-choice[aria-checked="true"] { border-color: #fdd663; background: rgb(253 214 99 / 0.18); color: #fdd663; font-weight: 600; }
.vedit-captions .row { display: flex; flex-wrap: wrap; gap: 8px; }
.vedit-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 8px; }
.vedit-pick .vedit-way-label { min-width: 44px; }
.vedit-lines { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 4px; max-height: 280px; overflow-y: auto; }
.vedit-lines li { display: flex; align-items: center; gap: 6px; }
.vedit-line-when { flex: none; min-width: 50px; padding: 2px 4px; border: 0; border-radius: 4px; background: rgb(255 255 255 / 0.08); color: #bdc1c6; font: 12px/1.4 inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.vedit-line-text { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid rgb(255 255 255 / 0.18); border-radius: 6px; background: rgb(255 255 255 / 0.06); color: inherit; font: inherit; font-size: 13px; }
.vedit-say { margin: 6px 0 0; }
.vedit-caption-lane { background: rgb(255 255 255 / 0.04); }
.vedit-caption { background: #1e8e3e; cursor: pointer; }
.vedit-voice { background: #e37400; cursor: pointer; }
.vedit-audio-lane { background: rgb(26 115 232 / 8%); }
.vedit-keys-lane { height: 18px; background: none; }
.vedit-curve { display: block; width: 100%; max-width: 280px; aspect-ratio: 1; margin: 6px 0 10px; border-radius: 8px; background: rgb(255 255 255 / 0.04); touch-action: none; cursor: crosshair; }
.vedit-check { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 13px; cursor: pointer; }
.vedit-key { position: absolute; top: 0; transform: translateX(-50%); padding: 0 2px; border: 0; background: none; color: #fdd663; font-size: 14px; line-height: 18px; cursor: pointer; }
.vedit-key:hover, .vedit-key:focus-visible { color: #fff; }
.vedit-music { background: #188038; cursor: grab; }
.vedit-music:active { cursor: grabbing; }
.vedit-tracks .row { gap: 8px; flex-wrap: wrap; }
.vedit-track-song { min-width: 0; flex: 1 1 100%; width: 100%; max-width: 100%; text-overflow: ellipsis; }
.vedit-track-song, .vedit-captions-in { padding: 6px 8px; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 8px; background: rgb(255 255 255 / 0.06); color: inherit; font: inherit; }
.vedit-track-song option, .vedit-captions-in option { background: #202124; color: #e8eaed; }
.vedit-captions-make { align-items: center; gap: 10px; flex-wrap: wrap; }
.vedit-captions-make label { display: inline-flex; align-items: center; gap: 8px; }
.vedit-speech-text { width: 100%; box-sizing: border-box; margin: 4px 0 8px; padding: 8px; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 8px; background: rgb(255 255 255 / 0.06); color: inherit; font: inherit; resize: vertical; }
.vedit-speech .vedit-captions-in { max-width: 100%; }
.vedit-tracks .vedit-sfx-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vedit-tracks .vedit-look-slider { flex: 0 1 90px; min-width: 60px; }
.vedit-track-fade { flex: none; padding: 2px 8px; }
.vedit-caption .vedit-label { font-size: 11px; }
.vedit-lines li > .edit-preset-delete { flex: none; width: 24px; padding: 0; }
.vedit-lines { padding-right: 2px; }
.vedit-lines { grid-template-columns: minmax(0, 1fr); }

/* Make a movie (movies.js): the preview, the clips in order, the one chosen. */
.movie-dialog { width: min(980px, calc(100vw - 24px)); }
.movie-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.movie-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.movie-stage { display: grid; place-items: center; height: min(44vh, 420px); border-radius: 10px; background: #111; overflow: hidden; }
.movie-tile-join { position: absolute; right: -7px; top: 50%; transform: translateY(-50%); z-index: 1; color: #fdd663; font-size: 12px; text-shadow: 0 0 3px #000; pointer-events: none; }
.movie-join { margin-top: 4px; }
.movie-tile.freeze::before { content: '❄'; position: absolute; left: 4px; top: 2px; color: #fff; font-size: 12px; text-shadow: 0 0 3px #000; }
.movie-frame { position: relative; height: 100%; max-width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.movie-frame.blurred::before { content: ''; position: absolute; inset: -20px; background: var(--fill) center / cover no-repeat; filter: blur(18px) brightness(0.8); }
.movie-video, .movie-picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.movie-picture[hidden], .movie-video[hidden] { display: none; }
.movie-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.movie-shape-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.movie-choices { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.movie-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.movie-track { position: relative; padding: 6px 0; cursor: pointer; touch-action: none; user-select: none; }
.movie-strip { display: flex; gap: 3px; height: 56px; }
.movie-tile { position: relative; min-width: 28px; border-radius: 6px; background: #333 center / cover no-repeat; cursor: grab; outline-offset: 1px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15); }
.movie-tile.photo { box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.35); }
.movie-tile.chosen { outline: 3px solid #fdd663; }
.movie-tile.dragging { opacity: 0.6; cursor: grabbing; }
.movie-tile:focus-visible { outline: 3px solid var(--accent); }
.movie-tile-length { position: absolute; right: 3px; bottom: 2px; padding: 0 4px; border-radius: 4px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 10px; font-variant-numeric: tabular-nums; }
.movie-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.movie-clip { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, rgb(127 127 127 / 0.08)); }
.movie-clip .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.movie-range { display: grid; grid-template-columns: 70px 1fr 60px; align-items: center; gap: 8px; }
.movie-value { font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.movie-order { display: inline-flex; gap: 4px; }
.movie-status { margin: 0; }
@media (max-width: 600px) { .movie-stage { height: 34vh; } .movie-strip { height: 44px; } }
.movie-music { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, rgb(127 127 127 / 0.08)); }
.movie-music-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.movie-song { min-width: 0; max-width: 100%; flex: 1 1 180px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.movie-transitions { margin-top: -4px; }
.movie-transition-length { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.movie-transition-length[hidden] { display: none; }
.pip-blend { pointer-events: none; }
.anim-moving { overflow: hidden; background: #000; }
.share-choice[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }
.edit-text-dropper { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid #5f6368; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.edit-text-dropper svg { width: 16px; height: 16px; fill: currentColor; }
body.eyedropping, body.eyedropping * { cursor: crosshair !important; }
/* Remove background (videoediting.js): its backgrounds, each colour a swatch. */
.vedit-cutout .vedit-way-choice { display: inline-flex; align-items: center; gap: 6px; }
.vedit-cutout-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgb(255 255 255 / 45%); }
.vedit-cutout-swatch.swatch-000000 { background: #000; }
.vedit-cutout-swatch.swatch-ffffff { background: #fff; }
.vedit-cutout-swatch.swatch-00b140 { background: #00b140; }
.vedit-cutout-swatch.swatch-0047bb { background: #0047bb; }
.vedit-cutout-colour { width: 36px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
/* Auto highlights (app.js): how long, what shape. */
.highlights-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.highlights-label { min-width: 64px; font-size: 13px; font-weight: 600; color: var(--muted); }
.highlights-choices .chip[aria-checked='true'] { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
/* Motion tracking (videoediting.js): the layer a box is drawn on, over the video. */
.vedit-follow-layer { position: absolute; inset: 0; z-index: 5; cursor: crosshair; background: rgb(0 0 0 / 15%); touch-action: none; }
.vedit-follow-box { position: absolute; border: 2px solid #fdd663; box-shadow: 0 0 0 1px rgb(0 0 0 / 60%); border-radius: 4px; pointer-events: none; }
.vedit-away { visibility: hidden; }
/* Split screen (app.js): each layout drawn small on its chip. */
.split-picture { position: relative; display: inline-block; width: 22px; height: 34px; border-radius: 3px; background: var(--muted); vertical-align: middle; }
.split-cell { position: absolute; box-sizing: border-box; border: 1.5px solid var(--surface, #fff); background: currentColor; opacity: 0.85; }

/* The Edit panel's Basic or Advanced (light.js): Basic hides what's marked advanced. */
.edit-level { display: grid; gap: 6px; margin-bottom: 12px; }
.edit-level .edit-tabs { width: 100%; }
.edit-level .edit-tab { flex: 1; }
.edit-level-note { margin: 0; color: #9aa0a6; font-size: 13px; }
.edit-level-note .edit-reset { padding: 0; }
.viewer-edit.basic [data-advanced] { display: none !important; }

/* Settings → Updates: which version, and when it was last updated (settings.js). */
.update-version { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.update-version dt { color: var(--muted); }
.update-version dd { margin: 0; font-variant-numeric: tabular-nums; }
