/* Modular Photo Vault: photo-specific parts on top of the Modular design (app.css). */

.top-search input {
  width: 210px; padding: 6px 10px; font-size: 12px; letter-spacing: 0; text-transform: none;
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
}
.top-search input:focus { box-shadow: none; border-color: var(--accent); }
body.signed-out .top-search { display: none; }
html[data-layout="right"] .container, html[data-layout="left"] .container { max-width: none; padding: 34px 40px 80px; }
html[data-layout="top"] .container { max-width: 1600px; }

/* ---------- timeline grid ---------- */
.month { margin-bottom: 34px; }
.month-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 12px; position: sticky; top: var(--hdr-h, 70px); z-index: 5; padding: 8px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); }
.month-head h3 { font-size: 24px; }
.month-head .muted { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.grid-photos { display: flex; flex-wrap: wrap; gap: 4px; }
.grid-photos::after { content: ""; flex-grow: 999; }
.tile {
  position: relative; height: 190px; flex-grow: 1; overflow: hidden; background: var(--panel); cursor: pointer;
  outline: 2px solid transparent; transition: outline-color .15s;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s, opacity .3s; opacity: 0; }
.tile img.ok { opacity: 1; }
.tile:hover img { transform: scale(1.03); }
.tile .sel {
  position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .25); opacity: 0; transition: opacity .15s;
}
.tile:hover .sel, body.selecting .tile .sel { opacity: 1; }
.tile.selected { outline-color: var(--accent); }
.tile.selected .sel { opacity: 1; background: var(--accent); border-color: var(--accent); }
.tile.selected .sel::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--on-accent); }
.tile .badges { position: absolute; right: 8px; bottom: 6px; display: flex; gap: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; }
.tile .fav { position: absolute; left: 8px; bottom: 6px; color: #fff; text-shadow: 0 1px 3px #000; font-size: 13px; }
@media (max-width: 700px) { .tile { height: 110px; } }

/* ---------- selection bar ---------- */
.selbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 22px; max-width: calc(100vw - 32px); flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--accent-line); box-shadow: var(--shadow);
}
html[data-layout="right"] body:not(.signed-out) .selbar { left: calc(50% - var(--side-w, 0px) / 2); }
html[data-layout="left"] body:not(.signed-out) .selbar { left: calc(50% + var(--side-w, 0px) / 2); }
.selbar #sel-count { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.selbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .96); display: grid; grid-template-columns: 1fr auto; }
.viewer[hidden] { display: none; }
.viewer .stage { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.viewer .stage img, .viewer .stage video { max-width: 100%; max-height: 100vh; object-fit: contain; }
.viewer .vbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: linear-gradient(180deg, rgba(0,0,0,.7), transparent); z-index: 2; }
.viewer .vbar .title { font-size: 12px; letter-spacing: .12em; color: #ddd; }
.viewer .vbar .acts { display: flex; gap: 6px; }
.viewer .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.15); color: #fff; width: 46px; height: 46px; cursor: pointer; font-size: 20px; z-index: 2; }
.viewer .nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.viewer .prev { left: 16px; } .viewer .next { right: 16px; }
.viewer .info { width: 340px; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 26px 24px; }
.viewer .info[hidden] { display: none; }
.viewer .info dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 12.5px; margin: 14px 0 22px; }
.viewer .info dt { color: var(--muted); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding-top: 2px; }
.viewer .info dd { margin: 0; word-break: break-word; }
.viewer .mini-map { height: 180px; border: 1px solid var(--line); margin-bottom: 18px; }
@media (max-width: 900px) { .viewer { grid-template-columns: 1fr; } .viewer .info { position: absolute; inset: auto 0 0 0; width: auto; max-height: 55vh; } }

