:root {
  color-scheme: light;
  --ink: #36454f;
  --muted: #708090;
  --line: #d3d3d3;
  --paper: #ffffff;
  --wash: #f6f7f5;
  --panel: #eef1ed;
  --sage: #6d8473;
  --sage-dark: #43584b;
  --danger: #9b3f35;
  --shadow: 0 24px 78px rgba(54, 69, 79, 0.18);
  --control: #ffffff;
  --control-ink: #2f3d45;
  --grid-line: rgba(211, 211, 211, 0.2);
  --grid-line-strong: rgba(211, 211, 211, 0.24);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef3ef;
  --muted: #a8b5ad;
  --line: #41504a;
  --paper: #141a18;
  --wash: #0f1513;
  --panel: #1c2421;
  --sage: #8daf98;
  --sage-dark: #c3d5c8;
  --danger: #e18678;
  --shadow: 0 26px 84px rgba(0, 0, 0, 0.42);
  --control: #1a221f;
  --control-ink: #eef3ef;
  --grid-line: rgba(141, 175, 152, 0.08);
  --grid-line-strong: rgba(141, 175, 152, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--wash);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", "DejaVu Sans", sans-serif;
  background:
    linear-gradient(90deg, var(--grid-line-strong) 1px, transparent 1px),
    linear-gradient(180deg, var(--grid-line) 1px, transparent 1px),
    var(--wash);
  background-size: 64px 64px;
  transition: color 220ms ease, background-color 220ms ease;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  color: inherit;
}

.locked-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.unlock-panel {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(54, 69, 79, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(238, 241, 237, 0.98)),
    var(--panel);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 28px 90px rgba(54, 69, 79, 0.22);
}

.kicker {
  margin: 0 0 8px;
  color: var(--sage-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Libre Baskerville", "DejaVu Serif", serif;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.unlock-form {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.unlock-form label {
  color: var(--muted);
  font-weight: 700;
}

.unlock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.masked-field {
  position: relative;
  display: block;
  min-width: 0;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.masked-field input {
  position: absolute;
  inset: 0;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 0;
  color: transparent;
  background: transparent;
  caret-color: transparent;
}

.masked-input {
  font-size: 16px;
}

.mask-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: 2px;
  pointer-events: none;
  white-space: nowrap;
}

.masked-field:focus-within .mask-display::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 20px;
  margin-left: 3px;
  background: var(--ink);
  vertical-align: -3px;
  animation: caret-blink 1s steps(2, start) infinite;
}

.masked-field:focus-within {
  border-color: var(--sage);
  outline: 3px solid rgba(109, 132, 115, 0.18);
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.unlock-row button,
.focus-close {
  border: 1px solid var(--sage-dark);
  border-radius: 6px;
  color: #fff;
  background: var(--sage-dark);
  cursor: pointer;
}

.unlock-row button {
  height: 46px;
  padding: 0 18px;
}

.unlock-row button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.form-error,
.upload-status {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.gallery-shell {
  min-height: 100vh;
  padding: 30px clamp(28px, 5vw, 76px) 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 18px;
  background: linear-gradient(180deg, var(--wash) 78%, rgba(246, 247, 245, 0));
}

.topbar h1 {
  font-size: clamp(30px, 5vw, 52px);
}

.brand-block {
  min-width: 156px;
}

.top-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button,
.plus-button {
  flex: 0 0 auto;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(54, 69, 79, 0.16);
  border-radius: 999px;
  color: var(--control-ink);
  background: color-mix(in srgb, var(--control) 88%, transparent);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(54, 69, 79, 0.12);
  transition:
    transform 160ms ease,
    color 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--sage) 54%, transparent);
}

.icon-button svg,
.focus-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-track {
  display: grid;
  place-items: center;
  transition: transform 240ms ease, opacity 180ms ease;
}

.theme-toggle:active .theme-toggle-track {
  transform: rotate(36deg) scale(0.92);
}

.auto-shuffle-button {
  position: relative;
}

