/* Winnow. Same family as sdev.in: the design tokens below are sdev's
   (web/src/styles/global.css), Inter, two weights (400 / 600).
   Light and dark switch on <html data-theme="light|dark">. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2");
}

:root {
  color-scheme: light;
  /* sdev tokens */
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --fg: #0f172a;
  --muted: #5b6577;
  --border: #e3e7ee;
  --accent: #0d9488;
  --accent-fg: #ffffff;
  --ring: #0ea5a0;
  --brand-wordmark: #206478;
  --brand-teal: #21dbaa;
  --gold: #f5c518;
  /* Winnow additions */
  --accent-ink: #0f766e; /* accent used as small text on light surfaces (AA) */
  --bad: #dc2626;
  --warn: #b45309;
  --stage: #e9edf3; /* behind photos in quick look and compare */
  --scrim: rgba(15, 23, 42, 0.38);
  --shadow: 0 16px 44px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.05);
  --font: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* names used through this stylesheet */
  --panel: var(--surface);
  --panel2: var(--surface-2);
  --raise: var(--surface);
  --hover: color-mix(in oklab, var(--fg) 5%, var(--surface-2));
  --bd: var(--border);
  --bd2: color-mix(in oklab, var(--fg) 15%, var(--surface));
  --tx: var(--fg);
  --mut: var(--muted);
  --faint: color-mix(in oklab, var(--muted) 85%, var(--surface));
  --acc: var(--accent);
  --acc-tx: var(--accent-fg);
  --acc-ink: var(--accent-ink);
  --acc-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --bad-soft: color-mix(in oklab, var(--bad) 12%, transparent);
  --star: var(--gold);
  --cursor: var(--fg);
  --tile: var(--surface-2);
  --r: 10px;
  --r-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f19;
  --surface: #111827;
  --surface-2: #182136;
  --fg: #e6e9ef;
  --muted: #98a2b3;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #21dbaa;
  --accent-fg: #06251c;
  --ring: #21dbaa;
  --brand-wordmark: #fafafa;
  --accent-ink: #21dbaa;
  --bad: #f87171;
  --warn: #fbbf24;
  --stage: #070a12;
  --scrim: rgba(2, 6, 15, 0.62);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --bd2: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  height: 100%;
}
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--tx);
  font: 400 14px/1.45 var(--font);
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
[hidden] {
  display: none !important;
}
b,
strong,
h1,
h2,
h3 {
  font-weight: 600;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
::selection {
  background: color-mix(in oklab, var(--accent) 35%, transparent);
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.muted {
  color: var(--mut);
}
.sp {
  flex: 1;
}
.ic {
  flex: none;
  display: block;
}
[data-icon] {
  display: inline-flex;
}
kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border: 1px solid var(--bd2);
  border-bottom-width: 2px;
  border-radius: 6px;
  font: 400 11px/16px var(--font);
  color: var(--mut);
  text-align: center;
  background: var(--surface);
}
.logo rect:first-child {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--tx);
  font-size: 13px;
  white-space: nowrap;
  user-select: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    filter 0.15s;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn .ic {
  opacity: 0.85;
}
.btn-sm {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}
.btn-lg {
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
  border-radius: 10px;
}
.btn-primary {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-tx);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--acc);
  filter: brightness(1.1);
}
.btn-primary:active {
  filter: brightness(0.95);
}
.btn-primary .ic {
  opacity: 1;
}
.btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
  font-weight: 600;
}
.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--mut);
}
.btn-quiet:hover {
  color: var(--tx);
  background: var(--panel2);
}
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--acc-ink);
  font-size: inherit;
  height: auto;
}
.btn-link:hover {
  text-decoration: underline;
  background: none;
}
.btn.tog[aria-pressed="true"] {
  background: var(--acc-soft);
  border-color: color-mix(in srgb, var(--acc) 45%, transparent);
  color: var(--tx);
}
.btn.keep .ic {
  color: var(--acc-ink);
  opacity: 1;
}
.btn.skip .ic {
  color: var(--bad);
  opacity: 1;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--mut);
  flex: none;
}
.icon-btn:hover {
  background: var(--panel2);
  color: var(--tx);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--bd);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
}
.chip:hover {
  background: var(--hover);
}
.chip.pro {
  border-color: color-mix(in srgb, var(--acc) 55%, transparent);
  color: var(--acc-ink);
  background: var(--acc-soft);
}
.chip.warn {
  border-color: color-mix(in srgb, var(--warn) 60%, transparent);
  color: var(--warn);
}

/* "Pro" tag on locked controls */
.pro-tag {
  display: none;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 4px;
  background: var(--acc-soft);
  color: var(--acc-ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.locked .pro-tag,
.menu-item.locked .pro-tag,
.pro-tag.always {
  display: inline-flex;
}
.locked {
  color: var(--mut);
}

/* inputs */
select {
  height: 32px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background-color: var(--surface);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-size: 15px;
  background-repeat: no-repeat;
}
select:hover {
  background-color: var(--surface-2);
}
select:focus {
  border-color: var(--acc);
  outline: none;
}
input[type="text"],
input[type="search"] {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--panel2);
  font-size: 13px;
  outline: none;
  min-width: 0;
}
input[type="text"]:focus,
input[type="search"]:focus {
  border-color: var(--acc);
}
input[type="range"] {
  accent-color: var(--acc);
}

/* ---------- welcome ---------- */
.welcome {
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(56px + var(--safe-t)) 20px calc(28px + var(--safe-b));
}
.welcome-in {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
}
.welcome-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}
.welcome-brand .logo {
  filter: drop-shadow(0 12px 28px color-mix(in oklab, var(--brand-teal) 22%, transparent));
}
.welcome h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.welcome .lead {
  margin: -6px 0 0;
  color: var(--mut);
  font-size: 15px;
  text-align: center;
}
.open-btn {
  min-width: 260px;
  height: 50px;
  font-size: 16px;
  border-radius: 12px;
  gap: 10px;
}
.open-btn kbd {
  background: color-mix(in oklab, var(--accent-fg) 14%, transparent);
  border-color: color-mix(in oklab, var(--accent-fg) 30%, transparent);
  color: var(--acc-tx);
}
.drop-line {
  margin: 14px 0 0;
  color: var(--mut);
  font-size: 13px;
}
.mobile-howto {
  width: 100%;
  padding: 18px 18px 16px;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  background: var(--panel);
  text-align: left;
}
.mobile-howto ol {
  margin: 0 0 14px;
  padding-left: 20px;
}
.mobile-howto li {
  margin: 4px 0;
}
.mobile-howto .where-box {
  display: block;
  margin: 6px 0 14px;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--panel2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mut);
  overflow-wrap: anywhere;
}
.recents {
  width: 100%;
  margin-top: 40px;
}
.recents h2 {
  margin: 0 0 8px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.recent-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.recent {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
}
.recent + .recent {
  margin-top: 2px;
}
.recent-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}
.recent-open:hover:not(:disabled) {
  background: var(--panel2);
}
.recent-open:disabled {
  cursor: default;
}
.recent-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  background: var(--panel2);
  color: var(--mut);
}
.recent-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.recent-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-path {
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.recent-when {
  flex: none;
  font-size: 12px;
  color: var(--mut);
  padding-left: 8px;
}
.recent.missing .recent-name {
  color: var(--mut);
}
.recent.missing .recent-when {
  color: var(--warn);
}
.recent-x {
  opacity: 0;
  margin-right: 4px;
}
.recent:hover .recent-x,
.recent-x:focus-visible,
.recent.missing .recent-x {
  opacity: 1;
}
.recent-remove {
  margin-right: 8px;
  flex: none;
}
.privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 36px 0 0;
  color: var(--faint);
  font-size: 12px;
}
.welcome-foot {
  margin-top: 18px;
  display: flex;
  gap: 4px;
}
.welcome-foot .btn-quiet {
  height: 28px;
  font-size: 12px;
}
.pull-hint {
  height: 0;
  overflow: hidden;
  color: var(--mut);
  font-size: 12px;
  text-align: center;
  transition: height 0.15s;
}

/* ---------- culler layout ---------- */
.culler {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(50px + var(--safe-t));
  padding: var(--safe-t) 12px 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--bd);
  flex: none;
  min-width: 0;
}
.head-logo {
  display: inline-flex;
  margin-right: 2px;
}
.where {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.root-name {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34vw;
}
.sub-path {
  color: var(--mut);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.head-sp {
  flex: 1;
  min-width: 8px;
}
.search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  width: 200px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--panel2);
  color: var(--faint);
  flex: none;
}
.search:focus-within {
  border-color: var(--acc);
}
.search input {
  flex: 1;
  border: 0;
  padding: 0;
  height: 30px;
  background: transparent;
  color: var(--tx);
  width: 100%;
}
.search input:focus {
  border: 0;
}
.prep {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 220px;
  font-size: 12px;
  color: var(--mut);
  white-space: nowrap;
}
.prep-txt {
  overflow: hidden;
  text-overflow: ellipsis;
}
.prep-bar {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--panel2);
  overflow: hidden;
}
.prep-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--acc);
  border-radius: 2px;
  transition: width 0.3s var(--ease);
}

/* toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--bd);
  flex: none;
}
.tgroup {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tgroup + .tgroup {
  padding-left: 14px;
  border-left: 1px solid var(--bd);
}
@media (min-width: 1560px) {
  .tlabel {
    display: inline;
  }
}
@media (max-width: 1520px) {
  .toolbar .bl {
    display: none;
  }
}
@media (max-width: 1380px) {
  .toolbar .ctl-k,
  .toolbar .fl {
    display: none;
  }
  .toolbar {
    column-gap: 10px;
  }
  .tgroup + .tgroup {
    padding-left: 10px;
  }
  .ctl.size input {
    width: 72px;
  }
}
.copy-chip {
  border-color: color-mix(in srgb, var(--warn) 55%, transparent);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}
.copy-chip .ic {
  color: var(--warn);
}
.tlabel {
  display: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: 2px;
}
.ctl {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--mut);
  font-size: 12px;
}
.ctl.size input {
  width: 84px;
}
.ctl-k {
  color: var(--mut);
}
#sort {
  width: 132px;
}
#filter {
  width: 128px;
}

.body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}
.side {
  width: 228px;
  flex: none;
  overflow: auto;
  padding: 10px 0 16px;
  background: var(--panel);
  border-right: 1px solid var(--bd);
}
.side-ttl {
  padding: 4px 16px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.node {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 12px);
  margin: 1px 6px;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--mut);
  font-size: 13px;
  text-align: left;
}
.node:hover {
  background: var(--panel2);
  color: var(--tx);
}
.node.active {
  background: var(--acc-soft);
  color: var(--tx);
}
.node .ic {
  color: var(--faint);
}
.node .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node .ct {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.bic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 4px;
  color: var(--bk);
  background: color-mix(in srgb, var(--bk) 18%, transparent);
}
.b-keep {
  --bk: var(--acc-ink);
}
.b-rej {
  --bk: var(--bad);
}
.b-other {
  --bk: var(--warn);
}
.node.b-keep .ct,
.node.b-rej .ct,
.node.b-other .ct {
  color: var(--bk);
}
.side-scrim {
  display: none;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--mut);
  background: var(--panel2);
  border-bottom: 1px solid var(--bd);
}
.viewport {
  flex: 1;
  overflow: auto;
  position: relative;
  outline: none;
  overscroll-behavior: contain;
}
.sizer {
  position: relative;
  width: 100%;
}
.status {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 30px;
  padding: 0 14px;
  border-top: 1px solid var(--bd);
  background: var(--panel);
  font-size: 12px;
  color: var(--mut);
  flex: none;
  white-space: nowrap;
  overflow: hidden;
}
.hints {
  display: flex;
  align-items: center;
  gap: 4px 10px;
  overflow: hidden;
  min-width: 0;
}
.hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hints kbd {
  font-size: 10px;
  line-height: 14px;
}
.count {
  font-variant-numeric: tabular-nums;
}

/* ---------- tiles ---------- */
.tile {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--tile);
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: -2px;
  transition:
    transform 0.14s var(--ease),
    opacity 0.16s ease;
  container-type: size;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.18s;
}
.tile img.in {
  opacity: 1;
}
/* the quick tier (the photo's embedded thumbnail) sits under the real thumbnail, which
   fades in over it: same box, no layout shift */
