/* Search: gallery timeline */
:root { --topbar-h: 80px; --rail: 168px; }
body { min-height: 100vh; }

/* ---------- Seasons: the background follows the season of the days in view (search.js) ----------
   A soft glow and a faint drawing per season (sun, leaves, snowflakes, blossom), behind everything.
   The four layers sit on top of each other and crossfade as body[data-season] changes (instantly with
   reduced motion: tokens.css). */
.seasons { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.season {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s var(--ease);
  background-repeat: no-repeat;
  background-position: right 24px top calc(var(--topbar-h) + 16px), left 24px bottom 24px, 0 0, 0 0;
  background-size: 260px 220px, 140px 140px, 100% 100%, 100% 100%;
}
body[data-season="winter"] .season[data-s="winter"], body[data-season="spring"] .season[data-s="spring"],
body[data-season="summer"] .season[data-s="summer"], body[data-season="autumn"] .season[data-s="autumn"] { opacity: 1; }
.season[data-s="winter"] {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='220' viewBox='0 0 260 220' fill='none' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(160 80) scale(1.35)' stroke='rgba(150,186,255,.26)' stroke-width='1'><g transform='rotate(0)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(60)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(120)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g></g><g transform='translate(80 150) scale(0.75)' stroke='rgba(150,186,255,.26)' stroke-width='1.7'><g transform='rotate(0)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(60)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(120)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g></g><g transform='translate(220 175) scale(0.6)' stroke='rgba(150,186,255,.26)' stroke-width='2.2'><g transform='rotate(0)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(60)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(120)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140' fill='none' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(60 70) scale(0.95)' stroke='rgba(150,186,255,.26)' stroke-width='1.4'><g transform='rotate(0)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(60)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(120)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g></g><g transform='translate(110 105) scale(0.5)' stroke='rgba(150,186,255,.26)' stroke-width='2.6'><g transform='rotate(0)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(60)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g><g transform='rotate(120)'><line x1='0' y1='-22' x2='0' y2='22'/><path d='M-6 -15L0 -9L6 -15M-6 15L0 9L6 15'/></g></g></svg>"),
    radial-gradient(ellipse 60% 55% at 92% 0%, rgba(120,170,255,.12), transparent 70%),
    radial-gradient(ellipse 45% 45% at 0% 100%, rgba(150,200,255,.06), transparent 70%);
}
.season[data-s="spring"] {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='220' viewBox='0 0 260 220' fill='none' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(160 80) scale(1.4)' stroke-width='0.9'><g stroke='rgba(255,146,196,.24)'><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(0)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(72)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(144)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(216)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(288)'/></g><circle r='3.2' stroke='rgba(160,226,150,.32)'/></g><g transform='translate(85 150) scale(0.85)' stroke-width='1.5'><g stroke='rgba(255,146,196,.24)'><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(0)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(72)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(144)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(216)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(288)'/></g><circle r='3.2' stroke='rgba(160,226,150,.32)'/></g><g transform='translate(215 175) scale(0.7)' stroke-width='1.9'><g stroke='rgba(255,146,196,.24)'><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(0)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(72)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(144)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(216)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(288)'/></g><circle r='3.2' stroke='rgba(160,226,150,.32)'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140' fill='none' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(60 70) scale(1)' stroke-width='1.3'><g stroke='rgba(255,146,196,.24)'><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(0)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(72)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(144)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(216)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(288)'/></g><circle r='3.2' stroke='rgba(160,226,150,.32)'/></g><g transform='translate(108 105) scale(0.6)' stroke-width='2.2'><g stroke='rgba(255,146,196,.24)'><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(0)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(72)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(144)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(216)'/><ellipse cx='0' cy='-11' rx='6.5' ry='11' transform='rotate(288)'/></g><circle r='3.2' stroke='rgba(160,226,150,.32)'/></g></svg>"),
    radial-gradient(ellipse 60% 55% at 92% 0%, rgba(255,140,190,.12), transparent 70%),
    radial-gradient(ellipse 45% 45% at 0% 100%, rgba(140,220,140,.06), transparent 70%);
}
.season[data-s="summer"] {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='220' viewBox='0 0 260 220' fill='none' stroke-linecap='round' stroke-linejoin='round'><g stroke='rgba(255,184,77,.24)' stroke-width='1.6'><circle cx='150' cy='100' r='38'/><line x1='202.4' y1='100' x2='220.3' y2='100'/><line x1='195.4' y1='126.2' x2='210.9' y2='135.2'/><line x1='176.2' y1='145.4' x2='185.2' y2='160.9'/><line x1='150' y1='152.4' x2='150' y2='170.3'/><line x1='123.8' y1='145.4' x2='114.9' y2='160.9'/><line x1='104.6' y1='126.2' x2='89.1' y2='135.2'/><line x1='97.6' y1='100' x2='79.7' y2='100'/><line x1='104.6' y1='73.8' x2='89.1' y2='64.9'/><line x1='123.8' y1='54.6' x2='114.8' y2='39.1'/><line x1='150' y1='47.6' x2='150' y2='29.7'/><line x1='176.2' y1='54.6' x2='185.2' y2='39.1'/><line x1='195.4' y1='73.8' x2='210.9' y2='64.8'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140' fill='none' stroke-linecap='round' stroke-linejoin='round'><g stroke='rgba(255,184,77,.24)' stroke-width='1.4'><circle cx='70' cy='70' r='18'/><line x1='94.8' y1='70' x2='103.3' y2='70'/><line x1='91.5' y1='82.4' x2='98.8' y2='86.7'/><line x1='82.4' y1='91.5' x2='86.7' y2='98.8'/><line x1='70' y1='94.8' x2='70' y2='103.3'/><line x1='57.6' y1='91.5' x2='53.4' y2='98.8'/><line x1='48.5' y1='82.4' x2='41.2' y2='86.7'/><line x1='45.2' y1='70' x2='36.7' y2='70'/><line x1='48.5' y1='57.6' x2='41.2' y2='53.4'/><line x1='57.6' y1='48.5' x2='53.3' y2='41.2'/><line x1='70' y1='45.2' x2='70' y2='36.7'/><line x1='82.4' y1='48.5' x2='86.7' y2='41.2'/><line x1='91.5' y1='57.6' x2='98.8' y2='53.3'/></g></svg>"),
    radial-gradient(ellipse 60% 55% at 92% 0%, rgba(255,184,77,.12), transparent 70%),
    radial-gradient(ellipse 45% 45% at 0% 100%, rgba(255,150,60,.06), transparent 70%);
}
.season[data-s="autumn"] {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='220' viewBox='0 0 260 220' fill='none' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(150 70) rotate(32) scale(1.15)' stroke='rgba(236,112,56,.24)' stroke-width='1.2'><path d='M0 -26C16 -12 16 12 0 26C-16 12 -16 -12 0 -26Z'/><path d='M0 -22V34'/><path d='M0 -6L8 -12M0 6L-8 0'/></g><g transform='translate(205 160) rotate(-40) scale(0.85)' stroke='rgba(236,112,56,.24)' stroke-width='1.6'><path d='M0 -26C16 -12 16 12 0 26C-16 12 -16 -12 0 -26Z'/><path d='M0 -22V34'/><path d='M0 -6L8 -12M0 6L-8 0'/></g><g transform='translate(80 150) rotate(75) scale(0.7)' stroke='rgba(236,112,56,.24)' stroke-width='2'><path d='M0 -26C16 -12 16 12 0 26C-16 12 -16 -12 0 -26Z'/><path d='M0 -22V34'/><path d='M0 -6L8 -12M0 6L-8 0'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140' fill='none' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(60 70) rotate(-25) scale(0.95)' stroke='rgba(236,112,56,.24)' stroke-width='1.5'><path d='M0 -26C16 -12 16 12 0 26C-16 12 -16 -12 0 -26Z'/><path d='M0 -22V34'/><path d='M0 -6L8 -12M0 6L-8 0'/></g><g transform='translate(105 100) rotate(50) scale(0.6)' stroke='rgba(236,112,56,.24)' stroke-width='2.3'><path d='M0 -26C16 -12 16 12 0 26C-16 12 -16 -12 0 -26Z'/><path d='M0 -22V34'/><path d='M0 -6L8 -12M0 6L-8 0'/></g></svg>"),
    radial-gradient(ellipse 60% 55% at 92% 0%, rgba(236,112,56,.12), transparent 70%),
    radial-gradient(ellipse 45% 45% at 0% 100%, rgba(200,90,40,.06), transparent 70%);
}

/* ---------- Layout: a sidebar and the page (a daisyUI drawer; the sidebar stays open from 1024px) ---------- */
:root { --side-w: 248px; }
.app { min-height: 100vh; }
.app-main { min-width: 0; }
.side-wrap { z-index: 30; }
.side {
  width: var(--side-w); min-height: 100%; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 14px 16px; background: var(--panel); border-right: 1px solid var(--line);
}
.side > .logo { padding: 4px 10px 10px; }
.side-nav { width: 100%; min-width: 0; padding: 0; gap: 2px; font-size: 15px; }
.side-nav > li { width: 100%; min-width: 0; }
.side-nav svg { width: 18px; height: 18px; flex: none; }
.side-nav li > a, .side-nav li > button {
  gap: 12px; padding: 9px 12px; border: 0; border-radius: 6px; background: none; color: var(--muted);
  font: 500 15px var(--font); text-decoration: none; text-align: left; width: 100%; cursor: pointer;
}
.side-nav li > a:hover, .side-nav li > button:hover { color: var(--text); background: var(--panel-3); }
.side-nav li > .d-menu-active, .side-nav li > button[aria-expanded="true"] { color: var(--text); background: var(--panel-3); }
.side-nav li > .menu-list { display: block; padding: 6px; cursor: auto; user-select: auto; }
.side-nav li > .menu-list[hidden] { display: none; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.side-foot .d-btn { height: 38px; font-size: 14px; }
/* The account: "Sign in", or who's signed in and their plan (side-account.js) */
.side-account { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.side-account:hover { border-color: var(--line-2); background: var(--panel-3); }
.side-account[hidden] { display: none; }
.side-account .avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 14px/1 var(--font); }
.side-account .avatar.out { background: var(--panel-3); color: var(--muted); }
.side-account .avatar svg { width: 17px; height: 17px; }
.side-account-text { display: grid; min-width: 0; line-height: 1.3; }
.side-account-text b { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.side-account-text span { font-size: 12px; color: var(--muted); }
.side-signin { font-size: 12.5px; color: var(--muted); text-align: center; text-underline-offset: 3px; }
.side-signin:hover { color: var(--text); }
.side-signin[hidden] { display: none; }
.side-pause { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.side-pause:hover { border-color: var(--muted); }
.side-del .d-btn { color: var(--danger-warm); border-color: currentColor; background: transparent; }
.side-del .d-btn:hover, .side-del .d-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--danger-warm) 12%, transparent); }
.side-del .d-btn svg { width: 15px; height: 15px; }
/* The menus open beside or above their buttons in the sidebar */
.side .menu-list { left: 0; right: auto; width: 100%; min-width: 0; }
.side .coll-menu { position: static; margin-top: 4px; box-shadow: none; background: var(--bg); }
.side-del .menu-list { top: auto; bottom: calc(100% + 6px); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 12px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
}
.nav-open svg { width: 20px; height: 20px; }
.top-logo { font-size: 16px; }
@media (min-width: 1024px) { .top-logo { display: none; } }
.search.d-input {
  flex: 1 1 300px; gap: 12px; height: 48px; padding: 0 14px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: none; outline: 0;
}
.search.d-input:focus-within { border-color: var(--accent-text); outline: 0; box-shadow: none; }
.search-icon { width: 19px; height: 19px; color: var(--muted); flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 400 17px var(--font); color: var(--text);
}
.search input::placeholder { color: var(--dim); }
.search .d-kbd { font: 500 12px var(--font); color: var(--dim); background: transparent; border-color: var(--line-2); }

/* The five type filters: a joined row; "on" is a lime fill */
.filters { display: flex; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 13.5px var(--font); padding: 0 13px; height: 40px;
  border: 1px solid var(--line-2); background: transparent; color: var(--dim); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip + .chip { margin-left: -1px; }
.chip:first-child { border-radius: 8px 0 0 8px; }
.chip:last-child { border-radius: 0 8px 8px 0; }
.chip .box { width: 13px; height: 13px; border-radius: 3px; border: 1.5px solid currentColor; display: grid; place-items: center; }
.chip .box svg { width: 9px; height: 9px; opacity: 0; }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); position: relative; z-index: 1; }
.chip[aria-pressed="true"] .box { border-color: var(--accent-ink); }
.chip[aria-pressed="true"] .box svg { opacity: 1; }
.chip:not([aria-pressed="true"]):hover { color: var(--text); }
.chip[aria-pressed="true"]:hover { background: var(--accent-hover); }
.chip.nope { animation: nope .35s; }
@keyframes nope { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* Which computer found it: only with sync on two or more computers */
.device-filter select.d-select {
  height: 40px; max-width: 220px; font: 500 14px var(--font); color: var(--text);
  background-color: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: none;
}
.device-filter select.d-select:focus { outline: 0; border-color: var(--accent-text); }
.count { margin: 0 0 0 auto; font-size: 14px; color: var(--muted); white-space: nowrap; }
.count b { color: var(--text); font-weight: 600; }
.demo-note { font-size: 13px; color: var(--dim); }

/* ---------- At a glance (daisyUI stats) ---------- */
.glance { max-width: 1360px; margin: 0 auto; padding: 22px 24px 0; }
.glance[hidden] { display: none; }
.glance-stats { width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; }
.glance .d-stat { padding: 16px 22px; border-color: var(--line-2); border-style: solid; }
.glance .d-stat-title { font-size: 13px; color: var(--muted); }
.glance .d-stat-value { font: 650 30px/1.15 var(--font); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.glance .d-stat-value.g-accent { color: var(--accent-text); }
.glance .d-stat-desc { font-size: 12.5px; color: var(--dim); }
.glance .d-stat-figure { color: var(--accent-text); }
.glance .d-stat-figure svg { width: 18px; height: 18px; }

/* ---------- Timeline ---------- */
.timeline { max-width: 1360px; margin: 0 auto; padding: 28px 24px 96px; }
/* Each day is a stop on a timeline: the label on the left, a lime dot and a line, then the day's things */
.day { display: grid; grid-template-columns: var(--rail) 1fr; gap: 44px; padding: 0 0 36px; position: relative; }
.day-rail { position: relative; }
.day-rail::before { content: ''; position: absolute; top: 6px; bottom: -42px; right: -23px; width: 2px; border-radius: 1px; background: var(--line-2); }
.day:last-child .day-rail::before { bottom: 0; }
.day-rail::after { content: ''; position: absolute; top: 8px; right: -28px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-mark); box-shadow: 0 0 0 4px var(--bg); }
.day-label { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 2px; justify-items: end; text-align: right; }
.day-label strong { font: 650 22px/1.1 var(--font); letter-spacing: -.02em; }
.day-label span { font-size: 14px; color: var(--muted); }
.day-label em {
  margin-top: 8px; font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--text);
  padding: 1px 9px; border: 1px solid var(--line-2); border-radius: 999px;
}