.auto-shuffle-button::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 2px var(--control);
  transition: background-color 180ms ease, transform 180ms ease;
}

.auto-shuffle-button[aria-pressed="true"] {
  color: #fff;
  border-color: color-mix(in srgb, var(--sage-dark) 74%, transparent);
  background: var(--sage-dark);
}

.auto-shuffle-button[aria-pressed="true"]::after {
  background: #bff0c8;
  transform: scale(1.2);
}

.upload-cluster {
  position: relative;
  padding-bottom: 22px;
}

.upload-cluster::after {
  content: "";
  position: absolute;
  top: 38px;
  right: 0;
  width: min(340px, calc(100vw - 32px));
  height: 24px;
}

.plus-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(54, 69, 79, 0.2);
  border-radius: 50%;
  color: var(--paper);
  font-size: 30px;
  line-height: 1;
  background: var(--ink);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(54, 69, 79, 0.18);
}

.mode-strip {
  position: relative;
  z-index: 25;
  width: min(680px, 100%);
  min-height: 48px;
  margin: 0 0 18px;
}

.tab-strip {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  box-shadow: 0 14px 36px rgba(54, 69, 79, 0.1);
}

.tab-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 190ms ease;
}

.tab-button[aria-selected="true"] {
  color: var(--paper);
}

.tab-button small {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  color: currentColor;
  background: rgba(112, 128, 144, 0.16);
}

.tab-indicator {
  position: absolute;
  left: 4px;
  top: 4px;
  height: 38px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 10px 26px rgba(54, 69, 79, 0.22);
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1), width 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.selection-bar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 14px;
  border: 1px solid color-mix(in srgb, var(--sage) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--sage) 10%, var(--paper));
  box-shadow: 0 14px 36px rgba(54, 69, 79, 0.1);
}

.mode-strip.is-animating .tab-strip,
.mode-strip.is-animating .selection-bar {
  animation: strip-in 220ms ease both;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.selection-actions button {
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 999px;
  background: var(--paper);
}

.selection-actions button {
  padding: 0 14px;
  cursor: pointer;
}

.move-menu {
  position: relative;
  z-index: 40;
}

.move-button {
  min-width: 112px;
  font-family: "Libre Baskerville", "DejaVu Serif", serif;
  font-size: 13px;
}

.move-button::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.move-menu.is-open .move-button::after {
  transform: translateY(2px) rotate(225deg);
}

.move-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  display: grid;
  min-width: 142px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 160ms ease, transform 160ms ease;
}

.move-menu.is-open .move-options {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.move-options button {
  justify-content: flex-start;
  width: 100%;
  border: 0;
  border-radius: 6px;
  font-family: "Libre Baskerville", "DejaVu Serif", serif;
  font-size: 13px;
  background: transparent;
  box-shadow: none;
}

.move-options button:hover,
.move-options button:focus-visible {
  background: color-mix(in srgb, var(--sage) 14%, transparent);
}

.bulk-delete {
  color: #fff;
  border-color: color-mix(in srgb, var(--danger) 78%, transparent) !important;
  background: var(--danger) !important;
}

.bulk-delete:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.toast-layer {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  z-index: 100;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  position: relative;
  overflow: hidden;
  padding: 12px 14px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  box-shadow: var(--shadow);
  animation: toast-in 220ms ease both;
}

.toast.is-exiting {
  animation: toast-out 220ms ease both;
}

.toast.is-exiting i {
  opacity: 0;
  animation: none;
  transform: scaleX(0);
}

.toast span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.toast i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--sage-dark);
  transform-origin: left;
  animation: toast-timer 2600ms linear forwards;
}