.tile img.q,
.strip-item img.q,
.tile-mini img.q {
  position: absolute;
  inset: 0;
}
.tile img.q + img,
.strip-item img.q + img,
.tile-mini img.q + img {
  position: relative;
}
.tile img.q {
  transition: opacity 0.12s;
}
/* the photo's own colour while nothing has loaded yet */
.tile.tinted,
.tile-mini.tinted,
.strip-item.tinted {
  background: var(--ph);
}
.tile.tinted.loading,
.tile-mini.tinted.loading,
.strip-item.tinted.loading {
  background: var(--ph);
  animation: none;
}
/* a video's length */
.tile .dur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(10, 12, 15, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  pointer-events: none;
}
.strip-item .dur,
.tile-mini .dur {
  display: none;
}
/* in iCloud, not on this device yet: calm, no stripes */
.ph.ph-cloud {
  background: color-mix(in oklab, var(--ph, var(--panel2)) 55%, var(--panel2));
}
.tile:hover {
  outline-color: var(--bd2);
}
.tile.cursor {
  outline: 2px solid var(--cursor);
  outline-offset: -2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.tile.sel {
  outline: 3px solid var(--acc);
  outline-offset: -3px;
}
.tile.sel::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--acc)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .tile.sel::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306251c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
/* a kept or skipped tile on its way out (culler.js animates it: opacity and transform) */
.tile.leaving,
.lrow.leaving {
  z-index: 2;
  pointer-events: none;
}
/* while the rest slide into place (a FLIP in culler.js), the tiles' own transition is off */
.sizer.flip > .tile,
.sizer.flip > .lrow,
.sizer.flip > .mhead {
  transition: opacity 0.16s ease;
}
.tile .stars {
  position: absolute;
  left: 6px;
  bottom: 5px;
  font-size: 11px;
  color: #f5c518;
  text-shadow: 0 1px 2px #000;
  letter-spacing: 1px;
  pointer-events: none;
}
.tile .bcount {
  position: absolute;
  right: 6px;
  top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(10, 12, 15, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}
.tile.sel .bcount {
  right: 30px;
}
.tile .focus {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.45),
    0 1px 3px #000;
  pointer-events: none;
}
.focus.ok {
  background: #21dbaa;
}
.focus.warn {
  background: #f59e0b;
}
.focus.bad {
  background: #ef4444;
}
.tile .lbl {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  box-shadow: 0 1px 3px #000;
  pointer-events: none;
}
.lbl-red {
  background: #ef4444;
}
.lbl-yellow {
  background: #f5c518;
}
.lbl-green {
  background: #22c55e;
}
.lbl-blue {
  background: #3b82f6;
}
.tile .strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 7px 4px;
  font-size: 10px;
  color: #e6e9ef;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}
.tile .strip .s-stars {
  color: #f5c518;
}
.tile .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 12, 15, 0.6);
  color: #fff;
  pointer-events: none;
}
.tile .play .ic {
  margin-left: 2px;
}

/* placeholder for files this device can't preview */
.ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  text-align: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in oklab, var(--fg) 3%, transparent) 10px 20px),
    var(--panel2);
  color: var(--mut);
}
.ph-ext {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--tx);
  padding: 3px 8px;
  border: 1px solid var(--bd2);
  border-radius: 6px;
}
.ph-note {
  font-size: 11px;
  line-height: 1.3;
  max-width: 150px;
}
.ph-name {
  font-size: 11px;
  color: var(--faint);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@container (max-width: 130px) {
  .ph-note,
  .ph-name {
    display: none;
  }
}
.ph.big {
  position: absolute;
  inset: 0;
  background: transparent;
  color: var(--mut);
}
.ph.big .ph-ext {
  font-size: 22px;
  color: var(--tx);
  border-color: var(--bd2);
}
.ph.big .ph-note {
  font-size: 14px;
  max-width: 280px;
}

/* folder cards (a folder with sub-folders but no photos) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  padding: 18px;
}
.cards-ttl {
  grid-column: 1 / -1;
  margin: 0 0 -4px;
  font-size: 13px;
  color: var(--mut);
}
.cards-done {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--panel);
}
.done-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--acc-soft);
  color: var(--acc-ink);
}
.done-t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.fcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 22px 12px 16px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--panel);
  text-align: center;
  transition:
    background 0.12s,
    border-color 0.12s,
    transform 0.12s;
}
.fcard:hover {
  background: var(--panel2);
  border-color: var(--bd2);
}
.fcard .fic {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--panel2);
  color: var(--mut);
  margin-bottom: 4px;
}
.fcard .bic {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  margin-bottom: 4px;
}
.fcard.b-keep,
.fcard.b-rej,
.fcard.b-other {
  border-top: 3px solid var(--bk);
  padding-top: 20px;
}
.fcard .fnm {
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fcard .fct {
  font-size: 12px;
  color: var(--mut);
}
.fcard .fsplit {
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.fcard .fsplit span {
  color: var(--bk);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--mut);
}
.empty .ic {
  color: var(--faint);
}
.empty h3 {
  margin: 4px 0 0;
  color: var(--tx);
  font-size: 16px;
}
.empty p {
  margin: 0;
  max-width: 340px;
}


/* ---------- compare ---------- */
.compare {
  height: 38%;
  min-height: 200px;
  flex: none;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--bd);
  background: var(--panel);
}
.cmp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 14px;
  border-bottom: 1px solid var(--bd);
  font-size: 12px;
  min-width: 0;
}
.cmp-names {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  background: var(--surface-2);
}
.seg-b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  color: var(--mut);
  white-space: nowrap;
}
.seg-b:hover {
  color: var(--tx);
}
/* the chosen one: inverted, like sdev's active filter pill */
.seg .seg-b.on,
.seg .seg-b[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}
.seg .seg-b.on .pro-tag {
  background: color-mix(in oklab, var(--bg) 20%, transparent);
  color: var(--bg);
}
.seg-lg .seg-b {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
}
.cmp {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--stage);
}
.two figure {
  position: relative;
  flex: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--bd);
}
.two figure:last-child {
  border-right: 0;
}
.two figcaption {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
}
.two img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: contain;
}
.cmp-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 20px;
  color: var(--mut);
  font-size: 13px;
  text-align: center;
}
.seam {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.seam img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.seam-r {
  position: absolute;
  top: 0;
  height: 100%;
  overflow: hidden;
}
.handle {
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px;
  margin-left: -1px;
  background: var(--acc);
  cursor: ew-resize;
  touch-action: none;
  z-index: 3;
}
.handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--acc);
  border: 3px solid var(--stage);
  transform: translate(-50%, -50%);
}
.cap {
  position: absolute;
  bottom: 8px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
}
.cap.l {
  left: 8px;
}
.cap.r {
  right: 8px;
}
.gridcmp {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 2px;
  padding: 2px;
}
.gridcmp figure {
  position: relative;
  margin: 0;
  min-height: 0;
  overflow: hidden;
}
.gridcmp img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gridcmp figcaption {
  position: absolute;
  left: 4px;
  bottom: 4px;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #e6e9ef;
  font-size: 10px;
}
.loupe {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 2px solid var(--acc);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6);
  background-repeat: no-repeat;
  background-color: #000;
  pointer-events: none;
  display: none;
  z-index: 5;
}
.loupe.show {
  display: block;
}

/* ---------- quick look ---------- */
.ql {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--stage);
  color: var(--tx);
  animation: fade 0.14s ease;
}
.ql-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) 14px 12px 16px;
  background: linear-gradient(color-mix(in oklab, var(--stage) 92%, transparent), transparent);
  pointer-events: none;
}
.ql-top > * {
  pointer-events: auto;
}
.ql-cap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.ql-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ql-pos {
  color: var(--mut);
  font-size: 12px;
  white-space: nowrap;
}
.ql-tools {
  display: flex;
  gap: 6px;
}
.ql-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  color: var(--tx);
  font-size: 12px;
}
.ql-btn:hover {
  background: var(--surface-2);
}
.ql-btn.tog[aria-pressed="true"] {
  border-color: color-mix(in oklab, var(--accent) 50%, transparent);
  background: color-mix(in oklab, var(--accent) 16%, var(--surface));
}
.ql-stage {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 300px;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
}
.ql.noinfo .ql-stage {
  right: 0;
}
.ql-stage.zoom {
  cursor: grab;
}
.ql-stage.zoom.drag {
  cursor: grabbing;
}
#qlImg {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 94%;
  max-height: 86%;
  object-fit: contain;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
.ql.fs #qlImg {
  max-width: 99%;
  max-height: 98%;
}
.ql-vid {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 94%;
  max-height: 80%;
  background: #000;
  border-radius: 12px;
}
.zebra {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
}
.zebra.show {
  display: block;
}
.ql-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 44px;
  height: 64px;
  margin-top: -32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: color-mix(in oklab, var(--surface) 75%, transparent);
  color: var(--tx);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: opacity 0.15s;
}
.ql:hover .ql-nav,
.ql-nav:focus-visible {
  opacity: 0.85;
}
.ql-nav:disabled {
  visibility: hidden;
}
.ql-nav.prev {
  left: 12px;
}
.ql-nav.next {
  right: 312px;
}
.ql.noinfo .ql-nav.next {
  right: 12px;
}
.ql-bar {
  position: absolute;
  left: 0;
  right: 300px;
  bottom: calc(16px + var(--safe-b));
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}
.ql.noinfo .ql-bar {
  right: 0;
}
.ql-bar .btn {
  pointer-events: auto;
  height: 36px;
  padding: 0 16px;
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}
.ql-bar .btn:hover {
  background: var(--surface-2);
}
.ql.fs .ql-bar,
.ql.fs .ql-top {
  opacity: 0;
  transition: opacity 0.2s;
}
.ql.fs:hover .ql-top,
.ql.fs:hover .ql-bar {
  opacity: 1;
}
.ql-info {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  padding: calc(64px + var(--safe-t)) 20px 20px;
  overflow: auto;
  background: var(--surface);
  border-left: 1px solid var(--bd);
  font-size: 13px;
  z-index: 4;
}
.ql.noinfo .ql-info {
  display: none;
}
.ql-info h3 {
  margin: 18px 0 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.ql-info h3:first-child {
  margin-top: 0;
}
.exif {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
}
.exif dt,
.exif dd {
  margin: 0;
  padding: 5px 0;
  border-bottom: 1px solid var(--bd);
}
.exif dt {
  color: var(--mut);
  padding-right: 12px;
}
.exif dd {
  text-align: right;
  overflow-wrap: anywhere;
}
.exif-none {
  grid-column: 1 / -1;
  color: var(--mut);
}
.hist {
  display: block;
  width: 100%;
  height: 72px;
  border-radius: 6px;
  background: var(--stage);
  border: 1px solid var(--bd);
}
.stars-pick,
.labels-pick {
  display: flex;
  gap: 2px;
}
.star-b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
}
.star-b:hover {
  background: var(--surface-2);
}
.star-b.on {
  color: var(--gold);
}
:root:not([data-theme="dark"]) .star-b.on {
  color: #e0b000;
}
.star-b.on .ic path {
  fill: currentColor;
}
.labels-pick {
  gap: 8px;
}
.lbl-b {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 2px solid transparent;
  padding: 0;
}
.lbl-b.on {
  border-color: var(--tx);
}
.lbl-b.none {
  background: transparent;
  border: 1px dashed var(--bd2);
  color: var(--mut);
  font-size: 11px;
  width: auto;
  padding: 0 8px;
}
.lbl-b.none.on {
  border-style: solid;
  border-color: var(--mut);
}

/* ---------- menus ---------- */
.menu {
  position: fixed;
  z-index: 70;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--bd2);
  border-radius: 12px;
  background: var(--raise);
  box-shadow: var(--shadow);
  animation: pop 0.12s var(--ease);
}
.menu-title {
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.menu-sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--bd);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tx);
  font-size: 13px;
  text-align: left;
}
.menu-item:hover,
.menu-item:focus {
  background: var(--panel2);
  outline: none;
}
.menu-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--acc);
}
.menu-item .ic {
  color: var(--mut);
}
.menu-item.danger,
.menu-item.danger .ic {
  color: var(--bad);
}
.menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}
.menu-item.locked {
  color: var(--mut);
}
.menu-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.menu-sub {
  font-size: 11px;
  color: var(--faint);
}
.menu-item kbd {
  margin-left: 8px;
}
.menu-check {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border: 1.5px solid var(--bd2);
  border-radius: 4px;
}
.menu-check.on {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-tx);
}
.menu-check .ic {
  stroke-width: 3;
}
.star-row {
  display: flex;
  gap: 4px;
  padding: 6px;
}
.star-row .star-b {
  color: var(--faint);
}
.star-row .star-b:hover {
  background: var(--panel2);
}