.day-body { min-width: 0; display: grid; gap: 26px; align-content: start; }

/* Justified rows: every tile keeps its picture's shape (--a = width / height, set per tile). Tiles in a
   row grow in proportion to their shape, so a row fills the width at one shared height; the last row
   stays at the base height (the ::after spacer takes the slack). */
.rows { --row-h: 190px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.rows::after { content: ''; flex: 999 1 0; }
.rows > .tile, .rows > .tile-wrap { flex: var(--a) 1 calc(var(--a) * var(--row-h)); aspect-ratio: var(--a); min-width: 0; }
.tile-wrap { position: relative; }
.tile-wrap > .tile { width: 100%; height: 100%; }

/* ---------- Tiles ---------- */
.tile {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--r); background: var(--panel-3); color: var(--text); text-decoration: none;
  outline: 1px solid transparent; outline-offset: -1px;
  animation: tile-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms);
}
@keyframes tile-in { from { opacity: 0; transform: translateY(8px); } }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }
.tile:hover { outline-color: var(--line-2); }
.rows > .tile, .tile-wrap > .tile { border-radius: 10px; }
.tile:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* On top of a picture (badges, the hover strip, the tile buttons): the dark palette in both themes */
.play, .price, .info, .score, .tile-wrap > .acts {
  --text: var(--photo-text); --muted: var(--photo-muted); --dim: var(--photo-dim); --line-2: var(--photo-line); --panel-3: var(--photo-hover);
  --accent-text: var(--accent); --on-text: var(--accent-ink); color: var(--text);
}