/* ---------- albums ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; margin-bottom: 30px; }
.album-card { display: block; color: inherit; }
.album-card .cover { aspect-ratio: 1; background: var(--panel); border: 1px solid var(--line); overflow: hidden; position: relative; transition: border-color .2s; }
.album-card:hover .cover { border-color: var(--accent-line); }
.album-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card .cover .kind { position: absolute; right: 8px; top: 8px; }
.album-card .cover .empty-cover { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--serif); font-size: 42px; }
.album-card b { display: block; font-weight: 400; margin-top: 10px; color: var(--text); }
.album-card small { color: var(--muted); font-size: 11.5px; }
.album-card:hover { color: inherit; }
.album-card:hover b { color: var(--accent); }

.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px solid var(--line-soft); }
.tree li > a { display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; color: var(--text-2); font-size: 13px; }
.tree li > a:hover, .tree li > a.on { color: var(--accent); background: var(--accent-soft); }
.tree .count { color: var(--muted); font-size: 11px; }

/* side menu: album tree inside the nav (indent only in the left/right layouts) */
.main-nav :is(#nav-albums, #nav-shared) a { display: flex; justify-content: space-between; }
html:not([data-layout="top"]) .main-nav :is(#nav-albums, #nav-shared) .lvl-1 a { padding-left: 58px !important; }
html:not([data-layout="top"]) .main-nav :is(#nav-albums, #nav-shared) .lvl-2 a { padding-left: 72px !important; }
html:not([data-layout="top"]) .main-nav :is(#nav-albums, #nav-shared) .lvl-3 a { padding-left: 86px !important; }
html[data-layout="top"] .main-nav :is(#nav-albums, #nav-shared) .lvl-1 a { padding-left: 34px; }
html[data-layout="top"] .main-nav :is(#nav-albums, #nav-shared) .lvl-2 a { padding-left: 46px; }
html[data-layout="top"] .main-nav :is(#nav-albums, #nav-shared) { max-height: 60vh; overflow-y: auto; }

/* ---------- rules (dynamic albums) ---------- */
.rule { display: grid; grid-template-columns: 1.3fr 1fr 1.6fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.rule .geo { display: grid; grid-template-columns: 1fr 1fr 80px; gap: 6px; }
@media (max-width: 700px) { .rule { grid-template-columns: 1fr 1fr; } }

/* ---------- map ---------- */
.map-full { height: calc(100vh - var(--hdr-h, 70px) - 160px); min-height: 420px; border: 1px solid var(--line); }
.leaflet-container { background: #1a1a1a; font-family: var(--sans); }
.map-pop img { width: 160px; height: 120px; object-fit: cover; display: block; margin-bottom: 6px; }
.map-pop .strip { display: flex; gap: 3px; flex-wrap: wrap; max-width: 240px; }
.map-pop .strip img { width: 56px; height: 56px; margin: 0; cursor: pointer; }
.marker-count { background: var(--accent); color: var(--on-accent); border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12px; border: 2px solid rgba(0,0,0,.5); }

/* ---------- import ---------- */
.drop { border: 1px dashed var(--accent-line); padding: 44px 20px; text-align: center; color: var(--text-2); cursor: pointer; transition: background .2s; }
.drop.over { background: var(--accent-soft); }
.progress { height: 3px; background: var(--line); margin-top: 12px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.folder-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); margin: 10px 0; }
.folder-list button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text-2); padding: 9px 14px; cursor: pointer; font-family: var(--sans); font-size: 13px; }
.folder-list button:hover { color: var(--accent); background: var(--accent-soft); }

.vault-card .lock { font-size: 26px; color: var(--accent); }
.two-col { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
/* keep Leaflet's own z-indexes inside the map, under the viewer and dialogs */
.map-full, .mini-map, #pick { position: relative; isolation: isolate; z-index: 0; }
.viewer { background: #000; }

/* settings gear in the header (admins), between the status and the user menu */
body.signed-out .top-gear { display: none; }

/* collections: a view that is not there yet */
.album-card.soon { opacity: .55; pointer-events: none; }

/* star ratings */
.tile .stars-badge { position: absolute; right: 8px; bottom: 6px; color: #f5c84b; text-shadow: 0 1px 3px #000; font-size: 11px; letter-spacing: 1px; }
.stars { display: inline-flex; gap: 2px; margin-right: 6px; }
.stars button { background: none; border: 0; padding: 2px; font-size: 17px; line-height: 1; cursor: pointer; color: var(--muted); transition: color .12s, transform .12s; }
.stars button.on { color: #f5c84b; }
.stars:not(.ro) button:hover, .stars:not(.ro) button:hover ~ button { transform: scale(1.12); }
.stars.ro button { cursor: default; }

/* people */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 26px 18px; }
.person-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: inherit; text-decoration: none; }
.person-card img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; background: var(--panel); margin-bottom: 8px; transition: transform .15s; }
.person-card:hover img { transform: scale(1.04); }
.person-card b { font-weight: 600; font-size: 14px; }
.person-card small { color: var(--muted); font-size: 12px; }
.person-card.is-hidden img { opacity: .45; }
.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 16px; max-height: 50vh; overflow: auto; margin: 10px 0 18px; }
.person-card.pick { cursor: pointer; position: relative; }
.person-card.pick img { width: 80px; height: 80px; }
.person-card.pick input { position: absolute; top: 4px; left: 12px; }
.person-card.pick:has(input:checked) img { outline: 3px solid var(--accent, #86b89a); outline-offset: 2px; }
.person-head { display: flex; align-items: center; gap: 18px; margin: -6px 0 24px; flex-wrap: wrap; }
.face-big { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; }
.face-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.face-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel, rgba(127,127,127,.12)); border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 999px; padding: 3px 12px 3px 3px; color: inherit; cursor: pointer; font: inherit; font-size: 13px; }
.face-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.face-chip:hover { border-color: var(--muted); }

/* collections: a view that is not there yet */
.album-card.soon { opacity: .55; pointer-events: none; }

/* dialogs opened from the photo viewer (Album, Tag, Who is this?) sit above it */
.modal-back { z-index: 130; }

/* optional AI */
.ai-helpers { display: grid; gap: 4px; margin-top: 12px; }
.ai-helper { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line, rgba(127,127,127,.2)); cursor: pointer; }
.ai-helper:last-child { border-bottom: 0; }
.ai-helper input { margin-top: 4px; }
.ai-helper b { display: block; font-weight: 600; }
.ai-helper small { color: var(--muted); font-size: 13px; }
.ai-helper.soon { cursor: default; opacity: .7; }
.ai-helper .badge { flex: none; margin-top: 2px; }
.ai-send { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 20px; align-items: start; }
.ai-send img { width: 100%; border-radius: 6px; background: #000; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ai-text { white-space: pre-wrap; font-size: 13px; max-height: 160px; overflow: auto; background: var(--panel, rgba(127,127,127,.1)); padding: 10px; border-radius: 6px; }
@media (max-width: 700px) { .ai-send { grid-template-columns: 1fr; } }

/* clean up and suggestions */
.dup-group { padding: 14px 0 18px; border-bottom: 1px solid var(--line, rgba(127,127,127,.2)); }
.dup-group .grid-photos { margin-bottom: 10px; }
.best-badge { position: absolute; left: 8px; bottom: 8px; background: var(--accent, #86b89a); color: #0b0b0b; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; letter-spacing: .04em; }
.ai-helper.local .badge { flex: none; margin-top: 2px; }
.sugg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.sugg { border: 1px solid var(--line, rgba(127,127,127,.25)); background: var(--panel, transparent); overflow: hidden; }
.sugg-cover { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 110px 110px; gap: 2px; }
.sugg-cover img { width: 100%; height: 100%; object-fit: cover; }
.sugg-body { padding: 14px 16px 16px; }
.sugg-body h3 { margin: 8px 0 4px; }
.sugg-body .toolbar { flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* login screen and logo */
.login-logo { max-width: 220px; max-height: 90px; object-fit: contain; margin: 0 auto 6px; display: block; }
.login-welcome { white-space: pre-line; margin: 4px 0 6px; color: var(--muted, inherit); }
.brand-logo { height: 30px; width: auto; max-width: 120px; object-fit: contain; margin-right: 12px; vertical-align: middle; }
.br-logo-row { margin-bottom: 14px; }
.br-logo-preview { max-width: 260px; max-height: 110px; object-fit: contain; background: rgba(127,127,127,.12); padding: 8px; }
/* logs */
table.logs td { vertical-align: top; }
table.logs td:last-child { min-width: 260px; max-width: 460px; word-break: break-word; }
table.logs td:nth-child(-n+5) { white-space: nowrap; }
.logs-filters select, .logs-filters input { width: auto; flex: 0 1 auto; }
.badge.warn { border-color: #d9a441; color: #d9a441; }
.badge.danger { border-color: #d0605e; color: #d0605e; }
/* sign-in with OAuth2 / OpenID Connect */
#oidc-btns { gap: 8px; margin-top: 10px; }
#oidc-btns .btn { justify-content: center; text-align: center; text-decoration: none; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted, inherit); font-size: .9em; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--line, rgba(128,128,128,.35)); }
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* background work: imports show their stages */
.jobs { display: grid; gap: 12px; }
.job { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 4px; }
.job-title { overflow-wrap: anywhere; }
.job-head .row-btns { margin-left: auto; }
.job-stages { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.job-stage { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.job-stage.current { border-color: var(--accent-line); color: inherit; box-shadow: 0 0 0 1px var(--accent-line) inset; }
.job-stage.st-done { color: inherit; }
.job-stage-name { font-weight: 600; }
.job-stage-n { font-variant-numeric: tabular-nums; min-height: 1.2em; }
.job-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 15%, transparent); overflow: hidden; }
.job-bar > span { display: block; height: 100%; background: var(--accent); }
.job-stage.st-waiting .job-bar > span, .job-stage.st-skipped .job-bar > span { background: transparent; }

/* timeline: Day / Month / Year views and the scrubber on the right */
.tl-views button { padding: 10px 16px; }
.tl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 10px; }
.tl-scrub { position: sticky; top: calc(var(--hdr-h, 70px) + 12px); height: calc(100vh - var(--hdr-h, 70px) - 24px); cursor: ns-resize; touch-action: none; user-select: none; border-left: 1px solid var(--line-soft); }
.tl-scrub-marks { position: absolute; inset: 0; }
.tl-mark { position: absolute; right: 2px; transform: translateY(-50%); font-size: 10.5px; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.tl-mark::before { content: ""; position: absolute; left: -9px; top: 50%; width: 5px; height: 1px; background: var(--muted); }
.tl-scrub:hover .tl-mark { color: var(--text-2); }
.tl-scrub-line { position: absolute; left: 0; right: 0; height: 2px; margin-top: -1px; background: var(--accent); pointer-events: none; }
.tl-scrub-tip { position: absolute; right: calc(100% + 8px); transform: translateY(-50%); white-space: nowrap; padding: 5px 10px; font-size: 12px; background: var(--panel); border: 1px solid var(--accent-line); color: var(--text); pointer-events: none; z-index: 6; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 8px; font-size: 14px; }
.day-head:first-of-type { margin-top: 4px; }
.day-head .muted { font-size: 11px; }
.year .ym { margin: 0 0 14px; }
.ym-head { margin: 0 0 6px; font-size: 13px; color: var(--text-2); }
.ym-head .muted { font-size: 11px; margin-left: 6px; }
.grid-photos.dense { gap: 2px; }
.grid-photos.dense .tile .sel, .grid-photos.dense .tile .stars-badge { display: none; }
@media (max-width: 700px) {
  .tl-wrap { grid-template-columns: minmax(0, 1fr); }
  .tl-scrub { display: none; }
}

/* foldable trees: an arrow before each parent album or folder */
.fold-btn { flex: none; width: 22px; height: 22px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: .7; }
.fold-btn::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.fold-btn.open::before { transform: rotate(45deg); }
.fold-btn:hover { opacity: 1; color: var(--accent); }
.tree li { position: relative; }
.tree > li { margin-left: 22px; }
.tree li.fold > .fold-btn { position: absolute; left: -22px; top: 3px; }
.tree li.collapsed > ul { display: none; }
.tree .tree-dir { display: flex; padding: 5px 8px; color: var(--muted); font-size: 13px; }
.main-nav :is(#nav-albums, #nav-shared) li.fold { position: relative; }
.main-nav :is(#nav-albums, #nav-shared) li.fold > .fold-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
html:not([data-layout="top"]) .main-nav :is(#nav-albums, #nav-shared) li.lvl-0 > .fold-btn { left: 20px; }
html:not([data-layout="top"]) .main-nav :is(#nav-albums, #nav-shared) li.lvl-1 > .fold-btn { left: 34px; }
html:not([data-layout="top"]) .main-nav :is(#nav-albums, #nav-shared) li.lvl-2 > .fold-btn { left: 48px; }
html:not([data-layout="top"]) .main-nav :is(#nav-albums, #nav-shared) li.lvl-3 > .fold-btn { left: 62px; }
html[data-layout="top"] .main-nav :is(#nav-albums, #nav-shared) li.fold > .fold-btn { right: 6px; }

/* select a whole month or day: a circle before the heading */
.sec-sel { flex: none; align-self: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--muted); background: transparent; padding: 0; cursor: pointer; opacity: .35; transition: opacity .15s; margin-right: 2px; vertical-align: middle; }
.month-head:hover .sec-sel, .day-head:hover .sec-sel, .ym-head:hover .sec-sel, .sec-sel:focus-visible, body.selecting .sec-sel { opacity: 1; }
.sec-sel:hover { border-color: var(--accent); background: var(--accent-soft); }
.ym-head .sec-sel { width: 16px; height: 16px; margin-right: 8px; }
.toast.busy::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* selection bar: one row (compact buttons); it wraps only on small screens */
.selbar { gap: 8px; padding: 8px 10px 8px 18px; white-space: nowrap; }
.selbar-actions { gap: 4px; }
.selbar .btn.sm { padding: 7px 11px; letter-spacing: .1em; min-height: 30px; }
.selbar #sel-count { letter-spacing: .14em; margin-right: 4px; }

/* album lock: green when locked, yellow when unlocked */
.lock-btn { flex: none; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.lock-btn.locked { color: #3fae6a; }
.lock-btn.unlocked { color: var(--warn); }
.lock-btn.unlocked .shackle { transform: translate(2.6px, -1px); }
.lock-btn:hover { background: var(--accent-soft); }
.has-lock { position: relative; }
.has-lock > .lock-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 1; }
.tree li.has-lock > .lock-btn { top: 2px; transform: none; }
.tree li.has-lock > a { padding-right: 34px; }
.main-nav #nav-albums li.has-lock > a { padding-right: 34px !important; }
.page-head .lock-btn { width: 36px; height: 36px; border: 1px solid var(--line, rgba(127,127,127,.3)); }

/* collections: a view that is not there yet */
.album-card.soon { opacity: .55; pointer-events: none; }

/* compact page toolbars (album, timeline): same size as the selection bar buttons */
.page-head .actions { gap: 6px; flex-wrap: wrap; align-items: center; }
.page-head .actions .btn { padding: 7px 11px; letter-spacing: .1em; min-height: 30px; font-size: 11px; }
.page-head .actions .tl-views button { padding: 7px 11px; letter-spacing: .1em; min-height: 30px; font-size: 11px; }
.page-head .lock-btn { width: 30px; height: 30px; }
.page-head .actions .tl-views { margin-right: 14px; padding-right: 14px; border-right: 1px solid var(--line-soft, rgba(127,127,127,.25)); }

/* photo viewer toolbar: real, evenly sized hit targets */
.viewer .vbar { gap: 16px; }
.viewer .vbar .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.viewer .vbar .acts { flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; flex: 0 1 auto; }
.viewer .vbar .acts .btn { min-height: 40px; padding: 10px 16px; font-size: 12px; letter-spacing: .1em; border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.45); color: #eee; border-radius: 4px; display: inline-flex; align-items: center; }
.viewer .vbar .acts .btn:hover { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.08); }
.viewer .vbar .acts .btn.danger { color: #ff8a80; }
.viewer .vbar .acts .stars { min-height: 40px; padding: 0 8px; margin-right: 0; align-items: center; border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.45); border-radius: 4px; }
.viewer .vbar .acts .stars button { padding: 4px 4px; font-size: 21px; }
.viewer .vbar .acts #v-close { margin-left: 8px; }

/* viewer info: editable tags */
.info .tag { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px 6px 0; }
.info .tag-x { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }
.info .tag-x:hover { opacity: 1; }
.info .tag-add { width: 100%; margin-top: 4px; padding: 6px 8px; font-size: 13px; background: transparent; border: 1px solid var(--line-soft, rgba(127,127,127,.25)); color: inherit; border-radius: 4px; }
/* Day / Month / Year: same height, font and baseline as the action buttons, text in the theme colour */
.page-head .actions .tl-views { margin: 0 14px 0 0; align-self: center; align-items: stretch; height: 30px; box-sizing: border-box; border: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; }
.page-head .actions .tl-views button { min-height: 0; height: 100%; padding: 0 12px; display: inline-flex; align-items: center; font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.page-head .actions .tl-views button[aria-pressed="true"], .page-head .actions .tl-views button.on { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.page-head .actions .tl-views button:not([aria-pressed="true"]):not(.on) { opacity: .75; }
.page-head .actions .tl-views button:hover { opacity: 1; }
.page-head .actions .btn { box-sizing: border-box; height: 30px; min-height: 30px; display: inline-flex; align-items: center; }
.page-head .actions .tl-views + * { margin-left: 0; }

/* photo grids: size, shape and spacing from the grid controls (CSS variables on <html>) */
.grid-photos, .grid-photos.dense { gap: var(--tile-gap, 4px); }
.tile { height: var(--tile-h, 190px); width: calc(var(--r, 1) * var(--tile-h, 190px)); flex-grow: var(--r, 1); }
.tile.small { height: calc(var(--tile-h, 190px) * .5); width: calc(var(--r, 1) * var(--tile-h, 190px) * .5); }
html.grid-square .grid-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-h, 190px), 1fr)); }
html.grid-square .grid-photos.dense { grid-template-columns: repeat(auto-fill, minmax(calc(var(--tile-h, 190px) * .5), 1fr)); }
html.grid-square .grid-photos::after { display: none; }
html.grid-square .tile { width: auto; height: auto; aspect-ratio: 1; }
.grid-ctl { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; padding-right: 14px; border-right: 1px solid var(--line-soft, rgba(127,127,127,.25)); }
.grid-ctl .grid-size { width: 110px; accent-color: var(--accent); }
.grid-ctl select { height: 30px; padding: 0 26px 0 10px; font-size: 11px; letter-spacing: .06em; width: auto; min-width: 0; }
.grid-ctl:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