/* history list */
.hist-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hrow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--bd);
}
.hrow:last-child {
  border-bottom: 0;
}
.hrow .hic {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
}
.hrow .hmain {
  flex: 1;
  min-width: 0;
}
.hrow .hop {
  font-weight: 600;
}
.hrow .hnames {
  color: var(--mut);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrow .hwhen {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}
.hrow.redo {
  opacity: 0.55;
}
.hsec {
  margin: 14px 0 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.hsec:first-child {
  margin-top: 0;
}

/* ---------- sheets ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--scrim);
  animation: fade 0.14s ease;
}
.scrim.out {
  opacity: 0;
  transition: opacity 0.14s;
}
.sheet {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--bd2);
  border-radius: 16px;
  background: var(--raise);
  box-shadow: var(--shadow);
  outline: none;
  animation: pop 0.16s var(--ease);
}
.sheet-sm {
  max-width: 420px;
}
.sheet-md {
  max-width: 500px;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 14px 6px 22px;
}
.sheet-title {
  flex: 1;
  margin: 0;
  font-size: 17px;
}
.sheet-grip {
  display: none;
}
.sheet-body {
  padding: 6px 22px 22px;
  overflow: auto;
}
.sheet-text {
  margin: 0 0 14px;
  color: var(--mut);
}
.sheet-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--faint);
}
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.sheet-actions.stack {
  flex-direction: column;
  align-items: stretch;
}
.sheet-actions.split {
  justify-content: space-between;
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--panel2);
  text-align: left;
}
.choice:hover {
  border-color: var(--acc);
}
.choice-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.choice-label {
  font-weight: 600;
}
.choice-sub {
  font-size: 12px;
  color: var(--mut);
  overflow-wrap: anywhere;
}

/* settings rows */
.set-sec {
  margin: 4px 0 18px;
}
.set-sec:last-child {
  margin-bottom: 0;
}
.set-sec h3 {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.set-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--bd);
  cursor: pointer;
}
.set-row:last-child {
  border-bottom: 0;
}
.set-row .set-main {
  flex: 1;
  min-width: 0;
}
.set-row .set-t {
  display: flex;
  align-items: center;
  gap: 6px;
}
.set-row .set-d {
  font-size: 12px;
  color: var(--mut);
}
.switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border-radius: 999px;
  background: var(--bd2);
  cursor: pointer;
  transition: background 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s var(--ease);
}
.switch:checked {
  background: var(--acc);
}
.switch:checked::after {
  transform: translateX(16px);
}
.switch:disabled {
  opacity: 0.5;
}
.bucket-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.bucket-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--bd2);
  border-radius: 999px;
  font-size: 13px;
  max-width: 100%;
}
.bucket-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bucket-pill .icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.bucket-add {
  display: flex;
  gap: 8px;
}
.bucket-add input {
  flex: 1;
}
.field-err:empty {
  display: none;
}
.field-err {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--bad);
}
.set-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--bd);
  font-size: 12px;
  color: var(--faint);
}

/* account */
.acct-id {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--panel2);
}
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--acc-soft);
  color: var(--acc-ink);
  font-weight: 600;
  font-size: 16px;
}
.acct-who {
  flex: 1;
  min-width: 0;
}
.acct-who div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.code {
  display: block;
  margin: 6px 0 14px;
  padding: 18px 10px;
  border: 1px dashed var(--bd2);
  border-radius: 12px;
  background: var(--panel2);
  font: 600 30px/1 var(--mono);
  letter-spacing: 0.14em;
  text-align: center;
  user-select: all;
  -webkit-user-select: all;
}
.waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 4px;
  color: var(--mut);
  font-size: 13px;
}
.spinner {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--bd2);
  border-top-color: var(--acc);
  animation: spin 0.8s linear infinite;
}
.problem {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--tx);
  font-size: 13px;
}
.problem .ic {
  color: var(--warn);
  margin-top: 1px;
}

/* upgrade */
.pro-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pro-row {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
}
.pro-row.hit {
  margin: 2px -10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--acc-soft);
}
.pro-dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: var(--acc);
  color: var(--acc-tx);
  margin-top: 1px;
}
.pro-price {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel2);
  color: var(--mut);
  font-size: 13px;
}

/* shortcuts sheet */
.keys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}
.keys-grid h3 {
  grid-column: 1 / -1;
  margin: 12px 0 2px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.keys-grid h3:first-child {
  margin-top: 0;
}
.krow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
}
.krow span:last-child {
  display: flex;
  gap: 3px;
  flex: none;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(46px + var(--safe-b));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 9px 14px;
  border: 1px solid var(--bd2);
  border-radius: 10px;
  background: var(--raise);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition:
    opacity 0.18s,
    transform 0.18s var(--ease);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
body.touch .toast {
  bottom: calc(96px + var(--safe-b));
}
body.ql-open .toast {
  bottom: calc(76px + var(--safe-b));
}
.toast.bad {
  border-color: color-mix(in srgb, var(--bad) 50%, transparent);
}
.toast-msg {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast-act {
  border: 0;
  background: none;
  padding: 0;
  color: var(--acc-ink);
  font-weight: 600;
  white-space: nowrap;
}

/* drop overlay */
.drop {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  background: var(--scrim);
  pointer-events: none;
}
.drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 48px;
  border: 2px dashed var(--acc);
  border-radius: 18px;
  background: var(--raise);
  font-size: 16px;
  font-weight: 600;
}
.drop-card .ic {
  width: 34px;
  height: 34px;
  color: var(--acc-ink);
}

/* touch action bar (phones / coarse pointers) */
.touchbar {
  display: none;
}
.narrow-only {
  display: none !important;
}

/* ---------- animation ---------- */
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes slideup {
  from {
    transform: translateY(100%);
  }
}

/* ---------- touch ---------- */
body.touch .touchbar {
  display: flex;
  gap: 8px;
  padding: 8px 10px calc(8px + var(--safe-b));
  border-top: 1px solid var(--bd);
  background: var(--panel);
  flex: none;
}
body.touch .touchbar[hidden] {
  display: none;
}
.tb {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 52px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--panel2);
  font-size: 12px;
  color: var(--tx);
}
.tb:active {
  background: var(--hover);
}
.tb.keep {
  flex: 1.4;
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-tx);
  font-weight: 600;
}
.tb.skip .ic {
  color: var(--bad);
}
.tb .ic {
  width: 20px;
  height: 20px;
}
body.touch .status .hints {
  display: none;
}
body.touch .tile:hover {
  outline-color: transparent;
}
body.touch .ql-nav {
  opacity: 0.7;
}
body.touch .ql-stage {
  cursor: default;
}

/* ---------- narrow windows and phones ---------- */
@media (max-width: 900px) {
  .side {
    width: 200px;
  }
  .search {
    width: 160px;
  }
  .tlabel {
    display: none;
  }
  .tgroup + .tgroup {
    padding-left: 10px;
  }
  .toolbar {
    gap: 6px 10px;
  }
}

@media (max-width: 640px) {
  .wide-only {
    display: none !important;
  }
  .narrow-only {
    display: inline-flex !important;
  }
  .head {
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }
  .head-logo {
    display: none;
  }
  .root-name {
    max-width: 40vw;
  }
  .sub-path {
    display: none;
  }
  .search {
    width: 36px;
    padding: 0 9px;
    transition: width 0.15s;
  }
  .search input {
    width: 0;
  }
  .search:focus-within {
    position: absolute;
    left: 6px;
    right: 6px;
    width: auto;
    z-index: 5;
    background: var(--panel);
  }
  .search:focus-within input {
    width: 100%;
  }
  .prep {
    display: none;
  }
  .chip {
    padding: 0 10px;
  }
  .toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 6px 8px;
  }
  .toolbar::-webkit-scrollbar {
    display: none;
  }
  .toolbar.more-right {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  }
  .tgroup {
    flex: none;
  }
  .ctl.size {
    display: none;
  }
  .side {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: min(300px, 84vw);
    box-shadow: var(--shadow);
    transform: translateX(-102%);
    transition: transform 0.2s var(--ease);
  }
  .side.open {
    transform: none;
  }
  .side-scrim:not([hidden]) {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 29;
    background: var(--scrim);
  }
  .status {
    height: 26px;
  }
  .hints {
    display: none;
  }
  .compare {
    height: 44%;
  }
  .cmp-head {
    flex-wrap: wrap;
  }
  .cmp-names {
    flex-basis: 100%;
  }
  .two {
    flex-direction: column;
  }
  .two figure {
    border-right: 0;
    border-bottom: 1px solid var(--bd);
  }
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px;
  }

  /* bottom sheets */
  .scrim {
    place-items: end stretch;
    padding: 0;
  }
  .sheet {
    max-width: none;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding-bottom: var(--safe-b);
    animation: slideup 0.22s var(--ease);
  }
  .sheet-grip {
    display: block;
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 2px;
    background: var(--bd2);
  }
  .sheet-head {
    padding-top: 10px;
  }
  .sheet-actions:not(.stack) {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .sheet-actions .btn {
    height: 42px;
  }
  .keys-grid {
    grid-template-columns: 1fr;
  }

  /* quick look on phones: info panel becomes a bottom drawer */
  .ql-stage {
    right: 0;
  }
  .ql-nav.next {
    right: 12px;
  }
  .ql-bar {
    right: 0;
  }
  .ql-btn-t {
    display: none;
  }
  .ql-info {
    top: auto;
    left: 0;
    width: auto;
    max-height: 55vh;
    padding: 18px 18px calc(18px + var(--safe-b));
    border-left: 0;
    border-top: 1px solid var(--bd);
    border-radius: 16px 16px 0 0;
  }
  .ql:not(.noinfo) .ql-bar {
    display: none;
  }

  .welcome {
    padding-top: calc(40px + var(--safe-t));
  }
  .open-btn {
    width: 100%;
  }
  .recent-path {
    font-size: 11px;
  }
  .recent-when {
    display: none;
  }
  .recent-x {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- sdev family touches ---------- */
.wordmark {
  color: var(--brand-wordmark);
}
.welcome {
  position: relative;
}
.welcome-top {
  position: absolute;
  top: calc(14px + var(--safe-t));
  right: 16px;
}
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--tx);
}
.welcome .open-btn {
  border-radius: 14px;
}
.recent-list,
.mobile-howto,
.cards-done,
.fcard {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.fcard:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent) 50%, var(--bd));
  box-shadow: 0 10px 24px color-mix(in oklab, var(--accent) 8%, transparent);
}
[data-theme="dark"] .logo rect:first-child {
  fill: #1c2538;
  stroke: rgba(255, 255, 255, 0.12);
}
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}
@media (max-width: 640px) {
  .head .theme-btn {
    display: none;
  }
}