/* video: a small play mark in the corner, clear of the thumbnail's own text */
.play {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(8,8,10,.72); transition: opacity .2s;
}
.play svg { width: 10px; height: 10px; fill: #fff; margin-left: 2px; }
.tile:hover .play, .tile:focus-visible .play, .tile.show-info .play { opacity: 0; }

/* a product with no picture: plain text tile */
.tile.t-text { padding: 14px 16px 16px; display: flex; flex-direction: column; background: var(--panel-2); border: 1px solid var(--line); }
.htag, .htext { position: relative; z-index: 1; }
.htag { font: 600 11px var(--font); color: var(--muted); }
.htext {
  margin-top: auto; font: 600 17px/1.25 var(--font); letter-spacing: -.015em;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* headlines: a reading list under the day's pictures */
.reads-title { font: 600 13px var(--font); color: var(--muted); margin: 0 0 8px; }
.read-list {
  list-style: none; margin: 0; padding: 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); column-gap: 28px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
}
.read-list li { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); margin-top: -1px; }
.read {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline;
  padding: 11px 0; color: var(--text); text-decoration: none;
}
.read .fav { align-self: center; }
.read-text { font: 500 15px/1.35 var(--font); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.read-meta { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.read:hover .read-text { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.read:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 2px; }
.reads:not(.open) .read-list li:nth-child(n+9) { display: none; }
.more { margin-top: 10px; font: 500 14px var(--font); padding: 7px 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; }
.more:hover { border-color: var(--muted); background: var(--panel-2); }

/* product: price badge, with the earlier price when it changed */
.price {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 8px; border-radius: 4px; background: rgba(8,8,10,.82);
  font: 600 13px var(--font); color: var(--text); font-variant-numeric: tabular-nums;
}
.price s { font-weight: 500; font-size: 12px; color: var(--muted); }
.price.down b { color: var(--accent-text); }
.tile.t-text .price { position: relative; left: auto; top: auto; align-self: flex-start; margin-top: 10px; z-index: 1; }
.tile.t-text .price + .htext, .tile.t-text .htext:has(+ .price) { -webkit-line-clamp: 3; }

/* hover info: a solid strip that slides up */
.info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: grid; gap: 1px; padding: 10px 12px 11px;
  background: rgba(8,8,10,.9); border-top: 1px solid var(--line-2);
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.tile:hover .info, .tile:focus-visible .info, .tile.show-info .info { transform: translateY(0); }
.info-src { display: flex; align-items: center; gap: 8px; font: 600 13px var(--font); min-width: 0; }
.fav { flex: none; width: 16px; height: 16px; border-radius: 3px; display: grid; place-items: center; font: 700 10px var(--font); color: var(--on-text); background: var(--text); }
.info-src .dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-src .kind { margin-left: auto; flex: none; font-weight: 500; font-size: 12px; color: var(--dim); }
.info-title { font-size: 12.5px; color: rgba(237,237,240,.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-tags { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Synced or not, to what, and which computer found it (search.js: placeOf); the dot says it at a glance */
.info-sync { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-sync::before, .read[data-sync] .read-meta::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; background: var(--dim); }
.info-sync[data-sync="synced"]::before, .read[data-sync="synced"] .read-meta::before { background: var(--accent-mark); }
.info-sync[data-sync="pending"]::before, .read[data-sync="pending"] .read-meta::before { background: var(--orange-text); }
.info-when { font-size: 12px; color: var(--muted); display: flex; gap: 8px; white-space: nowrap; overflow: hidden; }
.info-when .open { margin-left: auto; color: var(--accent-text); font-weight: 600; }

/* ---------- Empty ---------- */
.empty { max-width: 460px; margin: 0 auto; text-align: center; padding: 80px 16px; }
.empty-title { font: 600 21px/1.3 var(--font); letter-spacing: -.02em; margin: 0 0 8px; }
.empty-sub { color: var(--muted); margin: 0; }
.empty-sub button { font: 500 14px var(--font); padding: 5px 10px; margin: 6px 2px 0; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; }
.empty-sub button:hover { border-color: var(--muted); }

/* ---------- Embed (inside the landing page) ---------- */
body.embed { background: var(--panel); min-height: 0; }
body.embed [data-hide-embed], body.embed .demo-note { display: none; }
body.embed .topbar { background: var(--panel); }
body.embed .topbar-inner { padding: 14px 18px; }
body.embed .timeline { padding: 22px 18px 40px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .topbar-inner { padding: 12px 16px; gap: 10px; }
  .search.d-input { flex-basis: 100%; order: 3; height: 46px; }
  .search input { font-size: 16px; }
  .search kbd, .demo-note { display: none; }
  .filters { order: 4; }
  .device-filter { order: 5; }
  .count { order: 2; }
  .glance { padding: 16px 16px 0; }
  .glance .d-stat { padding: 12px 16px; }
  .glance .d-stat-value { font-size: 24px; }
  .filters { flex: 1 1 100%; }
  .chip { flex: 1; justify-content: center; gap: 5px; padding: 0 4px; font-size: 12.5px; }
  .chip .box { width: 12px; height: 12px; }
  .device-filter, .device-filter select.d-select { width: 100%; max-width: none; }
  .timeline { padding: 8px 16px 64px; }
  .day { grid-template-columns: 1fr; gap: 10px; padding: 0 0 20px; border-top: 0; }
  .day-rail::before, .day-rail::after { display: none; }
  .day-label {
    justify-items: start; text-align: left;
    top: var(--topbar-h); z-index: 5; grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px;
    margin: 0 -16px; padding: 12px 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  body.embed .day-label { background: var(--panel); }
  .day-label strong { font-size: 18px; }
  .day-label em { margin: 0; }
  .rows { --row-h: 118px; gap: 6px; }
  .htext { font-size: 15px; }
  .read { grid-template-columns: 16px minmax(0, 1fr); }
  .read-meta { grid-column: 2; }
}

/* ---------- Extension-only ---------- */
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px; padding: 6px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.menu-list > button { display: block; width: 100%; text-align: left; font: 500 14px var(--font); padding: 9px 10px; border: 0; border-radius: 5px; background: none; cursor: pointer; }
.menu-list > button:hover { background: var(--panel-3); } /* the menu's items, not the Add button in its form */
.menu-list > button.danger { color: var(--danger-warm); }
.status { max-width: 1360px; margin: 0 auto; padding: 10px 24px 0; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.status[hidden] { display: none; }
.status .bar { width: 120px; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.status .bar i { display: block; height: 100%; background: var(--accent-mark); width: 0; transition: width .3s; }
.status.warn { color: var(--orange-text); }
/* In offline mode, and when a payment failed */
.plan-banner { max-width: 1312px; margin: 12px auto 0; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 8px; }
.plan-banner[hidden] { display: none; }
.plan-banner .btn { padding: 8px 12px; font-size: 13px; }
.plan-banner .btn[hidden] { display: none; }
/* Pro running out (cancelled, or a payment failed): the once-a-day warning */
.leaving { width: min(calc(100% - 32px), 540px); padding: 24px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: var(--shadow-dialog); }
.leaving::backdrop { background: var(--scrim); }
.leaving h2 { margin: 0 0 8px; font: 600 19px/1.3 var(--font); letter-spacing: -.01em; text-wrap: balance; }
.leaving p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.leaving-note { margin-top: 12px !important; color: var(--text) !important; }
.leaving-note:empty { display: none; }
.leaving-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.leaving-actions .btn { padding: 10px 14px; font-size: 14px; }
.leaving-actions .btn:disabled { opacity: .5; cursor: default; }
@media (max-width: 1360px) { .plan-banner { margin-inline: 24px; } }
@media (max-width: 760px) { .plan-banner { margin-inline: 16px; } }
.debug-bar { max-width: 1360px; margin: 0 auto; padding: 10px 24px 0; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.debug-bar[hidden] { display: none; }
.score { position: absolute; right: 8px; top: 8px; z-index: 4; font: 600 11px var(--font); padding: 2px 6px; border-radius: 4px; background: rgba(8,8,10,.85); color: var(--accent-text); }
@media (max-width: 760px) { .status { padding-inline: 16px; } }

/* ---------- Search with a picture ---------- */
.pic-btn {
  flex: none; width: 36px; height: 36px; margin-right: -8px; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.pic-btn:hover { color: var(--text); background: var(--panel-3); }
.pic-btn svg { width: 20px; height: 20px; }
.drop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--overlay); outline: 2px dashed var(--accent-text); outline-offset: -14px; pointer-events: none; }
.drop[hidden] { display: none; }
.drop p { font: 600 22px var(--font); letter-spacing: -.01em; margin: 0; padding: 0 24px; text-align: center; }

/* ---------- Tile buttons: more like this, add to a collection ---------- */
.acts { position: absolute; right: 8px; top: 8px; z-index: 4; display: flex; gap: 6px; }
.act {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border-radius: 6px; border: 1px solid var(--line-2); background: rgba(8,8,10,.84); color: var(--text);
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.act svg { width: 16px; height: 16px; }
.act:hover { background: var(--panel-3); }
.act.on { color: var(--accent-text); opacity: 1; }
.act.on svg { fill: currentColor; }
.tile-wrap:hover .act, .tile-wrap:focus-within .act, .read-list li:hover .act, .read-list li:focus-within .act, .act[aria-expanded="true"] { opacity: 1; }
.tile-wrap:has(.act.on) .play { right: 48px; }
.read-list .act { background: transparent; border-color: transparent; }
.read-list .act:hover { border-color: var(--line-2); }
@media (hover: none) { .act { opacity: 1; } }

/* ---------- Mode bar: more like this, a picture, a collection ---------- */
.modebar { max-width: 1360px; margin: 0 auto; padding: 20px 24px 0; }
.modebar-inner { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.mode-thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; flex: none; background: var(--panel-3); }
.mode-text { min-width: 0; flex: 1; }
.mode-eyebrow { margin: 0; font: 600 12px var(--font); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.mode-title { margin: 2px 0 0; font: 600 19px/1.25 var(--font); letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.mode-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mode-acts .btn { padding: 9px 12px; font-size: 14px; }
.mode-acts .btn.danger { color: var(--danger); }
.mode-acts .btn.danger:hover { border-color: var(--danger); }
.mode-close { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line-2); background: none; color: var(--text); cursor: pointer; }
.mode-close:hover { background: var(--panel-2); border-color: var(--muted); }
.mode-close svg { width: 16px; height: 16px; }
.mode-rename { display: flex; gap: 8px; margin-top: 4px; }
.mode-rename input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--accent-text); background: var(--panel-2); color: var(--text); font: 600 16px var(--font); }
.mode-rename input:focus { outline: 0; }
.mode-rename .btn { padding: 0 12px; height: 38px; font-size: 14px; }

/* Where the same picture was seen ("Where have I seen this?", "More like this") */
.where { list-style: none; margin: 0; padding: 0; }
.where li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.where li .fav { align-self: center; }
.where a { color: var(--text); text-decoration: none; font: 500 15px/1.35 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.where a:hover { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.where span { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.waiting { padding: 64px 16px; text-align: center; color: var(--muted); }

/* ---------- On this day ---------- */
.memories { max-width: 1360px; margin: 0 auto; padding: 22px 24px 0; }
.mem-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.mem-head h2 { margin: 0; font: 600 15px var(--font); }
.mem-hide { margin-left: auto; font: 500 13px var(--font); color: var(--dim); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.mem-hide:hover { color: var(--text); }
.mem-cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 340px); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.mem { border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); padding: 12px; display: grid; gap: 10px; align-content: start; }
.mem-top { display: grid; gap: 1px; text-align: left; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; }
.mem-top:disabled { cursor: default; }
.mem-top strong { font: 600 15px var(--font); }
.mem-top span { font-size: 13px; color: var(--muted); }
.mem-top:not(:disabled):hover strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
.mem-pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mem-pics a { aspect-ratio: 1; border-radius: 5px; overflow: hidden; background: var(--panel-3); }
.mem-pics img { width: 100%; height: 100%; object-fit: cover; }
.mem-texts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mem-texts a { font-size: 13.5px; line-height: 1.35; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mem-texts a:hover { text-decoration: underline; text-decoration-color: var(--muted); }
.day.flash { animation: day-flash 1.4s var(--ease); }
@keyframes day-flash { 0%, 40% { background: rgba(var(--accent-rgb), .06); } }

/* ---------- Collections ---------- */
.coll-menu { min-width: 270px; }
.coll-menu > button { display: flex; align-items: baseline; gap: 12px; }
.coll-menu > button span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-menu > button em { font-style: normal; font-size: 13px; color: var(--dim); }
.coll-menu > button[aria-current="true"] span { color: var(--accent-text); }
.menu-hint { margin: 4px 6px 8px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.pop { position: fixed; z-index: 40; width: 280px; padding: 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.pop-title { margin: 2px 4px 8px; font: 600 14px var(--font); }
.pop-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.pop-list label { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.pop-list label:hover { background: var(--panel-3); }
.pop-list input { accent-color: var(--accent-text); width: 16px; height: 16px; margin: 0; flex: none; }
.pop-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-hint { margin: 0 4px 8px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.pop-new, .menu-new { display: flex; gap: 6px; margin-top: 8px; }
.menu-new { margin: 6px 0 0; padding: 8px 4px 2px; border-top: 1px solid var(--line-2); }
.pop-new input, .menu-new input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 500 14px var(--font); }
.pop-new input:focus, .menu-new input:focus { outline: 0; border-color: var(--accent-text); }
.pop-new .btn, .menu-new .btn { padding: 0 12px; height: 36px; font-size: 14px; }

/* Narrow (the side panel, a phone): the five filters fit without their tick boxes; "on" is a lime underline */
@media (max-width: 440px) {
  .chip { padding: 0 2px; font-size: 12px; min-width: 0; }
  .chip .box { display: none; }
}

/* ---------- Side panel (search.html?panel=1) ---------- */
#open-tab[hidden] { display: none; }
#open-tab { text-decoration: none; }
body.panel #open-tab { height: 32px; font-size: 13px; }
body.panel #pause, body.panel #stats, body.panel .menu:has(#del-btn) { display: none; }
body.panel .side-foot { display: none; }

@media (max-width: 760px) {
  .modebar, .memories { padding-inline: 16px; }
  .modebar-inner { flex-wrap: wrap; }
  .mode-acts { width: 100%; justify-content: flex-start; order: 3; }
  .mem-cards { grid-auto-columns: minmax(230px, 82%); }
}