.upload-tray {
  position: absolute;
  top: 52px;
  right: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid rgba(54, 69, 79, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.upload-cluster:hover .upload-tray,
.upload-cluster:focus-within .upload-tray,
.upload-cluster.is-upload-open .upload-tray,
.is-file-dragging .upload-tray {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  place-items: center;
  min-height: 112px;
  overflow: hidden;
  border: 1px dashed rgba(112, 128, 144, 0.55);
  border-radius: 6px;
  color: var(--muted);
  background: #fbfbfa;
  cursor: pointer;
}

.drop-zone strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
}

.drop-zone span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.drop-zone.is-over {
  border-color: var(--sage);
  background: rgba(109, 132, 115, 0.09);
}

.is-file-dragging .drop-zone {
  border-color: var(--sage);
  background: rgba(109, 132, 115, 0.09);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-status {
  min-height: 0;
  margin-top: 0;
}

.upload-status:not(:empty) {
  min-height: 20px;
  margin-top: 8px;
}

.stage-panel {
  display: grid;
  gap: 8px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.stage-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #e6e8e4;
}

.stage-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stage-item button,
.tile-delete,
.focus-zoom,
.focus-nav,
.focus-close,
.stage-upload {
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.stage-item button svg,
.tile-delete svg,
.focus-zoom svg,
.focus-nav svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stage-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  color: #fff;
  background: rgba(54, 69, 79, 0.76);
  cursor: pointer;
  padding: 0;
}

.stage-remove::before,
.stage-remove::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.stage-remove::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.stage-remove::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.stage-upload {
  justify-self: end;
  width: 38px;
  height: 38px;
  border: 1px solid var(--sage-dark);
  color: #fff;
  background: var(--sage-dark);
  cursor: pointer;
}

.stage-panel:not(:empty) ~ .upload-status {
  margin-top: 0;
}

.gallery-wrap {
  position: relative;
}

.gallery-wrap.is-switching {
  animation: gallery-out 120ms ease forwards;
}

.gallery-grid {
  position: relative;
  width: 100%;
  min-height: 1px;
}

.gallery-wrap.is-tab-entering .gallery-grid {
  animation: gallery-in 260ms ease both;
}

.tile {
  position: absolute;
  display: block;
  min-width: 0;
  margin: 0 18px 18px 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #e6e8e4;
  box-shadow: 0 1px 0 rgba(54, 69, 79, 0.08);
  transition:
    box-shadow 180ms ease,
    opacity 180ms ease,
    filter 180ms ease;
}

.tile.is-dragging {
  z-index: 5;
  cursor: grabbing;
  opacity: 0.42;
}

.tile-placeholder {
  border: 1px dashed rgba(112, 128, 144, 0.56);
  background: rgba(109, 132, 115, 0.08);
  box-shadow: none;
}

.tile-placeholder:hover {
  box-shadow: none;
}

.tile-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.tile:hover {
  box-shadow: 0 16px 40px rgba(54, 69, 79, 0.16);
}

.tile-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  overflow: visible;
}

.is-select-mode .tile-open {
  cursor: copy;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tile-check {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background: rgba(35, 43, 47, 0.68);
  box-shadow: 0 10px 28px rgba(16, 24, 24, 0.34);
  opacity: 0;
  transform: scale(0.76);
  transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.tile-check::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 4px;
  width: 8px;
  height: 14px;
  border: solid #fff;
  border-width: 0 2.4px 2.4px 0;
  transform: rotate(45deg);
}

.is-select-mode .tile-check,
.tile.is-selected .tile-check {
  opacity: 1;
  transform: scale(1);
}

.tile.is-selected .tile-check {
  background: #1f7a4f;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.82),
    0 16px 34px rgba(16, 24, 24, 0.36);
}

.is-select-mode .tile:not(.is-selected) img {
  filter: saturate(0.52) brightness(0.58);
}

.is-select-mode .tile.is-selected {
  box-shadow:
    0 0 0 4px #1f7a4f,
    0 18px 48px rgba(31, 122, 79, 0.34);
}

.is-select-mode .tile.is-selected img {
  filter: saturate(1.08) brightness(1.06);
}

.is-select-mode .tile-delete {
  display: none;
}

.tile-delete {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  color: #fff;
  background: rgba(155, 63, 53, 0.9);
  box-shadow: 0 10px 28px rgba(54, 69, 79, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(12px, -18px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.ctrl-held .tile:hover .tile-delete,
.tile.show-delete .tile-delete,
.tile:focus-within .tile-delete:focus {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, 0);
}

.tile-ghost {
  opacity: 0.28;
}

.tile-chosen {
  box-shadow: 0 18px 50px rgba(54, 69, 79, 0.22);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 48vh;
  color: var(--muted);
  font-size: 17px;
}

@keyframes gallery-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gallery-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes strip-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-18px);
  }
}

@keyframes toast-timer {
  to {
    transform: scaleX(0);
  }
}

.focus-view {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 64px 22px 24px;
  background: rgba(54, 69, 79, 0.18);
  backdrop-filter: blur(2px);
  touch-action: manipulation;
}

.focus-modal {
  position: relative;
  display: grid;
  place-items: center;
  overflow: visible;
  max-width: min(88vw, 1180px);
  max-height: min(82vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.focus-view img {
  display: block;
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 0;
  box-shadow: none;
  transition: max-width 180ms ease, max-height 180ms ease;
}

.focus-view.is-full-zoom {
  padding: 0;
  background: rgba(16, 19, 18, 0.86);
  backdrop-filter: none;
}

.focus-view.is-full-zoom .focus-modal {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
}

.focus-view.is-full-zoom img {
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
}

.focus-zoom,
.focus-nav,
.focus-close {
  position: fixed;
  z-index: 60;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(30, 38, 39, 0.56);
  color: #fff;
  box-shadow: 0 10px 28px rgba(16, 24, 24, 0.16);
  opacity: 1;
  transition: opacity 180ms ease, background-color 160ms ease, border-color 160ms ease;
}

.focus-zoom:hover,
.focus-nav:hover,
.focus-close:hover,
.focus-zoom:focus-visible,
.focus-nav:focus-visible,
.focus-close:focus-visible {
  background: rgba(30, 38, 39, 0.76);
  border-color: rgba(255, 255, 255, 0.92);
}

.focus-view.is-full-zoom.is-hud-hidden .focus-zoom,
.focus-view.is-full-zoom.is-hud-hidden .focus-nav,
.focus-view.is-full-zoom.is-hud-hidden .focus-close {
  opacity: 0;
  pointer-events: none;
}

.focus-zoom {
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
}

.focus-close {
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  font-size: 24px;
  line-height: 1;
}

.focus-nav {
  top: 50%;
  width: 48px;
  height: 64px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.focus-nav svg {
  width: 26px;
  height: 26px;
}

.focus-prev {
  left: max(18px, env(safe-area-inset-left));
}

.focus-next {
  right: max(18px, env(safe-area-inset-right));
}

.focus-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.focus-view.slide-next img {
  animation: focus-next 240ms ease both;
}

.focus-view.slide-prev img {
  animation: focus-prev 240ms ease both;
}

@keyframes focus-next {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes focus-prev {
  from {
    opacity: 0;
    transform: translateX(-34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 640px) {
  .unlock-panel {
    padding: 24px;
  }

  .unlock-row {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    min-height: 1px;
  }

  .tile {
    margin: 0 12px 12px 0;
  }

  .gallery-shell {
    padding: 24px 18px 42px;
  }

  .topbar {
    align-items: flex-start;
    position: relative;
    flex-direction: column;
    gap: 14px;
  }

  .top-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .mode-strip {
    width: 100%;
    min-height: 96px;
  }

  .mode-strip.is-tabs {
    min-height: 48px;
  }

  .tab-strip {
    width: 100%;
  }

  .tab-button {
    gap: 5px;
    padding: 0 8px;
    font-size: 14px;
  }

  .tab-button small {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
  }

  .selection-bar {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 14px;
  }

  .selection-actions {
    width: 100%;
  }

  .move-menu {
    flex: 1 1 132px;
  }

  .move-button,
  .selection-actions button {
    width: 100%;
  }

  .focus-nav {
    width: 44px;
    height: 54px;
  }

  .focus-prev {
    left: max(8px, env(safe-area-inset-left));
  }

  .focus-next {
    right: max(8px, env(safe-area-inset-right));
  }
}