/* ---------- product tour ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
:root {
  --tour-dim: rgba(15, 23, 42, 0.5);
}
[data-theme="dark"] {
  --tour-dim: rgba(2, 6, 15, 0.7);
}
.tour {
  position: fixed;
  inset: 0;
  z-index: 85;
  /* the dim is only a picture: taps reach the app underneath */
  pointer-events: none;
}
.tour-card {
  pointer-events: auto;
}
.tour.nohole {
  background: var(--tour-dim);
  animation: fade 0.18s ease;
}
.tour-hole {
  position: fixed;
  border-radius: 12px;
  box-shadow:
    0 0 0 2px var(--ring),
    0 0 0 6px color-mix(in oklab, var(--ring) 25%, transparent),
    0 0 0 200vmax var(--tour-dim);
  pointer-events: none;
  transition:
    top 0.28s var(--ease),
    left 0.28s var(--ease),
    width 0.28s var(--ease),
    height 0.28s var(--ease);
}
.tour.nohole .tour-hole {
  display: none;
}
.tour-card {
  position: fixed;
  z-index: 2;
  width: 340px;
  max-width: calc(100vw - 24px);
  padding: 16px 18px 14px;
  border: 1px solid var(--bd);
  border-radius: 16px;
  background: var(--surface);
  color: var(--tx);
  box-shadow: var(--shadow);
  outline: none;
  transition:
    top 0.28s var(--ease),
    left 0.28s var(--ease);
}
.tour-arrow {
  position: fixed;
  z-index: 3;
  width: 14px;
  height: 14px;
  background: var(--surface);
  border: 1px solid var(--bd);
  transform: rotate(45deg);
  transition:
    top 0.28s var(--ease),
    left 0.28s var(--ease);
}
/* only the two outer edges of the arrow square show a border */
.tour-arrow[data-side="bottom"] {
  border-right-color: transparent;
  border-bottom-color: transparent;
}
.tour-arrow[data-side="top"] {
  border-left-color: transparent;
  border-top-color: transparent;
}
.tour-arrow[data-side="right"] {
  border-top-color: transparent;
  border-right-color: transparent;
}
.tour-arrow[data-side="left"] {
  border-bottom-color: transparent;
  border-left-color: transparent;
}
.tour-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.tour-pos {
  font-size: 12px;
  font-weight: 600;
  color: var(--acc-ink);
  font-variant-numeric: tabular-nums;
}
.tour-dots {
  display: flex;
  gap: 4px;
}
.tour-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--bd2);
  transition:
    width 0.2s var(--ease),
    background 0.2s;
}
.tour-dots i.on {
  width: 16px;
  background: var(--acc);
}
.tour-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
}
.tour-text {
  margin: 0;
  color: var(--mut);
  font-size: 13.5px;
  line-height: 1.5;
}
.tour-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 10px 0 0;
}
.tour-keys kbd {
  font-size: 12px;
  line-height: 20px;
  min-width: 24px;
  padding: 0 6px;
}
.tour-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}
.tour-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.tour-skip {
  padding: 0 8px;
  margin-left: -8px;
}
.set-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.set-btns .btn:disabled {
  opacity: 0.45;
}
@media (max-width: 640px) {
  .tour-card:not(.coach) {
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding: 18px 18px calc(16px + var(--safe-b));
  }
  .tour-card[data-side="sheet-top"] {
    bottom: auto;
    border-radius: 0 0 18px 18px;
    border-top: 0;
    border-bottom: 1px solid var(--bd);
    padding-top: calc(16px + var(--safe-t));
  }
  .tour-card:not(.coach):not([data-side="sheet-top"]) {
    top: auto !important;
  }
  .tour-arrow {
    display: none;
  }
  .tour-title {
    font-size: 17px;
  }
  .tour-text {
    font-size: 15px;
  }
  .tour-actions .btn {
    height: 40px;
  }
  .set-row:has(.set-btns) {
    flex-wrap: wrap;
  }
}

/* ---------- the sdev "Say thanks" button (welcome.js thanksFab, like sdev.in's CoffeeFab) ---------- */
.thanks-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2c2d46, #365a83);
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.2),
    0 0 0 1px rgb(255 255 255 / 0.1);
  color: #fff;
  font: 600 14px/1 var(--font);
  cursor: pointer;
  transition: filter 150ms;
}
.thanks-fab:hover {
  filter: brightness(1.1);
}
.thanks-fab svg {
  flex: none;
  fill: #dc9e54;
  stroke: #dc9e54;
}
.thanks-fab span {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition:
    max-width 200ms,
    margin 200ms;
}
.thanks-fab:hover span,
.thanks-fab:focus-visible span {
  max-width: 160px;
  margin-left: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .thanks-fab span {
    transition: none;
  }
}
@media print {
  .thanks-fab {
    display: none;
  }
}

/* ---------- web: folder permission (welcome.js askAgain) ---------- */
.recent-hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 2px 0;
  color: var(--mut);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
}
.recent-hint svg {
  flex: none;
  margin-top: 2px;
}
.allow-sheet .sheet-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.allow-sheet .sheet-text {
  margin: 0;
}
.allow-pick {
  align-self: stretch;
  justify-content: center;
}
.allow-or {
  margin: 4px 0 0;
  color: var(--mut);
  font-size: 13px;
  text-align: center;
}
.allow-steps {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
  font-size: 14px;
  line-height: 1.5;
}
.allow-ic {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--bd);
  border-radius: 50%;
  vertical-align: -6px;
  background: var(--surface);
}
.allow-privacy {
  margin: 4px 0 0;
}

/* ---------- boot guard (js/boot-guard.js) ---------- */
.boot-wait {
  position: fixed;
  inset: 0;
  z-index: 199;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--bg);
  color: var(--mut);
  font: 500 14px/1.4 var(--font);
  animation: boot-in 240ms ease-out both;
}
.boot-wait p {
  margin: 0;
}
.boot-wait svg {
  animation: boot-pulse 1.4s ease-in-out infinite;
}
@keyframes boot-in {
  from {
    opacity: 0;
  }
}
@keyframes boot-pulse {
  50% {
    opacity: 0.55;
    transform: scale(0.96);
  }
}
@media (prefers-reduced-motion: reduce) {
  .boot-wait,
  .boot-wait svg {
    animation: none;
  }
}
.boot-fail {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font);
}
.boot-fail-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.boot-fail-card h1 {
  margin: 8px 0 0;
  font-size: 22px;
}
.boot-fail-card p {
  margin: 0 0 6px;
  color: var(--mut);
}
.boot-fail-details {
  width: 100%;
  margin-top: 10px;
  color: var(--mut);
  font-size: 12px;
  text-align: left;
}
.boot-fail-details summary {
  cursor: pointer;
  text-align: center;
}
.boot-fail-details pre {
  max-height: 200px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ======================================================================
   Gallery: simple toolbar, hint line, progress, views, decision bars,
   one by one, filmstrip, list, inspector.
   ====================================================================== */
.toolbar {
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px 14px;
}
.toolbar .search {
  width: 220px;
  height: 32px;
}
.toolbar .sp {
  flex: 1;
  min-width: 8px;
}
.view-seg .seg-b {
  height: 26px;
  padding: 0 11px;
  font-size: 13px;
}
.view-seg .seg-b .ic {
  opacity: 0.85;
}
body:not([data-view="grid"]):not([data-view="rows"]):not([data-view="list"]) .ctl.size,
body[data-view="one"] .ctl.size {
  display: none;
}

/* hint line + progress, at the top of the main column */
.hintline {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--bd);
  background: var(--bg);
  font-size: 12.5px;
  color: var(--mut);
  flex: none;
}
.hint-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hintline .sp {
  flex: 1;
}
.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pbar {
  position: relative;
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.pbar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: var(--acc);
  transition: width 0.15s ease-out;
}
.ptext {
  color: var(--tx);
}

/* skeleton while a preview loads (no spinners, no layout jump) */
.tile,
.tile-mini {
  contain: strict;
}
.tile.loading,
.tile-mini.loading,
.strip-item.loading {
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in oklab, var(--surface-2) 70%, var(--surface)) 50%, var(--surface-2) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}
body.lite .tile.loading,
body.lite .tile-mini.loading,
body.lite .strip-item.loading {
  animation: none;
}

/* empty, done and missing states */
.empty-ic {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--mut);
}
.empty-ic.done {
  background: var(--acc-soft);
  color: var(--acc-ink);
}
.empty-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

/* decision bar */
.decide,
.selbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px calc(10px + var(--safe-b));
  border-top: 1px solid var(--bd);
  background: var(--surface);
  flex: none;
}
.decide[hidden],
.selbar[hidden] {
  display: none;
}
.dbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-width: 128px;
  padding: 0 18px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--surface);
  color: var(--tx);
  font-size: 15px;
  font-weight: 600;
  transition:
    background 0.12s,
    transform 0.08s;
}
.dbtn:hover {
  background: var(--surface-2);
}
.dbtn:active {
  transform: scale(0.98);
}
.dbtn kbd {
  margin-left: 2px;
  font-weight: 400;
}
.dbtn.skip .ic {
  color: var(--bad);
}
.dbtn.keep {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-tx);
}
.dbtn.keep:hover {
  filter: brightness(1.08);
}
.dbtn.keep kbd {
  background: color-mix(in oklab, var(--accent-fg) 14%, transparent);
  border-color: color-mix(in oklab, var(--accent-fg) 30%, transparent);
  color: var(--acc-tx);
}
.dbtn.putback {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}
.dbtn.putback kbd {
  background: transparent;
  color: inherit;
  border-color: color-mix(in oklab, var(--bg) 40%, transparent);
}
.d-stars,
.d-labels {
  display: flex;
  align-items: center;
  gap: 2px;
}
.d-stars .star-b {
  width: 32px;
  height: 32px;
  color: var(--faint);
}
.d-stars .star-b.on {
  color: var(--gold);
}
:root:not([data-theme="dark"]) .d-stars .star-b.on {
  color: #e0b000;
}
.d-stars .star-b.on .ic path {
  fill: currentColor;
}
.d-labels {
  gap: 6px;
  padding: 0 4px;
}
.d-labels .lbl-b {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.touch-only {
  display: none !important;
}
body.touch .touch-only {
  display: inline-flex !important;
}
body.touch .no-touch {
  display: none !important;
}
.selbar {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}
.sel-count {
  margin-right: 8px;
  font-weight: 600;
}
.selbar .btn.keep {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-tx);
}
.selbar .btn.keep .ic {
  color: inherit;
}
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

/* ---------- one by one ---------- */
.one {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--stage);
}
.one[hidden] {
  display: none;
}
.one-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}
.one-stage img,
.one-vid {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease-out, opacity 0.12s ease-out;
}
.one-stage.zoom {
  overflow: auto;
  cursor: grab;
}
.one-stage.zoom img {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: none;
}
.one-stage.leaving img {
  opacity: 0;
}
.one-stage.leave-keep img {
  transform: translateX(40px);
}
.one-stage.leave-skip img {
  transform: translateX(-40px);
}
.one-cap {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  max-width: calc(100% - 140px);
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  border: 1px solid var(--bd);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.one-cap #oneName {
  overflow: hidden;
  text-overflow: ellipsis;
}
.one-cap #onePos {
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}
.one .ql-nav {
  opacity: 0.85;
}
.one .ql-nav.next {
  right: 12px;
}
.one-swipe {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  pointer-events: none;
}
.one-swipe.keep {
  background: var(--acc);
  color: var(--acc-tx);
}
.one-swipe.skip {
  background: var(--bad);
  color: #fff;
}
.filmstrip {
  position: relative;
  flex: none;
  height: 76px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--bd);
  background: var(--surface);
  scrollbar-width: thin;
}
.strip-sizer {
  position: relative;
  height: 100%;
}
.strip-item {
  position: absolute;
  top: 8px;
  width: 80px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  contain: strict;
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.strip-item.cursor {
  outline-color: var(--ring);
  outline-width: 3px;
  outline-offset: -3px;
}
.strip-item .stars {
  position: absolute;
  left: 4px;
  bottom: 2px;
  font-size: 9px;
  color: #f5c518;
  text-shadow: 0 1px 2px #000;
}
.strip-item .play {
  width: 22px;
  height: 22px;
}
.strip-item .ph .ph-note,
.strip-item .ph .ph-name {
  display: none;
}
.strip-item .ph-ext {
  font-size: 10px;
  padding: 1px 4px;
}

/* ---------- list ---------- */
.list-head,
.lrow {
  display: grid;
  grid-template-columns: var(--row-h, 52px) minmax(160px, 2.2fr) 1fr 1.2fr 0.7fr 0.8fr 0.5fr 0.8fr;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}
.list-head {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 34px;
  border-bottom: 1px solid var(--bd);
  background: var(--bg);
  font-size: 12px;
  color: var(--mut);
}
.list-head[hidden] {
  display: none;
}
.lh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--mut);
  text-align: left;
}
button.lh:hover,
.lh.on {
  color: var(--tx);
}
.lrow {
  position: absolute;
  top: 0;
  left: 0;
  border-bottom: 1px solid var(--bd);
  font-size: 13px;
  cursor: pointer;
  contain: strict;
}
.lrow:hover {
  background: color-mix(in oklab, var(--surface-2) 60%, transparent);
}
.lrow.cursor {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--ring);
}
.lrow.sel {
  background: var(--acc-soft);
}
.lrow > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lrow .c-date,
.lrow .c-cam,
.lrow .c-size,
.lrow .c-status {
  color: var(--mut);
}
.lrow .c-size {
  font-variant-numeric: tabular-nums;
}
.lrow .c-stars {
  color: #e0b000;
  letter-spacing: 1px;
}
[data-theme="dark"] .lrow .c-stars {
  color: var(--gold);
}
.tile-mini {
  position: relative;
  display: block;
  width: calc(var(--row-h, 52px) - 10px);
  height: calc(var(--row-h, 52px) - 10px);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
}
.tile-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile-mini .ph {
  padding: 2px;
}
.tile-mini .ph .ph-note,
.tile-mini .ph .ph-name {
  display: none;
}
.tile-mini .ph-ext {
  font-size: 9px;
  padding: 1px 3px;
}
.tile-mini .play {
  width: 18px;
  height: 18px;
}
.tile-mini .play .ic {
  width: 10px;
  height: 10px;
}

