/* ================= login / expired ================= */
.login { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden; background: var(--surface-2); }
.login-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: slowzoom 20s ease-out forwards; }
.login-shade { position: absolute; inset: 0; }
.login.has-cover .login-shade { background: linear-gradient(180deg, rgba(10, 12, 16, .15), rgba(10, 12, 16, .55)); }
.login-card {
  position: relative; width: min(390px, 100%); padding: 30px 26px 24px; text-align: center;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(12px); border-radius: 22px; box-shadow: var(--shadow-lg);
  animation: rise .7s var(--ease) both;
}
.login-card .field { text-align: start; }
.login-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; box-shadow: 0 0 0 3px #fff, 0 2px 10px rgba(0, 0, 0, .15); }
.login-logo { max-height: 56px; max-width: 180px; margin: 0 auto 16px; object-fit: contain; }
.login-studio { font-size: 14px; letter-spacing: .06em; color: var(--muted); margin-bottom: 16px; }
.login-kicker { font-size: 14px; color: var(--accent); margin: 0 0 4px; font-weight: 500; }
.login-title { font-family: var(--display); font-weight: 400; font-size: 34px; margin-bottom: 4px; }
.login-date { color: var(--muted); margin-bottom: 22px; }
.login-error { color: var(--danger); min-height: 1.4em; font-size: 14px; margin: -4px 0 8px; }
.login-card .contacts { margin-top: 18px; }
.expired-ic { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 18px auto 10px; background: var(--accent-soft); color: var(--accent); }
.expired-ic .ic { width: 26px; height: 26px; }
.expired-title { font-size: 19px; font-weight: 600; margin-bottom: 4px; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes slowzoom { to { transform: scale(1); } }
@keyframes bob { 50% { transform: translateY(5px); } }
@keyframes pop { 40% { transform: scale(1.25); } }

/* ================= contacts ================= */
.contacts { display: flex; gap: 2px; flex-wrap: wrap; }
.contacts.center { justify-content: center; }
.contact { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s; }
.contact:hover { background: var(--accent-soft); color: var(--accent); }
.contact .ic { width: 19px; height: 19px; }

.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.avatar.lg { width: 64px; height: 64px; margin: 0 auto 8px; }
.avatar.xl { width: 84px; height: 84px; margin: 0 auto 12px; }

/* ================= hero ================= */
.hero { position: relative; height: 100svh; min-height: 480px; overflow: hidden; background: #111318; color: #fff; display: flex; flex-direction: column; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: slowzoom 14s ease-out forwards; transform: scale(1.06); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .3) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .6) 100%); }
.hero-top { position: relative; padding: calc(22px + env(safe-area-inset-top)) 16px 0; text-align: center; font-size: 14px; letter-spacing: .06em; opacity: .95; }
.hero-top img { max-height: 48px; max-width: 170px; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .3)); }
.hero-text { position: relative; margin-top: auto; padding: 0 20px calc(34px + env(safe-area-inset-bottom)); text-align: center; animation: rise 1s .2s var(--ease) both; text-shadow: 0 1px 18px rgba(0, 0, 0, .35); }
.hero-kicker { font-size: 15px; margin: 0 0 8px; opacity: .9; }
.hero-names { font-family: var(--display); font-weight: 300; font-size: clamp(42px, 11vw, 92px); line-height: 1.05; margin-bottom: 8px; }
.hero-date { font-size: 17px; letter-spacing: .1em; opacity: .9; margin-bottom: 24px; font-variant-numeric: tabular-nums; }
.hero-cta { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font-size: 14px; cursor: pointer; padding: 6px 12px; }
.hero-cta .ic { width: 26px; height: 26px; animation: bob 1.8s ease-in-out infinite; }
.hero.no-cover { height: auto; min-height: 0; background: var(--surface-2); color: var(--ink); padding: 30px 0 0; }
.hero.no-cover .hero-shade, .hero.no-cover .hero-cta { display: none; }
.hero.no-cover .hero-text { text-shadow: none; padding-top: 20px; }
.hero.no-cover .hero-kicker { color: var(--accent); }