/* ---------- inspector ---------- */
.inspector {
  width: 300px;
  flex: none;
  overflow: auto;
  padding: 16px 18px 20px;
  border-left: 1px solid var(--bd);
  background: var(--surface);
  font-size: 13px;
}
.inspector[hidden] {
  display: none;
}
.inspector h3 {
  margin: 18px 0 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.insp-name {
  margin: 0 0 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.insp-where {
  margin: 0 0 8px;
  color: var(--mut);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.insp-focus {
  display: flex;
  align-items: center;
  gap: 8px;
}
.insp-focus .focus {
  position: static;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.insp-lock {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--mut);
}
.inspector .exif dt,
.inspector .exif dd {
  border-bottom-color: var(--bd);
}
.inspector .exif dt {
  color: var(--mut);
}
.inspector .hist {
  background: var(--surface-2);
  border-color: var(--bd);
}
.inspector .star-b {
  color: var(--faint);
}
.inspector .lbl-b.none {
  color: var(--mut);
  border-color: var(--bd2);
}

/* tools menu: roomier, with section headings */
.tools-menu {
  max-height: min(78vh, 720px);
}
.tools-menu .menu-title:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid var(--bd);
  padding-top: 10px;
}

/* help panel */
.help-top {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.help-search {
  width: 100%;
  height: 38px;
  margin-bottom: 12px;
}
.help-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.help-sec {
  margin: 14px 0 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.help-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bd);
}
.help-item:last-child {
  border-bottom: 0;
}
.help-main {
  flex: 1;
  min-width: 0;
}
.help-name {
  font-weight: 600;
}
.help-desc {
  color: var(--mut);
  font-size: 12.5px;
}
.help-keys {
  display: flex;
  gap: 3px;
  flex: none;
}
.help-empty {
  padding: 18px 0;
  color: var(--mut);
  text-align: center;
}
.sheet.help .sheet-body {
  min-height: 300px;
}

/* low-end machines: lighter effects */
body.lite .tour-hole,
body.lite .sheet,
body.lite .menu,
body.lite .toast {
  box-shadow: none;
}
body.lite .tile,
body.lite .one-stage img {
  transition: none;
}

@media (max-width: 1100px) {
  .toolbar .search {
    width: 150px;
  }
  .view-seg .seg-b .vl {
    display: none;
  }
}
@media (max-width: 900px) {
  .inspector {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    box-shadow: var(--shadow);
  }
  .progress .pbar {
    width: 60px;
  }
  .list-head,
  .lrow {
    grid-template-columns: var(--row-h, 52px) minmax(120px, 2fr) 1fr 0.7fr 0.7fr;
  }
  .list-head .c-cam,
  .lrow .c-cam,
  .list-head .c-lbl,
  .lrow .c-lbl,
  .list-head .c-status,
  .lrow .c-status {
    display: none;
  }
}
@media (max-width: 640px) {
  .toolbar {
    overflow-x: auto;
  }
  .toolbar .search {
    width: 36px;
  }
  .view-seg .seg-b {
    padding: 0 9px;
  }
  .hintline {
    flex-wrap: wrap;
    row-gap: 4px;
    font-size: 12px;
  }
  .hint-txt {
    white-space: normal;
  }
  .decide {
    gap: 8px;
    padding: 8px 10px calc(8px + var(--safe-b));
  }
  .dbtn {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 8px;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
  }
  .dbtn.keep {
    flex: 1.4;
  }
  .dbtn kbd {
    display: none;
  }
  .filmstrip {
    height: 64px;
  }
  .strip-item {
    width: 64px;
    height: 48px;
  }
  .list-head,
  .lrow {
    grid-template-columns: var(--row-h, 52px) minmax(0, 1fr) 0.6fr;
    gap: 8px;
  }
  .list-head .c-date,
  .lrow .c-date,
  .list-head .c-size,
  .lrow .c-size {
    display: none;
  }
  .one-cap {
    max-width: calc(100% - 24px);
  }
}
.one-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 transparent;
  transition: box-shadow 0.15s ease-out;
}
.one-stage.flash-keep::after {
  box-shadow: inset 0 0 0 3px var(--acc);
}
.one-stage.flash-skip::after {
  box-shadow: inset 0 0 0 3px var(--bad);
}
.name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.name-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.name-field input {
  width: 100%;
}
@media (max-width: 640px) {
  .name-fields {
    grid-template-columns: 1fr;
  }
}

/* toasts sit above the decision bar */
#culler:not([hidden]) ~ .toast {
  bottom: calc(84px + var(--safe-b));
}

/* ---------- safe areas (notches, status bars, gesture bars) ---------- */
:root {
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
/* Android WebView often reports 0 for env(): keep clear of the status bar
   and the gesture pill anyway */
body.android {
  --safe-t: max(env(safe-area-inset-top, 0px), 24px);
  --safe-b: max(env(safe-area-inset-bottom, 0px), 16px);
}
.head {
  padding-left: calc(14px + var(--safe-l));
  padding-right: calc(12px + var(--safe-r));
}
.toolbar,
.hintline {
  padding-left: calc(14px + var(--safe-l));
  padding-right: calc(14px + var(--safe-r));
}
.decide,
.selbar {
  padding-left: calc(14px + var(--safe-l));
  padding-right: calc(14px + var(--safe-r));
}
.welcome {
  padding-left: calc(20px + var(--safe-l));
  padding-right: calc(20px + var(--safe-r));
}
.welcome-top {
  right: calc(16px + var(--safe-r));
}
.toast {
  bottom: calc(46px + var(--safe-b));
}
#culler:not([hidden]) ~ .toast {
  bottom: calc(84px + var(--safe-b));
}
@media (max-width: 640px) {
  .head {
    padding-left: calc(6px + var(--safe-l));
    padding-right: calc(6px + var(--safe-r));
  }
  .decide {
    padding: 8px calc(10px + var(--safe-r)) calc(8px + var(--safe-b)) calc(10px + var(--safe-l));
  }
  .tour-card:not(.coach) {
    padding-bottom: calc(16px + var(--safe-b));
  }
  .tour-card[data-side="sheet-top"] {
    padding-top: calc(16px + var(--safe-t));
  }
  .sheet {
    padding-bottom: var(--safe-b);
  }
}

/* ---------- gentle colours: skipping isn't rejection ---------- */
:root {
  --skip: #64748b; /* slate */
  --skip-soft: color-mix(in oklab, #64748b 14%, transparent);
}
[data-theme="dark"] {
  --skip: #94a3b8;
  --skip-soft: color-mix(in oklab, #94a3b8 16%, transparent);
}
.b-rej {
  --bk: var(--skip);
}
.btn.skip .ic,
.dbtn.skip .ic,
.selbar .btn.skip .ic {
  color: var(--skip);
}
.one-swipe.skip {
  background: var(--skip);
  color: #fff;
}
.one-stage.flash-skip::after {
  box-shadow: inset 0 0 0 3px var(--skip);
}
.one-stage.flash-keep::after {
  box-shadow:
    inset 0 0 0 3px var(--acc),
    inset 0 0 40px color-mix(in oklab, var(--acc) 25%, transparent);
}
.focus.bad {
  background: #94a3b8;
}
.focus.warn {
  background: #f59e0b;
}
.focus.ok {
  background: #21dbaa;
}

/* ---------- the same controls on every OS ---------- */
input,
select,
textarea,
button {
  font-family: var(--font);
}
input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
input[type="search"]::-webkit-search-cancel-button {
  width: 14px;
  height: 14px;
  margin-left: 4px;
  cursor: pointer;
  background: var(--mut);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="text"] {
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--bd);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--bd);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--acc);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--acc);
  border: 2px solid var(--surface);
}
input[type="range"]:focus-visible {
  outline-offset: 4px;
}
/* thin token-coloured scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bd2) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bd2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--mut);
  background-clip: content-box;
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- fit, unseen dots, moments ---------- */
.viewport.fit-contain .tile {
  background: var(--stage);
}
.viewport.fit-contain .tile img {
  object-fit: contain;
}
.tile .unseen {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 1.5px rgba(15, 23, 42, 0.55),
    0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
.tile.sel .unseen,
.tile .bcount ~ .unseen {
  display: none;
}
.fit-note {
  font-size: 12px;
  color: var(--mut);
  white-space: nowrap;
}
.mhead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  will-change: transform;
}
.mhead .mh-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mhead.ghost {
  color: var(--mut);
  font-weight: 400;
}
.mhead .mh-look {
  flex: none;
}
.msticky {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 3;
  height: 36px;
  margin-bottom: -36px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--bd);
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.msticky[hidden] {
  display: none;
}
@media (max-width: 900px) {
  .fit-note {
    display: none;
  }
}
.toast.multi {
  gap: 14px;
}
.toast-act.primary {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--acc);
  color: var(--acc-tx);
}

/* ---------- toolbar: fold away, never clip (js sets data-fold) ---------- */
.toolbar {
  overflow: hidden;
  flex-wrap: nowrap;
}
.toolbar > * {
  flex: none;
}
.toolbar .sp {
  flex: 1 1 0;
  min-width: 4px;
}
#moreBtn {
  flex: none;
}
.toolbar[data-fold] .fit-note {
  display: inline;
}
.toolbar:not([data-fold="0"]) .fit-note {
  display: none !important;
}
/* 2: search becomes an icon that opens up */
.toolbar[data-fold="2"] .search,
.toolbar[data-fold="3"] .search,
.toolbar[data-fold="4"] .search,
.toolbar[data-fold="5"] .search,
.toolbar[data-fold="6"] .search {
  width: 34px;
  padding: 0 9px;
  cursor: pointer;
}
.toolbar[data-fold] .search:focus-within {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 5;
  width: auto;
  background: var(--surface);
}
.toolbar {
  position: relative;
}
/* 3: view switch shows icons only */
.toolbar[data-fold="3"] .view-seg .vl,
.toolbar[data-fold="4"] .view-seg .vl,
.toolbar[data-fold="5"] .view-seg .vl,
.toolbar[data-fold="6"] .view-seg .vl {
  display: none;
}
/* 4: size slider folds away (Grid and Rows keep their last size) */
.toolbar[data-fold="4"] .ctl.size,
.toolbar[data-fold="5"] .ctl.size,
.toolbar[data-fold="6"] .ctl.size {
  display: none;
}
/* 5: sort and show live in View options */
.toolbar[data-fold="5"] #sort,
.toolbar[data-fold="5"] #filter,
.toolbar[data-fold="6"] #sort,
.toolbar[data-fold="6"] #filter {
  display: none;
}
/* 6: Details lives in Tools */
.toolbar[data-fold="6"] #detailsBtn {
  display: none;
}
/* the header: Close folder becomes an icon, the name truncates first */
@media (max-width: 1100px) {
  #closeBtn .wide-only {
    display: none !important;
  }
  #closeBtn .narrow-only {
    display: inline-flex !important;
  }
  #closeBtn {
    width: 34px;
    padding: 0;
  }
}
.where {
  flex: 0 1 auto;
}
@media (max-width: 640px) {
  .toolbar {
    overflow: hidden;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ---------- one by one: card, ambient tint, check focus, similar shots ---------- */
.one {
  position: relative;
}
.one-amb {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: transparent;
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 45%, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 80%);
  transition: background-color 0.3s ease;
}
.one-stage,
.filmstrip {
  position: relative;
}
.one-stage .card {
  position: absolute;
  inset: 12px;
  transition: transform 0.18s ease-out, opacity 0.18s ease-out;
  will-change: transform;
  touch-action: none;
}
.one-stage .card img {
  inset: 0;
  width: 100%;
  height: 100%;
}
.one-stage.zoom .card {
  position: static;
  inset: auto;
  transform: none !important;
}
.one-stage .card.dragging {
  transition: none;
}
.one-stage .card.back {
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.one-stage .card.fly-keep {
  transform: translateX(130%) rotate(14deg) !important;
  opacity: 0;
}
.one-stage .card.fly-skip {
  transform: translateX(-130%) rotate(-14deg) !important;
  opacity: 0;
}
.deck-next {
  display: none;
}
.one.deck .deck-next:not([hidden]) {
  display: block;
  position: absolute;
  inset: 22px 26px;
  width: calc(100% - 52px);
  height: calc(100% - 44px);
  object-fit: contain;
  opacity: 0.55;
  transform: scale(0.94);
  filter: saturate(0.85);
  pointer-events: none;
}
body.lite .one.deck .deck-next {
  filter: none;
}
.one.deck .one-stage .card img {
  border-radius: 14px;
}
.one.deck .one-cap,
.one.deck .ql-nav {
  display: none;
}
.one.deck .one-stage {
  touch-action: none;
}
.one.deck .one-stage.zoom {
  touch-action: pan-x pan-y;
}
.check-focus {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 86%, transparent);
  color: var(--tx);
  font-size: 12px;
}
.check-focus[aria-pressed="true"] {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-tx);
}
.one.deck .check-focus span {
  display: none;
}
.sim-strip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 11px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  font-size: 12px;
  max-width: calc(100% - 24px);
}
.sim-strip[hidden] {
  display: none;
}
.sim-t {
  color: var(--mut);
  white-space: nowrap;
}
.sim-row {
  display: flex;
  gap: 4px;
}
.sim-thumb {
  position: relative;
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--bd);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
}
.sim-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sim-thumb .ph .ph-note,
.sim-thumb .ph .ph-name,
.sim-thumb .play {
  display: none;
}
.one.deck .sim-strip {
  bottom: 18px;
}
.ghost-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  color: var(--tx);
  font-size: 13px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: fade 0.2s ease;
}
.ghost-hand .ic {
  width: 34px;
  height: 34px;
  animation: ghostswipe 1.1s ease-in-out 2 alternate;
}
@keyframes ghostswipe {
  0% {
    transform: translateX(-26px) rotate(-8deg);
  }
  100% {
    transform: translateX(26px) rotate(8deg);
  }
}

/* quick look: the same soft tint */
.ql::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--amb, transparent);
  -webkit-mask-image: radial-gradient(ellipse at 45% 45%, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 80%);
  mask-image: radial-gradient(ellipse at 45% 45%, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 80%);
  transition: background-color 0.3s ease;
  pointer-events: none;
}

/* photo first: controls fade when the mouse rests */
.one .ql-nav,
.one-cap,
.filmstrip,
.check-focus,
.sim-strip,
#decide,
.ql-top,
.ql-bar,
.ql-nav {
  transition: opacity 0.4s ease;
}
body.idle .one .ql-nav,
body.idle .one-cap,
body.idle .filmstrip,
body.idle .check-focus,
body.idle .sim-strip,
body.idle[data-view="one"] #decide,
body.idle .ql-top,
body.idle .ql-bar,
body.idle .ql .ql-nav {
  opacity: 0.06;
}

/* ---------- last look ---------- */
.review {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: var(--stage);
  color: var(--tx);
  animation: fade 0.15s ease;
}
.rv-top,
.rv-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) 12px calc(16px + var(--safe-l));
}
.rv-bar {
  padding: 12px calc(16px + var(--safe-r)) calc(14px + var(--safe-b)) calc(16px + var(--safe-l));
  background: var(--surface);
  border-top: 1px solid var(--bd);
}
.rv-title {
  font-weight: 600;
}
.rv-pos,
.rv-name {
  color: var(--mut);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.rv-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.rv-img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
}

/* ---------- play your picks ---------- */
.slides {
  position: fixed;
  inset: 0;
  z-index: 96;
  background: #05070b;
  cursor: none;
  animation: fade 0.3s ease;
}
:root:not([data-theme="dark"]) .slides {
  background: #0f1115;
}
.ss-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.ss-img.on {
  opacity: 1;
}
.ss-img.zoom {
  animation: kenburns 7s linear forwards;
}
@keyframes kenburns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}
.slides.quiet .ss-img {
  transition-duration: 0.3s;
}
.ss-count,
.ss-close {
  position: absolute;
  opacity: 0;
  transition: opacity 0.4s ease;
  color: rgba(255, 255, 255, 0.8);
}
.ss-count {
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ss-close {
  top: calc(16px + var(--safe-t));
  right: calc(16px + var(--safe-r));
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.ss-count.show,
.ss-close.show,
.slides.is-paused .ss-count,
.slides.is-paused .ss-close {
  opacity: 1;
}
.slides:hover {
  cursor: default;
}
.ss-paused {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}

/* ---------- done: a soft finish ---------- */
.empty.done {
  gap: 12px;
}
.empty.done h3 {
  font-size: 20px;
  max-width: 520px;
  line-height: 1.3;
}
.mosaic {
  position: relative;
  width: min(560px, 90%);
  height: 0;
  margin-bottom: 8px;
}
.mos-img {
  position: absolute;
  object-fit: contain;
  border-radius: 6px;
  background: var(--stage);
}

/* 7: the narrowest: Tools shows its icon only (still always there) */
.toolbar[data-fold="7"] #moreBtn .tl,
.toolbar[data-fold="7"] #detailsBtn,
.toolbar[data-fold="7"] .ctl.size,
.toolbar[data-fold="7"] #sort,
.toolbar[data-fold="7"] #filter,
.toolbar[data-fold="7"] .view-seg .vl {
  display: none;
}
.toolbar[data-fold="7"] .search {
  width: 34px;
  padding: 0 9px;
}
.toolbar[data-fold="7"] #moreBtn,
.toolbar[data-fold="7"] #undoBtn {
  padding: 0 9px;
}

/* toasts: under sheets, clear of the bottom bar, and clear of the photo in quick look */
.toast {
  z-index: 78;
}
body.ql-open .toast {
  top: calc(62px + var(--safe-t));
  bottom: auto;
}

/* the decision bar fits whatever room the main column has */
.main {
  container-type: inline-size;
  container-name: main;
}
.decide,
.selbar {
  min-width: 0;
  overflow: hidden;
}
@container main (max-width: 620px) {
  .dbtn {
    min-width: 0;
    padding: 0 14px;
  }
  .dbtn kbd {
    display: none;
  }
  .d-labels {
    display: none;
  }
}
@container main (max-width: 470px) {
  .d-stars {
    display: none;
  }
  .no-touch.d-stars + .d-labels + #dStarsBtn,
  #dStarsBtn {
    display: inline-flex !important;
  }
}
@container main (max-width: 560px) {
  .selbar .btn {
    padding: 0 9px;
  }
  .selbar .sel-count {
    margin-right: 2px;
  }
}

/* ======================================================================
   One by one, with guidance always on screen
   ====================================================================== */
.one-cap {
  display: none;
}
.one-top {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.one-top > * {
  pointer-events: auto;
}
.one-top .check-focus {
  position: static;
}
.one-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  color: var(--tx);
  font-size: 12.5px;
  flex: none;
}
.one-back:hover {
  background: var(--surface-2);
}
.one-where {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  font-size: 12.5px;
}
.one-where .muted {
  font-variant-numeric: tabular-nums;
}
.one-stage .card {
  top: 50px;
}
.one-stage img.deck-next {
  top: 60px;
}
.one .ql-nav {
  opacity: 0.9;
  width: 42px;
  height: 58px;
  margin-top: -29px;
}
.one .ql-nav.prev {
  left: 14px;
}
.one .ql-nav.next {
  right: 14px;
}
.one .ql-nav:disabled {
  visibility: hidden;
}
.one.deck .one-top .one-back span,
.one.deck .one-where .muted {
  display: none;
}

/* decision bar: a row of choices, and the keys under it */
.decide {
  flex-direction: column;
  gap: 6px;
}
.decide-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  row-gap: 8px;
  max-width: 100%;
}
.decide-hint {
  margin: 0;
  font-size: 12px;
  color: var(--mut);
  text-align: center;
}
body:not([data-view="one"]) .decide-hint {
  display: none;
}
.dbtn.undo {
  min-width: 0;
  padding: 0 14px;
  font-weight: 400;
}
.dbtn.undo .ic {
  color: var(--mut);
}
/* (replaces the earlier compaction: the bar wraps rather than hiding choices) */
@container main (max-width: 620px) {
  .dbtn {
    min-width: 0;
    padding: 0 14px;
  }
  .dbtn kbd {
    display: inline-block;
  }
  .d-labels {
    display: flex;
  }
}
@container main (max-width: 470px) {
  .d-stars {
    display: flex;
  }
  #dStarsBtn {
    display: none !important;
  }
  .d-labels {
    display: none;
  }
  .dbtn kbd {
    display: none;
  }
}
body.touch .dbtn kbd {
  display: none;
}

/* filmstrip: what's been decided stays in view */
.strip-item.ghost {
  cursor: default;
}
.strip-item.ghost.skipped {
  opacity: 0.35;
  filter: grayscale(0.6);
}
.strip-item .kept-tick {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--acc);
  color: var(--acc-tx);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.strip-item .kept-tick .ic {
  stroke-width: 3;
}

/* the Details panel always fits: the stage gives way */
.body {
  overflow: hidden;
}
.main {
  min-width: 0;
  overflow: hidden;
}
.inspector {
  width: min(300px, 40vw);
  min-width: 240px;
}
@media (max-width: 900px) {
  .inspector {
    max-width: calc(100% - 24px);
  }
}

#culler:not([hidden]) ~ .toast {
  bottom: calc(max(var(--bar-h, 72px), var(--safe-b, 0px)) + 12px);
}
body.ql-open .toast {
  top: calc(62px + var(--safe-t));
  bottom: auto !important;
}

/* ======================================================================
   Welcome: the calm first screen, then "How it goes" below the fold
   ====================================================================== */