/* ================= top bar ================= */
.topbar {
  position: sticky; top: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 8px 16px; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
}
.tb-start { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tb-title strong { font-family: var(--display); font-weight: 500; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-end { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }

.cat-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink-2); transition: background .15s, color .15s, box-shadow .15s;
}
.cat-tab .ic { width: 18px; height: 18px; }
.cat-tab b { font-size: 12.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .05); padding: 1px 7px; border-radius: 99px; }
.cat-tab:hover { color: var(--ink); }
.cat-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.cat-tab.on .ic { color: var(--accent); }
.cat-tab.on b { background: var(--accent-soft); color: var(--accent); }
.cat-tab.full b { background: var(--sel-soft); color: var(--sel); }

.banner { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px; font-size: 14px; background: var(--accent-soft); color: var(--accent-strong); text-align: center; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }

/* ================= popover ================= */
.pop {
  position: fixed; z-index: 400; width: min(340px, calc(100vw - 16px)); padding: 18px 18px 16px; background: #fff; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(16, 18, 24, .2), 0 0 0 1px rgba(16, 18, 24, .04); animation: rise .2s var(--ease);
}
.pop[hidden] { display: none; }
.pop-x { position: absolute; top: 8px; left: 8px; width: 34px; height: 34px; color: var(--muted); }
.pop-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding-left: 30px; }
.pop-head .ic { color: var(--accent); }
.pop-head strong { font-size: 17px; }
.pop-head.small { flex-direction: column; align-items: flex-start; gap: 0; padding: 0; }
.pop-count { margin-inline-start: auto; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pop-desc { color: var(--ink-2); font-size: 14.5px; margin: 10px 0; }
.pop-facts { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.pop-facts li { display: flex; align-items: center; gap: 8px; }
.pop-facts .ic { width: 17px; height: 17px; color: var(--muted); }
.bar { height: 6px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .35s var(--ease); }
.tag-list { display: grid; gap: 2px; margin-top: 8px; }
.tag-opt { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.tag-opt:hover { background: var(--surface-2); }
.tag-opt input, .fcheck input, .confirm-check input { position: absolute; opacity: 0; pointer-events: none; }
.tag-opt i, .fcheck i, .confirm-check i {
  width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.6px solid #c4c9d2; display: grid; place-items: center; color: transparent; transition: all .15s; background: #fff;
}
.tag-opt i .ic, .fcheck i .ic, .confirm-check i .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.tag-opt input:checked + i, .fcheck input:checked + i, .confirm-check input:checked + i { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-opt input:focus-visible + i, .fcheck input:focus-visible + i, .confirm-check input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ================= shell ================= */
.shell { display: flex; align-items: flex-start; max-width: 2000px; margin: 0 auto; }
.main { flex: 1; min-width: 0; padding: 10px 14px 120px; }
.guest .main { padding-bottom: 40px; }
.side { flex: none; width: 270px; position: sticky; top: var(--bar-h, 64px); max-height: calc(100dvh - var(--bar-h, 64px)); overflow: auto; padding: 14px 14px 30px; scrollbar-width: thin; }
.side-r { border-left: 1px solid var(--line); }
.side-l { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.side-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 16px; padding: 0 2px 6px; }
.side-sec { padding: 6px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side-sec:last-of-type { border-bottom: 0; }
.side-sec h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 0 4px 10px; }
.side-sec h3 .ic { width: 18px; height: 18px; color: var(--accent); }
.side-sec h3 small { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; }

/* people */
.people-head { display: flex; align-items: center; justify-content: space-between; }
.people-head h3 { margin-bottom: 10px; }
.selfie-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; margin-bottom: 10px; }
.selfie-btn .ic { width: 17px; height: 17px; }
.selfie-btn:hover { background: color-mix(in srgb, var(--accent) 18%, white); }
.faces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; justify-items: center; }
.face { position: relative; width: 66px; height: 66px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--surface-2); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); transition: box-shadow .15s, transform .15s; }
.face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.face b { position: absolute; bottom: -3px; left: -3px; min-width: 24px; height: 20px; padding: 0 5px; border-radius: 99px; background: #fff; color: var(--accent); font-size: 11px; font-weight: 600; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); font-variant-numeric: tabular-nums; }
.face:hover { transform: scale(1.05); }
.face.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px var(--accent); }
.faces-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 16px 10px; justify-items: center; max-height: 65vh; overflow: auto; padding: 6px; }
.faces-all .face { width: 72px; height: 72px; }
.link-btn { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 12px; border: 0; background: none; color: var(--accent); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.link-btn .ic { width: 16px; height: 16px; }
.selfie-hint { text-align: center; margin: 8px 0 0; }

/* folders */
.frow { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 10px; }
.frow:hover { background: var(--surface-2); }
.fcheck { position: relative; display: grid; place-items: center; padding: 6px 2px; cursor: pointer; }
.fname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 0; cursor: pointer; text-align: start; font-size: 14.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow:not(.on) .fname { color: var(--muted); }
.fname .num { color: var(--accent); font-weight: 500; font-size: 13px; min-width: 18px; }
.fcount { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fcount b { color: var(--sel); font-weight: 600; }

/* summary (left) */
.sum-card { padding: 16px; border-radius: 16px; background: var(--surface-2); }
.sum-label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.sum-label .ic { width: 17px; height: 17px; color: var(--accent); }
.sum-big { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; }
.sum-big b { font-size: 38px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sum-big span { color: var(--muted); font-size: 15px; }
.sum-left { font-size: 13px; color: var(--muted); margin-top: 6px; }
.sum-filters { display: grid; gap: 6px; }
.sfilter { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 14.5px; text-align: start; transition: border-color .15s, background .15s; }
.sfilter span:not(.sf-ic) { flex: 1; }
.sfilter b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sf-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 14px; flex: none; }
.sf-ic .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.sfilter.sel .sf-ic { background: var(--sel); color: #fff; }
.sfilter.maybe .sf-ic { background: var(--maybe); color: #fff; }
.sfilter.fav .sf-ic { background: var(--fav); color: #fff; }
.sfilter.fav .sf-ic .ic { fill: currentColor; }
.sfilter.tagf { padding: 7px 10px; border-color: transparent; }
.sfilter.tagf .sf-ic { background: transparent; color: var(--accent); }
.sfilter:hover { border-color: #cfd3da; }
.sfilter.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sum-sec h4 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 4px 6px; }
.sum-cat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-size: 14px; color: var(--ink-2); text-align: start; }
.sum-cat span { flex: 1; }
.sum-cat .ic { width: 17px; height: 17px; color: var(--muted); }
.sum-cat b { font-weight: 500; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sum-cat:hover { background: var(--surface-2); }
.sum-cat.on { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.sum-cat.on .ic, .sum-cat.on b { color: var(--accent); }
.sum-cat.full b { color: var(--sel); }
.days-left { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 4px; }
.days-left .ic { width: 16px; height: 16px; }
.sum-finish { margin-top: auto; position: sticky; bottom: -30px; background: #fff; padding: 10px 0 30px; }
.done-box { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }

/* ================= toolbar ================= */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 6px 0 12px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 240px; position: relative; display: block; }
.toolbar .search .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.toolbar .search input { width: 100%; height: 40px; padding: 0 40px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); outline: none; font-size: 14.5px; }
.toolbar .search input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar .size, .toolbar .sort { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); }
.toolbar .size .ic, .toolbar .sort .ic { width: 18px; height: 18px; color: var(--muted); }
.toolbar input[type=range] { width: 110px; accent-color: var(--accent); }
.toolbar select { border: 0; background: transparent; font-size: 14px; outline: none; cursor: pointer; }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; font-size: 14px; font-weight: 500; }
.tool-btn:hover { background: var(--surface-3); }
.tool-btn .ic { width: 18px; height: 18px; color: var(--accent); }
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.active-filters:not(:empty) { padding: 0 0 12px; }
.afchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 10px; border: 0; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13.5px; cursor: pointer; }
.afchip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-right: -4px; }
.afchip .ic { width: 15px; height: 15px; }
.afchip .ic:last-child { opacity: .7; }

/* ================= grid & tiles ================= */
.folder { content-visibility: auto; margin-bottom: 14px; }
.folder-title { display: flex; align-items: baseline; gap: 10px; font-family: var(--display); font-weight: 400; font-size: 24px; padding: 14px 2px 10px; }
.folder-title .num { color: var(--accent); font-size: 17px; font-family: var(--font); font-weight: 500; }
.folder-title small { font-family: var(--font); font-size: 13px; color: var(--muted); }
.row { display: flex; }
.tile { position: relative; height: 100%; overflow: hidden; background: var(--surface-3); cursor: zoom-in; border-radius: 4px; flex-shrink: 0; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile::after { content: ''; position: absolute; inset: 0; border: 3px solid transparent; border-radius: 4px; pointer-events: none; transition: border-color .15s; }
.tile.is-sel::after { border-color: var(--sel); }

.t-marks { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; pointer-events: none; transition: opacity .2s; }
.mk { min-width: 26px; height: 26px; padding: 0 4px; display: grid; grid-auto-flow: column; align-items: center; gap: 1px; justify-content: center; border-radius: 99px; color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); background: rgba(20, 22, 28, .55); }
.mk .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.mk.sel { background: var(--sel); }
.mk.maybe { background: var(--maybe); }
.mk.fav { background: var(--fav); }
.mk.fav .ic { fill: currentColor; }
.mk.tagm { background: var(--accent); font-size: 11px; }

.t-over { position: absolute; inset: 0; opacity: 0; transition: opacity .2s; background: linear-gradient(180deg, rgba(0, 0, 0, .28), transparent 30%, transparent 62%, rgba(0, 0, 0, .55)); pointer-events: none; }
.t-over > * { pointer-events: auto; }
.t-pick { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.pk { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #cdd2da; background: #fff; display: grid; place-items: center; cursor: pointer; color: #9aa1ad; font-weight: 700; font-size: 18px; transition: all .15s; }
.pk .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.pk.sel { border-color: color-mix(in srgb, var(--sel) 55%, white); color: var(--sel); }
.pk.sel:hover, .pk.sel.on { background: var(--sel); border-color: var(--sel); color: #fff; }
.pk.maybe:hover, .pk.maybe.on { background: var(--maybe); border-color: var(--maybe); color: #fff; }
.pk.on { animation: pop .3s; }
.t-fav { position: absolute; top: 12px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .3); color: #fff; cursor: pointer; transition: transform .15s, background .15s; }
.t-fav .ic { width: 20px; height: 20px; }
.t-fav.on { background: var(--fav); }
.t-fav.on .ic { fill: currentColor; }
.t-fav:active { transform: scale(.88); }
.t-bottom { position: absolute; bottom: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; color: #fff; }
.t-name { font-size: 14px; font-weight: 500; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; }
.t-tools { display: flex; gap: 2px; }
.t-tools button, .t-tools a { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.t-tools button:hover, .t-tools a:hover { background: rgba(255, 255, 255, .2); }
.t-tools .ic { width: 20px; height: 20px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }

@media (hover: hover) {
  .tile:hover img { transform: scale(1.03); }
  .tile:hover .t-over { opacity: 1; }
  .tile:hover .t-marks { opacity: 0; }
}
/* touch devices: compact always-visible ✓ and heart */
.t-tagc, .t-mdl { display: none; }
@media (hover: none) {
  .t-over { opacity: 1; background: none; }
  .t-bottom, .t-pick .maybe { display: none; }
  .t-pick { top: auto; bottom: 6px; left: 6px; padding: 0; background: none; box-shadow: none; }
  .pk.sel { width: 32px; height: 32px; background: rgba(255, 255, 255, .85); }
  .pk.sel .ic { width: 18px; height: 18px; }
  .t-fav { top: auto; bottom: 6px; right: 6px; width: 32px; height: 32px; }
  .t-fav .ic { width: 18px; height: 18px; }
  .mk.sel, .mk.fav, .mk.tagm { display: none; }
  /* download: small button in the bottom middle */
  .tile .t-mdl { display: grid; place-items: center; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; z-index: 2; }
  .t-mdl .ic { width: 16px; height: 16px; }
  /* tag corner (top-left) on photos that were selected */
  .t-tagc { position: absolute; top: 0; left: 0; z-index: 2; width: 46px; height: 46px; border: 0; padding: 0; cursor: pointer; background: transparent; color: #fff; }
  .t-tagc::before { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 80%, transparent); clip-path: polygon(0 0, 100% 0, 0 100%); }
  .t-tagc .ic { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; }
  .tile.has-any .t-tagc, .tile.has-tags .t-tagc { display: block; }
  .tile.has-tags .t-tagc::before { background: var(--accent); }
  .t-marks { right: 6px; top: 6px; }
}

.selfie-btn { border: 0; }
.selfie-opts { display: grid; gap: 8px; margin-top: 12px; }
.selfie-opt { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 500; }
.selfie-opt:hover { background: var(--surface-2); }
.selfie-opt .ic { width: 22px; height: 22px; color: var(--accent); }
.sfilter.allf { border-color: transparent; background: var(--surface-2); }
.sfilter.allf.on { background: #fff; }

.empty { display: grid; justify-items: center; gap: 10px; padding: 80px 20px; color: var(--muted); text-align: center; }
.empty .ic { width: 40px; height: 40px; stroke-width: 1.2; }
.notice { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 24px; }
.notice .ic { width: 44px; height: 44px; color: var(--accent); stroke-width: 1.2; }

.foot { text-align: center; padding: 50px 16px 10px; font-size: 14px; display: grid; justify-items: center; gap: 4px; }
.foot-studio { font-family: var(--display); font-size: 21px; }

/* ================= mobile bottom bar ================= */
.mbar {
  display: none; position: fixed; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; right: 10px; z-index: 70;
  align-items: center; gap: 8px; padding: 6px; background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  transition: transform .3s var(--ease), opacity .3s;
}
.mbar.away, .lb-open .mbar { opacity: 0; pointer-events: none; transform: translateY(20px); }
.mbar-sum { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 14px; }
.mbar-sum span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar-sum .ic { width: 18px; height: 18px; color: var(--accent); flex: none; }
.mbar-sum b { font-variant-numeric: tabular-nums; }
.mbar-sum .ic:last-child { width: 16px; color: var(--muted); margin-inline-start: auto; }
.mbar .done { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 500; padding: 0 12px; }

/* ================= modals content ================= */
.finish-intro { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.finish-intro p { margin: 0; color: var(--ink-2); }
.finish-ic { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.finish-ic .ic { width: 26px; height: 26px; }
.finish-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.finish-list li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.finish-list li span { flex: 1; }
.finish-list li .ic { color: var(--accent); }
.finish-list li.ok { background: var(--ok-soft); }
.finish-list li.ok b { color: var(--ok); }
.finish-list li.zero b { color: var(--muted); }
.warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.confirm-check { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 500; }
.confirm-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.thanks { text-align: center; padding: 6px 0 4px; }
.thanks .finish-ic { margin: 0 auto 12px; }
.share-link { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; word-break: break-all; }

.dl-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; text-decoration: none; border: 1px solid var(--line); margin-bottom: 8px; transition: background .15s; }
.dl-row:hover { background: var(--surface-2); }
.dl-row span:not(.num) { flex: 1; }
.dl-row small { color: var(--muted); }
.dl-row .num { color: var(--accent); font-weight: 500; }
.dl-row.dl-main { background: var(--ink); color: #fff; border-color: var(--ink); }
.dl-row.dl-main small { color: rgba(255, 255, 255, .7); }
.dl-sep { font-size: 13px; color: var(--muted); margin: 16px 4px 8px; }
.btn.wa-solid { background: #1fa855; border-color: #1fa855; color: #fff; }

/* ================= lightbox ================= */
.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 200; background: #0d0e11; color: #fff; display: flex; flex-direction: column; animation: fade .2s; }
.lb[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lb-top { display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; z-index: 2; }
.lb-top .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.lb-info { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.3; min-width: 0; }
.lb-count { font-size: 14px; font-variant-numeric: tabular-nums; direction: ltr; }
.lb-name { font-size: 12.5px; opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lb-tools { display: flex; }
.lb-fav.on { color: var(--fav); }
.lb-fav.on .ic { fill: currentColor; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 8px; touch-action: pan-y pinch-zoom; overflow: hidden; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .25s var(--ease); user-select: none; -webkit-user-select: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s, opacity .15s; z-index: 2; }
.lb-nav:hover { background: rgba(255, 255, 255, .18); }
.lb-nav:disabled { opacity: 0; pointer-events: none; }
.lb-nav .ic { width: 26px; height: 26px; }
.lb-nav.prev { right: 16px; }
.lb-nav.next { left: 16px; }
.lb-actions { display: flex; gap: 8px; justify-content: center; padding: 10px 10px calc(12px + env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; z-index: 2; }
.lb-actions::-webkit-scrollbar { display: none; }
.lb-act { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; padding: 8px 10px 6px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px; background: rgba(255, 255, 255, .05); color: #fff; cursor: pointer; transition: all .15s; }
.lb-ic { width: 26px; height: 26px; display: grid; place-items: center; }
.lb-ic .ic { width: 22px; height: 22px; }
.lb-ic.q { font-weight: 700; font-size: 18px; }
.lb-act span { font-size: 12.5px; white-space: nowrap; }
.lb-act small { font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }
.lb-act.on { background: var(--sel); border-color: var(--sel); }
.lb-act.on .lb-ic .ic { stroke-width: 2.6; }
.lb-act.on small { opacity: .9; }
.lb-act.maybe.on { background: var(--maybe); border-color: var(--maybe); }
.lb-act.full { opacity: .4; }
.lb-act:active { transform: scale(.94); }

/* ================= responsive ================= */
.only-narrow { display: none !important; }
.drawer-shade { display: none; }

@media (max-width: 1279px) {
  .side-l { width: 240px; }
  .side-r { width: 240px; }
}
@media (max-width: 1100px) {
  .only-narrow { display: inline-grid !important; }
  .side-head.only-narrow { display: flex !important; }
  .contacts.only-narrow { display: flex !important; }
  .hide-narrow { display: none !important; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'start start end' 'tabs tabs tabs'; padding: 6px 10px 8px; gap: 6px 8px; }
  .tb-start { grid-area: start; }
  .tb-end { grid-area: end; }
  .cat-tabs { grid-area: tabs; justify-self: stretch; }
  .side {
    position: fixed; top: 0; bottom: 0; z-index: 120; max-height: none; width: min(320px, 86vw); background: #fff; box-shadow: var(--shadow-lg);
    padding: calc(12px + env(safe-area-inset-top)) 14px 30px; transition: transform .3s var(--ease); border: 0;
  }
  .side-r { right: 0; transform: translateX(105%); }
  .side-l { left: 0; transform: translateX(-105%); }
  .drawer-r .side-r, .drawer-l .side-l { transform: none; }
  .drawer-shade { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(16, 18, 24, .4); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .drawer-r .drawer-shade, .drawer-l .drawer-shade { opacity: 1; pointer-events: auto; }
  .drawer-r, .drawer-l { overflow: hidden; }
  .mbar { display: flex; }
  .side-contacts { justify-content: center; margin-top: 10px; }
}
@media (max-width: 640px) {
  .main { padding: 6px 6px 110px; }
  .tb-title strong { font-size: 17px; }
  .cat-tab { height: 36px; padding: 0 10px; font-size: 14px; gap: 5px; }
  .toolbar { gap: 6px; }
  .toolbar .search { flex-basis: 100%; }
  .toolbar .size { flex: 1; }
  .toolbar input[type=range] { width: 100%; }
  .tool-btn span { display: none; }
  .tool-btn { padding: 0 11px; }
  .folder-title { font-size: 21px; padding: 12px 4px 8px; }
  .tile, .tile::after { border-radius: 2px; }
  .t-marks { top: 5px; right: 5px; gap: 3px; }
  .mk { min-width: 22px; height: 22px; font-size: 12px; }
  .mk .ic { width: 13px; height: 13px; }
  .lb-nav { display: none; }
  .lb-act { min-width: 66px; padding: 7px 8px 5px; }
  .lb-actions { justify-content: flex-start; }
}