.welcome {
  justify-content: flex-start;
}
.welcome-in {
  max-width: 720px;
  margin: 0 auto;
}
/* the hero fills the first screen, leaving a sliver of what's next */
.w-hero {
  width: 100%;
  max-width: 560px;
  min-height: calc(100vh - 84px - var(--safe-t) - var(--safe-b) - 36px);
  min-height: calc(100dvh - 84px - var(--safe-t) - var(--safe-b) - 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
}
.welcome-act {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.recents {
  margin-top: 32px;
}

/* the intro's drawing palette (own class: .wi-art belongs to the intro), for the sample photos and folders */
.wv-art {
  --wi-surface: var(--surface);
  --wi-fg: var(--tx);
  --wi-muted: var(--mut);
  --wi-accent: var(--accent);
  --wi-a1: #cfe4ea; --wi-a2: #fbe3a8; --wi-a3: #8fbcb2; --wi-a4: #4a8a80;
  --wi-b1: #f4dfd0; --wi-b2: #fff3df; --wi-b3: #dcae90; --wi-b4: #a8705a;
  --wi-c1: #d9ddf1; --wi-c2: #ffffff; --wi-c3: #9ea8d2; --wi-c4: #5d6aa3;
  --wi-d1: #e3edd6; --wi-d2: #fbf2c4; --wi-d3: #a8c48c; --wi-d4: #6a9152;
  --wi-e1: #ecdde6; --wi-e2: #fff4e8; --wi-e3: #c79db4; --wi-e4: #8d6380;
}
[data-theme="dark"] .wv-art {
  --wi-a1: #22414b; --wi-a2: #e8c77e; --wi-a3: #2f6d65; --wi-a4: #1b4a45;
  --wi-b1: #4a3a35; --wi-b2: #f1d9b6; --wi-b3: #8a5f4b; --wi-b4: #5c3d31;
  --wi-c1: #2a3052; --wi-c2: #dfe3f6; --wi-c3: #4a5590; --wi-c4: #2f3866;
  --wi-d1: #2f3c2a; --wi-d2: #e7dca0; --wi-d3: #4f6d3e; --wi-d4: #34492a;
  --wi-e1: #3f3040; --wi-e2: #f0dccc; --wi-e3: #765169; --wi-e4: #4f3547;
}

/* how it goes */
.w-how {
  width: 100%;
  max-width: 640px;
  padding: 8px 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.w-h2 {
  margin: 0 0 28px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
}
.w-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 44px;
}
.w-step {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 28px;
}
/* a thin thread from one step to the next */
.w-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -36px;
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--bd), transparent);
}
.w-step-try {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  gap: 18px;
}
.w-art-box {
  display: grid;
  place-items: center;
}
.w-art {
  width: 220px;
  height: auto;
  overflow: visible;
}
.w-txt h3 {
  margin: 6px 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.w-txt p {
  margin: 0;
  color: var(--mut);
  font-size: 14px;
  line-height: 1.55;
  max-width: 380px;
}
.w-step-try .w-txt p {
  margin: 0 auto;
}
.w-num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc-ink);
  font-size: 12px;
  font-weight: 600;
}
.w-more {
  margin-top: 40px;
  height: 32px;
  gap: 6px;
  font-size: 13px;
  color: var(--mut);
}
.w-more:hover {
  color: var(--tx);
}
.w-how .trust {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  color: var(--faint);
  font-size: 12px;
}
.w-how .trust li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* drawing parts */
.wv-front {
  fill: color-mix(in oklab, var(--wi-muted) 18%, var(--wi-surface));
  stroke: color-mix(in oklab, var(--wi-muted) 30%, transparent);
}
.wv-front.k {
  fill: color-mix(in oklab, var(--wi-accent) 22%, var(--wi-surface));
  stroke: color-mix(in oklab, var(--wi-accent) 45%, transparent);
}
.wv-tick-bg {
  fill: var(--accent);
}
.wv-tick-mark {
  fill: none;
  stroke: var(--accent-fg);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wv-rise,
.wv-drop,
.wv-tick {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
/* before the step is seen (motion allowed only): parts wait */
.w-anim .w-step:not(.in) .wv-rise {
  opacity: 0;
  transform: translateY(34px) scale(0.92);
}
.w-anim .w-step:not(.in) .wv-drop {
  opacity: 0;
  transform: translateY(-26px);
}
.w-anim .w-step:not(.in) .wv-tick {
  opacity: 0;
  transform: scale(0.4);
}
.w-anim .w-step:not(.in) .w-txt {
  opacity: 0;
  transform: translateY(8px);
}
.w-anim .wv-rise,
.w-anim .wv-drop,
.w-anim .w-txt {
  transition:
    opacity 0.45s ease var(--d, 0ms),
    transform 0.6s var(--ease) var(--d, 0ms);
}
.w-anim .wv-tick {
  transform-origin: 50% 50%;
  transition:
    opacity 0.3s ease var(--d, 0ms),
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0ms);
}

/* try it: a small stack of sample photos */
.try {
  width: 100%;
  max-width: 520px;
  padding: 18px 18px 14px;
  border: 1px solid var(--bd);
  border-radius: 18px;
  background: var(--surface);
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.try:focus-visible {
  box-shadow: 0 0 0 3px var(--ring-soft, color-mix(in oklab, var(--accent) 35%, transparent));
}
.try-stage {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
}
.try-sample {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}
.try-chip {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--bd);
  background: var(--surface-2);
  color: var(--mut);
  font-size: 12.5px;
  white-space: nowrap;
}
.try-chip span {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.try-chip b {
  min-width: 14px;
  text-align: center;
  color: var(--tx);
  font-variant-numeric: tabular-nums;
}
.try-chip.keep .ic {
  color: var(--acc-ink);
}
.try-chip.tick {
  animation: try-tick 0.42s var(--ease);
}
@keyframes try-tick {
  40% {
    transform: scale(1.12);
  }
}
.try-pile {
  position: relative;
  width: 210px;
  aspect-ratio: 3 / 2;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.try-card {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: 0 10px 24px -12px rgba(15, 23, 42, 0.35);
  transform: rotate(var(--fan, 0deg));
  transition:
    transform 0.5s var(--ease),
    opacity 0.4s ease;
  cursor: grab;
  will-change: transform;
}
.try-card.dragging {
  transition: none;
  cursor: grabbing;
}
.try-card.leaving {
  pointer-events: none;
  transition:
    transform 0.5s cubic-bezier(0.5, 0, 0.2, 1),
    opacity 0.45s ease 0.1s;
}
.try-art {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
}
.try-card .one-swipe {
  position: absolute;
  top: 10px;
  font-size: 13px;
  padding: 3px 10px;
}
.try-done {
  position: absolute;
  inset: 18px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: try-in 0.4s var(--ease);
}
.try-done[hidden] {
  display: none;
}
.try-done-t {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 600;
}
.try-done .btn-quiet {
  height: 28px;
  font-size: 12px;
}
.try.finished .try-chip {
  visibility: hidden;
}
@keyframes try-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.try-bar {
  display: flex;
  gap: 8px;
}
.try-bar .dbtn {
  height: 36px;
  padding: 0 14px;
}
.try-status {
  margin: 0;
  min-height: 18px;
  color: var(--mut);
  font-size: 12.5px;
}

/* phones: source cards */
.sources {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.source {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--bd);
  border-radius: 16px;
  background: var(--surface);
  color: var(--tx);
  text-align: left;
}
.source:not(:disabled):active {
  background: var(--surface-2);
}
.source:disabled {
  opacity: 0.6;
  cursor: default;
}
.source-ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--acc-soft);
  color: var(--acc-ink);
}
.source-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.source-t {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
}
.source-sub {
  font-size: 13px;
  color: var(--mut);
}
.soon-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--mut);
  font-size: 11px;
  font-weight: 600;
}
.source > .ic {
  color: var(--faint);
}

@media (max-width: 640px) {
  .w-step {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 14px;
  }
  .w-txt p {
    margin: 0 auto;
  }
  .w-art {
    width: 200px;
  }
  .try {
    padding: 16px 12px 12px;
  }
  .try-stage {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 10px;
  }
  .try-pile {
    flex: none;
    width: min(240px, 70vw);
    margin: 0 calc((100% - min(240px, 70vw)) / 2);
  }
  .try-chip.skip {
    order: 1;
  }
  .try-chip.keep {
    order: 2;
  }
}

/* the tour's dim never takes taps; only its card does */
.tour {
  pointer-events: none;
}
.tour-card,
.tour-arrow {
  pointer-events: auto;
}

/* overlay cards and toasts stay clear of status bars */
.tour-card[data-side="sheet-top"] {
  padding-top: calc(16px + var(--safe-t)) !important;
}
.toast {
  max-width: calc(100vw - 32px - var(--safe-l) - var(--safe-r));
}
.try-done .ic.up {
  transform: rotate(180deg);
}

/* coach marks: one line and "Got it", above the decision bar */
.tour-card.coach {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
}
.coach-line {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--mut);
}
.coach-line .tour-title {
  display: inline;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tx);
}
.coach-line .tour-text {
  margin: 0;
}
.tour-card.coach #tourNext {
  flex: none;
  height: 34px;
}

/* the photo library: favorites carry a small heart */
.tile .fav {
  position: absolute;
  left: 7px;
  top: 7px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  pointer-events: none;
}
.tile .fav .ic {
  fill: currentColor;
}
.insp-fav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--mut);
  font-size: 12.5px;
}
.tile:has(.focus) .fav {
  left: 24px;
}

/* ---------- touch: swipes on real phones ---------- */
/* nothing under the deck or the gallery scrolls sideways */
.viewport,
.one,
.one-stage {
  overflow-x: hidden;
}
.one-stage.zoom {
  overflow-x: auto;
}
/* deck images: no drag lift, callout or selection to steal the touch */
.one-stage,
.one-stage img,
.one-stage .card {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
/* tiles and rows: the page scrolls vertically, sideways is the swipe */
body.touch .tile,
body.touch .lrow {
  touch-action: pan-y;
}
body.touch .lrow {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.tile img,
.lrow img {
  -webkit-user-drag: none;
}
/* the reveal behind a swiped tile, like a mail app: teal Keep, slate Skip */
.swipe-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  pointer-events: none;
  z-index: 0;
}
.swipe-reveal.keep {
  justify-content: flex-start;
  background: var(--acc);
  color: var(--acc-tx);
}
.swipe-reveal.skip {
  justify-content: flex-end;
  background: var(--skip, #94a3b8);
  color: #fff;
}
.swipe-reveal span {
  opacity: var(--rv, 0);
  transform: scale(calc(0.85 + 0.15 * var(--rv, 0)));
}
.tile.swiping > :not(.swipe-reveal),
.lrow.swiping > :not(.swipe-reveal) {
  z-index: 1;
  transform: translateX(var(--sx, 0px));
}
.tile.swiping > img,
.tile.swiping > .ph {
  position: relative;
}
.tile.swiping.settle > :not(.swipe-reveal),
.lrow.swiping.settle > :not(.swipe-reveal) {
  transition: transform 0.16s var(--ease, ease-out);
}
.lrow.swiping {
  overflow: hidden;
}
.lrow.swiping > :not(.swipe-reveal) {
  background: var(--bg);
}

/* debug builds: the touch event log (5 taps on the version line in Settings) */
.evlog {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 9999;
  max-height: 46vh;
  overflow: hidden;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.82);
  color: #e2e8f0;
  font: 11px/1.45 ui-monospace, Menlo, monospace;
  pointer-events: none;
}
.evlog-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-weight: 600;
}
.evlog-x {
  pointer-events: auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(226, 232, 240, 0.4);
  border-radius: 6px;
  background: transparent;
  color: inherit;
}
.evlog-r.bad {
  color: #fca5a5;
}

/* windowed lists (vlist.js): fixed row heights */
.tree.virtual .node {
  margin: 0 6px;
  height: 30px;
  box-sizing: border-box;
  width: auto;
}
.hist-list.virtual .hrow,
.hist-list.virtual .hsec {
  box-sizing: border-box;
  margin: 0;
  overflow: hidden;
}
.hist-list.virtual .hsec {
  display: flex;
  align-items: flex-end;
  padding-bottom: 6px;
}

/* ---------- touch: every control is at least 44 px to tap ---------- */
body.touch .icon-btn,
body.touch .toolbar .btn,
body.touch .head .btn,
body.touch #closeBtn {
  min-width: 44px;
  min-height: 44px;
}
body.touch #rootName {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
body.touch .node {
  min-height: 44px;
}
/* the narrowest touch toolbar: 44 px controls only fit without the toolbar's Undo,
   which the decision bar below always has */
body.touch .toolbar[data-fold="7"] #undoBtn {
  display: none;
}

body.touch .one-top button,
body.touch .sim-thumb,
body.touch .mh-look {
  min-height: 44px;
  min-width: 44px;
}

/* ---------- instant pressed feedback on every control (transform and opacity only) ---------- */
button:not(:disabled):active,
[role="button"]:active,
.seg-b:not(:disabled):active,
.node:active,
.fcard:active,
.recent-open:active {
  transform: scale(0.96);
  transition-duration: 0s;
}
.strip-item:active {
  opacity: 0.85;
}
/* big surfaces and positioned controls: only the opacity, so nothing jumps */
.ql-nav:active,
.one-stage button:active,
.sheet-x:active,
.check-focus:active {
  transform: none;
  opacity: 0.7;
}
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active,
  [role="button"]:active,
  .seg-b:not(:disabled):active {
    transform: none;
    opacity: 0.75;
  }
}


/* ---------- One by one: videos sit in the card like photos ---------- */
.one-stage .card .one-vid {
  inset: 0;
  width: 100%;
  height: 100%;
  /* opaque, so the next card never shows through before the poster loads */
  background: var(--stage);
}
.one.deck .one-stage .card .one-vid {
  border-radius: 14px;
  /* touches go to the card (swipe, tap to play), never to the video element */
  pointer-events: none;
}
.one-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s ease;
}
.one-play .ic {
  fill: currentColor;
}
.one-play.playing {
  opacity: 0;
}
.one-play.playing:focus-visible {
  opacity: 1;
}
.one-play:active {
  transform: scale(0.94);
}

/* ---------- quick look on touch: swipe to keep or skip, like the deck ---------- */
.ql-stage.flyout #qlImg {
  transition: transform 0.17s ease-out, opacity 0.17s ease-out;
  opacity: 0;
}
.ql-swipe {
  z-index: 3;
  top: calc(76px + var(--safe-t, 0px));
}
.ql-stage #qlImg {
  -webkit-touch-callout: none;
}

/* ---------- touch: one control size, icons centred (checked by tests/e2e/icons.e2e.mjs) ---------- */
@media (max-width: 760px) {
/* the view switcher: equal 44 px cells, the chosen one a pill inset 4 px in the track */
body.touch .toolbar .view-seg {
  height: 44px;
  padding: 0;
  gap: 0;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--bd);
  align-items: stretch;
}
body.touch .toolbar .view-seg .seg-b {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  gap: 0;
  justify-content: center;
  background: transparent;
  color: var(--mut);
}
body.touch .toolbar .view-seg .seg-b > * {
  position: relative;
  z-index: 1;
}
body.touch .toolbar .view-seg .seg-b.on {
  background: transparent;
  color: var(--bg);
}
body.touch .toolbar .view-seg .seg-b.on::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--fg);
}
body.touch .toolbar .view-seg .seg-b .vl {
  display: none;
}
/* View options, search and Tools: the same 44 px square, same radius and border */
body.touch .toolbar #viewOpts,
body.touch .toolbar[data-fold] .search:not(:focus-within),
body.touch .toolbar #moreBtn,
body.touch .toolbar #undoBtn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  gap: 0;
  justify-content: center;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--surface);
  color: var(--tx);
  box-sizing: border-box;
}
body.touch .toolbar[data-fold] .search:not(:focus-within) input {
  position: absolute;
  width: 1px;
  opacity: 0;
}
body.touch .toolbar[data-fold] .search:focus-within {
  height: 44px;
}
body.touch .toolbar #moreBtn .tl,
body.touch .toolbar #undoBtn .bl {
  display: none;
}
/* the header: icons and the account chip on one centre line, one height */
body.touch .head {
  align-items: center;
}
body.touch .head .icon-btn,
body.touch .head #closeBtn {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
}
body.touch .head #planChip {
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  box-sizing: border-box;
}
/* icons: 20 px on touch, in the header, toolbar and quick look */
body.touch .head .ic,
body.touch .toolbar .ic,
body.touch .ql-top .ic,
body.touch .ql-nav .ic {
  width: 20px;
  height: 20px;
}
body.touch #planChip .ic {
  width: 18px;
  height: 18px;
}
/* quick look: name, "2 of 8" and the buttons share one centre line */
.ql-cap {
  align-items: center;
}
body.touch .ql-top .ql-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 12px;
}
body.touch .ql-top .ql-btn-t {
  display: none;
}
body.touch .ql-nav {
  width: 44px;
  height: 64px;
  opacity: 0.8;
}
}
/* tile corner marks: the same 8 px inset from the rounded corner */
.tile.sel::after {
  top: 8px;
  right: 8px;
}
.tile .unseen {
  top: 10px;
  right: 10px;
}
/* the deck's round buttons (All photos, Check focus): icon only, centred */
.one.deck .one-top .one-back,
.one.deck .check-focus {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  gap: 0;
  justify-content: center;
}

/* ---------- phones: albums and an album's tabs (js/albums.js) ----------
   A source opens on its albums: a large All photos card, then a two-column grid of
   calm cover cards (windowed by row). An album shows To decide / Kept / Skipped as a
   segmented control under the header. No folder tree on phones. */
.culler[data-phone] .side,
.culler[data-phone] .side-scrim,
.culler[data-phone] #treeBtn {
  display: none !important;
}
.culler[data-phone="albums"] > .toolbar,
.culler[data-phone="albums"] > .body {
  display: none !important;
}
.culler[data-phone] .head-logo {
  display: none;
}
.head .back-btn {
  margin-left: -6px;
}
.albums {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: calc(28px + var(--safe-b));
}
.albums-in {
  position: relative;
  padding-top: 14px;
}
.albums-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  font-size: 13px;
  color: var(--mut);
}
.dotpulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mut);
  animation: dotpulse 1.4s ease-in-out infinite;
}
@keyframes dotpulse {
  50% {
    opacity: 0.25;
  }
}
.all-host {
  padding: 0 16px;
}
.acard {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--tx);
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition:
    transform 0.16s var(--ease),
    opacity 0.16s ease;
}
.acard:active {
  transform: scale(0.97);
  transition-duration: 0s;
}
.acover {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--faint);
  isolation: isolate;
  contain: paint;
}
.acard.all .acover {
  aspect-ratio: 16 / 9;
  border-radius: 18px;
}
.acover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.acover img.in {
  opacity: 1;
}
.ameta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 70px;
  min-width: 0;
  padding: 10px 2px 0;
  box-sizing: border-box;
}
.acard.all .ameta {
  height: auto;
  padding-top: 12px;
}
.aname {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acard.all .aname {
  font-size: 20px;
  line-height: 26px;
}
.abar {
  display: flex;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
:root:not([data-theme="dark"]) .abar {
  background: color-mix(in oklab, var(--fg) 8%, var(--surface-2));
}
.abar i {
  display: block;
  height: 100%;
}
.abar .k {
  background: var(--acc);
}
.abar .s {
  background: color-mix(in oklab, var(--mut) 60%, transparent);
}
.aline {
  overflow: hidden;
  min-height: 18px;
  font-size: 13px;
  line-height: 18px;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* counts not known yet: a quiet shimmer, never a wrong number */
.aline.wait i {
  display: block;
  width: 64%;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in oklab, var(--surface-2) 60%, var(--surface)) 50%, var(--surface-2) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.albums-ttl {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 24px 16px 12px;
}
.albums-ttl h2 {
  margin: 0;
  font-size: 17px;
}
.albums-n {
  color: var(--mut);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.albums-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  margin: 0 16px 14px;
  padding: 0 12px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--surface);
  color: var(--faint);
}
.albums-search:focus-within {
  border-color: var(--acc);
}
.albums-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--tx);
  font-size: 16px; /* 16 px: iOS doesn't zoom into the field */
}
.albums-none {
  margin: 4px 16px;
  color: var(--mut);
}
.album-grid .arow {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  padding: 0 16px;
  box-sizing: border-box;
}

/* the tabs: three equal 44 px cells, the chosen one an inset pill (like the view switcher) */
.tabs {
  position: relative;
  display: flex;
  flex: none;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--bd);
}
.tabs[hidden] {
  display: none;
}
.tabs::before {
  content: "";
  position: absolute;
  inset: 8px 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--bd);
  pointer-events: none;
}
.tab {
  position: relative;
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 44px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mut);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.tab > * {
  position: relative;
  z-index: 1;
}
.tab::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--fg);
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 0.16s ease,
    transform 0.16s var(--ease);
}
.tab.on {
  color: var(--bg);
}
.tab.on::before {
  opacity: 1;
  transform: none;
}
.tab-t {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-n {
  flex: none;
  font-weight: 400;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}
.tab-n:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .acard,
  .acover img,
  .tab::before {
    transition: none;
  }
  .acard:active {
    transform: none;
    opacity: 0.8;
  }
  .aline.wait i,
  .dotpulse {
    animation: none;
  }
}
body.lite .aline.wait i {
  animation: none;
}
body.touch .decide .decide-row #dStarsBtn.dbtn.tab-hide {
  display: none !important;
}

/* the phone apps ship free-only (state.js freeOnly): no Pro tags, no account chip */
body.free-only .pro-tag,
body.free-only #planChip,
body.free-only [data-pro] {
  display: none !important;
}

/* ---------- quick look: key chips, the key line and "?" (desktop and web) ---------- */
.ql-bar {
  flex-wrap: wrap;
  row-gap: 8px;
}
.ql-bar .btn .ql-kbd {
  margin-left: 4px;
  font-size: 10px;
  line-height: 14px;
}
.ql-bar .btn.keep .ql-kbd,
.ql-bar .btn.skip .ql-kbd {
  background: color-mix(in oklab, var(--surface) 60%, transparent);
}
.ql-keys {
  flex-basis: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  padding: 0 16px;
  font-size: 11px;
  line-height: 18px;
  color: var(--mut);
  pointer-events: none;
  opacity: 0.85;
}
.ql-keys .qk {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.ql-keys kbd {
  min-width: 16px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 14px;
  background: color-mix(in oklab, var(--surface) 70%, transparent);
}
.ql-keys .qk-or {
  margin: 0 1px;
}
/* touch has no keys: no chips, no key line, no "?" */
body.touch .ql-kbd,
body.touch .ql-keys,
body.touch .ql-help {
  display: none;
}
@media (max-height: 560px) {
  .ql-keys {
    display: none;
  }
}

/* ---------- quiet background patterns (welcome, empty and done) ----------
   A soft dot grid, plus faint photo-tile silhouettes in the brand teal drifting very slowly
   on the welcome screen. CSS only: fixed layers behind the content (the screen is an
   isolated stacking context), no layout, a transform-only animation that stops for reduced
   motion and in lite mode. */
:root {
  --pat-dot: color-mix(in oklab, var(--tx) 12%, transparent);
  --pat-tile: color-mix(in oklab, var(--brand-teal) 5%, transparent);
  --pat-tiles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Crect x='30' y='40' width='84' height='58' rx='8' fill-opacity='1'/%3E%3Crect x='170' y='18' width='50' height='70' rx='8' fill-opacity='0.6'/%3E%3Crect x='290' y='70' width='96' height='64' rx='8' fill-opacity='0.85'/%3E%3Crect x='60' y='190' width='58' height='80' rx='8' fill-opacity='0.7'/%3E%3Crect x='200' y='170' width='104' height='70' rx='8' fill-opacity='1'/%3E%3Crect x='350' y='230' width='40' height='40' rx='8' fill-opacity='0.55'/%3E%3Crect x='20' y='330' width='88' height='60' rx='8' fill-opacity='0.8'/%3E%3Crect x='150' y='300' width='62' height='84' rx='8' fill-opacity='0.65'/%3E%3Crect x='260' y='330' width='96' height='58' rx='8' fill-opacity='0.9'/%3E%3C/svg%3E");
}
[data-theme="dark"] {
  --pat-dot: color-mix(in oklab, var(--tx) 9%, transparent);
  --pat-tile: color-mix(in oklab, var(--brand-teal) 4%, transparent);
}
.welcome,
.empty {
  isolation: isolate;
}
.welcome::before,
.empty::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* a veil of the page colour keeps the middle calm (where the words are); the tiles
     (::after) sit under it, the dots over them */
  background:
    radial-gradient(ellipse 46% 44% at 50% 42%, color-mix(in oklab, var(--bg) 92%, transparent), color-mix(in oklab, var(--bg) 55%, transparent) 60%, transparent 100%),
    radial-gradient(var(--pat-dot) 1px, transparent 1.5px) 0 0 / 22px 22px;
}
.empty::before {
  position: absolute;
}
.welcome::after,
.empty.done::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: -420px;
  bottom: -420px;
  z-index: -2;
  pointer-events: none;
  background: var(--pat-tile);
  -webkit-mask: var(--pat-tiles) 0 0 / 420px 420px repeat;
  mask: var(--pat-tiles) 0 0 / 420px 420px repeat;
  will-change: transform;
  animation: pat-drift 210s linear infinite;
}
.empty.done::after {
  position: absolute;
  right: 0;
  bottom: 0;
  animation: none;
  will-change: auto;
  opacity: 0.8;
}
@keyframes pat-drift {
  to {
    transform: translate3d(-420px, -420px, 0);
  }
}
body.lite .welcome::after {
  animation: none;
  will-change: auto;
}
@media (prefers-reduced-motion: reduce) {
  .welcome::after {
    animation: none;
    will-change: auto;
  }
}
/* Winnow on the web: the page shell while the app starts gets the same dots */
html[data-web]:not([data-ready]) body {
  background-image: radial-gradient(var(--pat-dot) 1px, transparent 1.5px);
  background-size: 22px 22px;
}
