/* ═══════════════════════════════════════════════════════════════════════════
   BACKUPS — list view (assets/js/backups.js) and the 3D Vault's overlay
   (assets/js/backups-vault.js). Theme vars only, so both themes work; the
   Vault's 3D room is deliberately dark in either theme.
   ═══════════════════════════════════════════════════════════════════════════ */

.bk { max-width: 1180px; margin: 0 auto; }

/* ── gears (meshed train, same geometry as the background machinery) ───── */
.bk-gears { position: relative; display: inline-block; flex: 0 0 auto; }
.bk-gears > i { color: var(--warning); text-align: center; }
.bk-gear { position: absolute; animation: bk-spin linear infinite; }
.bk-gear svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bk-gear path { fill: var(--bg-elevated); stroke: var(--text-muted); stroke-width: 1.2; stroke-linejoin: round; }
.bk-gear--accent path { fill: rgba(232, 114, 12, 0.16); stroke: #E8720C; }
.bk-gears--fast { --bk-t: 2.6s; }
@keyframes bk-spin { to { transform: rotate(360deg); } }

.bk-loading { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 80px 0; }
.bk-loading--vault { min-height: 60vh; justify-content: center; }

/* ── header ──────────────────────────────────────────────────────────── */
.bk-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.bk-hero-mark { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(145deg, rgba(232, 114, 12, 0.14), rgba(99, 102, 241, 0.12)); border: 1px solid var(--border-subtle); overflow: hidden; }
.bk-hero-text { flex: 1 1 320px; min-width: 0; }
.bk-hero-text h1 { font-size: 24px; font-weight: 800; color: var(--text-primary); margin: 0 0 3px; }
.bk-hero-text p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; max-width: 680px; }
.bk-hero-text strong { color: var(--text-secondary); }

.bk-switch { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); flex: 0 0 auto; }
.bk-switch button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-secondary); font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, color .15s; }
.bk-switch button:hover { color: var(--text-primary); }
.bk-switch button.is-on { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.bk-switch button[data-act="view-vault"] i { color: #E8720C; }

/* ── totals ──────────────────────────────────────────────────────────── */
.bk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.bk-stat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); text-align: left; font: inherit; color: inherit; min-width: 0; }
button.bk-stat { cursor: pointer; transition: border-color .15s, transform .15s; }
button.bk-stat:hover { border-color: var(--border-default); transform: translateY(-1px); }
.bk-stat > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.bk-stat b { font-size: 18px; font-weight: 800; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-stat b small { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.bk-stat em { font-style: normal; font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.bk-stat-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; font-size: 15px;
  background: var(--bg-elevated); color: var(--text-secondary); }
.bk-stat-ico.green { background: rgba(34, 197, 94, .14); color: var(--success); }
.bk-stat-ico.blue { background: rgba(59, 130, 246, .14); color: #60a5fa; }
.bk-stat-ico.violet { background: rgba(139, 92, 246, .14); color: #a78bfa; }
.bk-stat--good .bk-stat-ico { background: rgba(34, 197, 94, .14); color: var(--success); }
.bk-stat--bad { border-color: rgba(239, 68, 68, .35); }
.bk-stat--bad .bk-stat-ico { background: rgba(239, 68, 68, .14); color: var(--danger); }
.bk-stat--bad b { color: var(--danger); font-size: 15px; }
.bk-stat--run .bk-stat-ico { background: rgba(59, 130, 246, .14); color: #60a5fa; }
.bk-stat--good b, .bk-stat--run b { font-size: 15px; }

.bk-escrow { margin-bottom: 16px; }

/* ── search + filters (stick to the top while the list scrolls) ───────── */
.bk-toolbar { position: sticky; top: -24px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 0; margin: 0 0 6px; background: var(--bg-base); }
.bk-search { flex: 1 1 260px; display: flex; align-items: center; gap: 9px; padding: 0 12px; height: 38px; border-radius: 10px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-muted); cursor: text; }
.bk-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15); }
.bk-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 14px; height: 100%; }
.bk-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
.bk-filters::-webkit-scrollbar { display: none; }
.bk-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.bk-chip span { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--bg-elevated); color: var(--text-muted); }
.bk-chip:hover { border-color: var(--border-default); color: var(--text-primary); }
.bk-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.bk-chip.is-on span { background: rgba(255, 255, 255, .22); color: #fff; }
.bk-chip--bad:not(.is-on) { color: var(--danger); border-color: rgba(239, 68, 68, .35); }
.bk-chip--run:not(.is-on) { color: #60a5fa; border-color: rgba(59, 130, 246, .35); }

/* ── groups ──────────────────────────────────────────────────────────── */
.bk-list { display: flex; flex-direction: column; gap: 8px; }
.bk-group-label { display: flex; align-items: baseline; gap: 8px; margin: 10px 2px 2px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); }
.bk-group-label em { font-style: normal; font-weight: 600; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.bk-group-hint { margin-left: auto; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-size: 12px; }
.bk-group-btn { width: 100%; border: 0; background: transparent; cursor: pointer; padding: 6px 2px; align-items: center; }
.bk-group-btn .bk-chev { margin-left: 8px; transition: transform .2s; color: var(--text-muted); }
.bk-unprot.is-open .bk-group-btn .bk-chev { transform: rotate(180deg); }
.bk-more { align-self: center; margin: 4px auto 0; display: block; }

/* ── a protected site ────────────────────────────────────────────────── */
.bk-site { border-radius: 12px; background: var(--bg-surface); border: 1px solid var(--border-subtle); overflow: hidden;
  transition: border-color .15s, box-shadow .15s; }
.bk-site:hover { border-color: var(--border-default); }
.bk-site.is-open { border-color: var(--border-default); box-shadow: 0 6px 22px rgba(0, 0, 0, .12); }
.bk-site.st-attention { border-color: rgba(239, 68, 68, .4); }
.bk-site.st-running { border-color: rgba(59, 130, 246, .45); }
.bk-site-head { width: 100%; display: grid; grid-template-columns: 12px minmax(0, 1.6fr) 70px minmax(0, 1.3fr) 82px 70px 18px; align-items: center;
  gap: 14px; padding: 13px 16px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.bk-site-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 12px; }
.bk-led { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 0 3px rgba(148, 163, 184, .15); }
.st-ok .bk-led { background: var(--success); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18), 0 0 10px rgba(34, 197, 94, .5); }
.st-pending .bk-led { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .18); }
.st-attention .bk-led { background: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, .2), 0 0 10px rgba(239, 68, 68, .55); animation: bk-pulse 1.6s ease-in-out infinite; }
.st-running .bk-led { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .2), 0 0 12px rgba(59, 130, 246, .7); animation: bk-pulse 1s ease-in-out infinite; }
@keyframes bk-pulse { 50% { opacity: .45; } }
.bk-site-id { display: flex; flex-direction: column; min-width: 0; }
.bk-site-name { font-weight: 700; font-size: 14.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-site-dom { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-scope { display: inline-flex; gap: 8px; font-size: 13px; justify-content: flex-end; }
.bk-scope sub { font-size: 9.5px; font-weight: 700; color: var(--text-muted); margin-left: 1px; }
.bk-site-status { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-attention .bk-site-status { color: var(--danger); font-weight: 600; }
.st-running .bk-site-status { color: #60a5fa; font-weight: 600; }
.bk-site-num { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; text-align: right; }
.bk-site-num b { color: var(--text-primary); font-weight: 700; }
.bk-chev { color: var(--text-muted); font-size: 12px; transition: transform .2s; }
.bk-site.is-open .bk-site-head .bk-chev { transform: rotate(180deg); }

.bk-site-body { padding: 2px 16px 16px; border-top: 1px solid var(--border-subtle); animation: bk-in .18s ease-out; }
@keyframes bk-in { from { opacity: 0; transform: translateY(-4px); } }
.bk-warn { display: flex; gap: 10px; margin-top: 14px; padding: 11px 13px; border-radius: 10px; background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .22); color: var(--danger); font-size: 13px; line-height: 1.5; }
.bk-warn > i { margin-top: 3px; }
.bk-warn-detail { margin-top: 4px; font-size: 12px; opacity: .85; font-family: var(--font-mono, monospace); word-break: break-word; }
.bk-body-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 10px; }
.bk-covers { font-size: 12.5px; color: var(--text-secondary); }
.bk-covers i { color: var(--success); margin-right: 4px; }
.bk-nights { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.bk-nights-cells { display: inline-flex; gap: 3px; }
.bk-nights-cells i { width: 11px; height: 11px; border-radius: 3px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); }
.bk-nights-cells i.ok { background: var(--success); border-color: transparent; opacity: .85; }
.bk-nights-cells i.part { background: #f59e0b; border-color: transparent; }
.bk-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bk-actions .btn i { margin-right: 6px; }
.bk-actions .bk-off { margin-left: auto; color: var(--danger); }

/* live strip while a backup runs */
.bk-run { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(59, 130, 246, .28); background: rgba(59, 130, 246, .07); margin-bottom: 12px; }
.bk-run-top { display: flex; align-items: center; gap: 12px; }
.bk-run-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; color: var(--text-muted); }
.bk-run-text b { font-size: 13px; color: var(--text-primary); }
.bk-run-text b span { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.bk-run-text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-run-pct { font-weight: 800; color: #60a5fa; font-size: 14px; }
.bk-run-cancel { flex-shrink: 0; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); font-size: var(--font-xs); font-weight: 600; cursor: pointer; }
.bk-run-cancel:hover { border-color: var(--danger); color: var(--danger); }
.bk-run-bar { height: 5px; border-radius: 3px; background: var(--bg-elevated); overflow: hidden; margin-top: 8px; }
.bk-run-bar i { display: block; height: 100%; background: linear-gradient(90deg, #E8720C, #8b5cf6, #3b82f6); transition: width .4s ease; }

/* restore points */
.bk-snaps { display: flex; flex-direction: column; }
.bk-rp-list { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: 10px; overflow: hidden; }
.bk-rp { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 11px 12px; border-top: 1px solid var(--border-subtle);
  transition: opacity .25s, height .3s ease, padding .3s ease, background .2s; }
.bk-rp:first-child { border-top: 0; }
.bk-rp:hover { background: var(--bg-elevated); }
.bk-rp.st-partial { background: rgba(245, 158, 11, .05); }
.bk-rp.is-deleting { opacity: .45; pointer-events: none; }
.bk-rp.is-gone { opacity: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.bk-rp.is-flash { background: rgba(var(--primary-rgb), .14); }
.bk-rp-when { display: flex; flex-direction: column; line-height: 1.35; }
.bk-rp-when b { font-size: 13px; color: var(--text-primary); }
.bk-rp-when span { font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono, monospace); }
.bk-rp-when em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.bk-rp-main { min-width: 0; }
.bk-rp-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.bk-rp-tags .badge { font-size: 10px; }
.bk-badge-warn { background: rgba(245, 158, 11, .15); color: #f59e0b; }
.bk-lock { font-size: 11px; color: var(--success); }
.bk-lock i { font-size: 10px; }
.bk-rp-size { font-size: 11.5px; color: var(--text-muted); }
.bk-rp-del { margin-left: auto; color: var(--text-muted); border: 0; background: transparent; cursor: pointer; }
.bk-rp-del:hover { color: var(--danger); }
.bk-rp-note { font-size: 12px; color: #f59e0b; margin-bottom: 6px; }
.bk-rp-parts { display: flex; flex-direction: column; gap: 4px; }
.bk-part { display: flex; align-items: center; gap: 9px; padding: 4px 4px 4px 9px; border-radius: 8px; background: var(--bg-elevated); min-width: 0; }
.bk-part-ico { width: 14px; text-align: center; font-size: 12.5px; color: var(--warning); }
.bk-part--db .bk-part-ico { color: #60a5fa; }
.bk-part--mail .bk-part-ico { color: var(--accent-purple, #a78bfa); }
.bk-part-txt { flex: 1; min-width: 0; display: flex; gap: 6px; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.bk-part-kind { color: var(--text-muted); }
.bk-part-name { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.bk-part-size { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.bk-part-acts { display: inline-flex; gap: 2px; padding-left: 6px; border-left: 1px solid var(--border-subtle); }
.bk-part-acts .bp-act { border: 0; background: transparent; cursor: pointer; color: var(--text-muted); }
.bk-part-acts .bp-act[data-act="browse"] { color: var(--warning); }
.bk-part-acts .bk-act-restore { color: var(--primary); }
.bk-rp-empty { font-size: 12.5px; color: var(--text-muted); padding: 10px 2px; }
.bk-rp-skel { display: flex; flex-direction: column; gap: 6px; }
.bk-rp-skel i { display: block; height: 46px; border-radius: 8px; background: linear-gradient(90deg, var(--bg-elevated), var(--bg-surface), var(--bg-elevated));
  background-size: 200% 100%; animation: bk-shimmer 1.2s linear infinite; }
@keyframes bk-shimmer { to { background-position: -200% 0; } }

/* releases: every publish, kept — rollback lives with the backups */
.bk-rel { margin-top: 16px; }
.bk-rel-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; }
.bk-rel-head span { font-weight: 700; color: var(--text-primary); }
.bk-rel-head span i { color: var(--accent-purple, #a78bfa); margin-right: 4px; }
.bk-rel-head em { font-style: normal; color: var(--text-muted); font-size: 11.5px; }
.bk-rel-list { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: 10px; overflow: hidden; }
.bk-rel-row { display: flex; align-items: center; gap: 11px; padding: 8px 10px 8px 12px; border-top: 1px solid var(--border-subtle); min-width: 0; }
.bk-rel-row:first-child { border-top: 0; }
.bk-rel-row:hover { background: var(--bg-elevated); }
.bk-rel-row.is-live { background: rgba(34, 197, 94, .06); }
.bk-rel-row.is-flash { background: rgba(139, 92, 246, .18); transition: background .3s; }
.bk-rel-ico { width: 16px; text-align: center; font-size: 13px; color: var(--accent-purple, #a78bfa); }
.bk-rel-row.is-live .bk-rel-ico { color: var(--success); }
.bk-rel-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.bk-rel-txt b { font-size: 13px; color: var(--text-primary); font-weight: 600; }
.bk-rel-txt span { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-rel-row .btn { flex: 0 0 auto; }
.bk-rel-row .btn i { margin-right: 5px; }
.bk-rel-live { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--success);
  background: rgba(34, 197, 94, .14); padding: 3px 8px; border-radius: 999px; }
.bk-comped { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--success); background: rgba(34, 197, 94, .13); padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.bk-tile-rb { font-size: 11px; color: var(--text-muted); margin: -4px 0 8px; }
.bk-tile-rb i { font-size: 10px; color: var(--accent-purple, #a78bfa); margin-right: 3px; }

/* unprotected sites: a compact grid, not thirty full cards */
.bk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 4px; }
.bk-tile { display: flex; flex-direction: column; gap: 3px; padding: 12px 12px 10px; border-radius: 11px; background: var(--bg-surface); border: 1px dashed var(--border-default); min-width: 0; }
.bk-tile-name { font-weight: 700; font-size: 13.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tile-dom { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tile-bits { font-size: 11.5px; color: var(--text-muted); display: flex; gap: 6px; margin: 2px 0 8px; flex-wrap: wrap; }
.bk-tile-bits i { font-size: 10px; margin-right: 2px; }
.bk-tile .btn { align-self: flex-start; }
.bk-tile .btn i { margin-right: 6px; }

.bk-first { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 14px; border: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(232, 114, 12, .07), rgba(99, 102, 241, .06)); }
.bk-first-title { font-weight: 800; font-size: 16px; color: var(--text-primary); margin-bottom: 4px; }
.bk-none { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 10px; color: var(--text-muted); font-size: 13.5px; text-align: center; }
.bk-none > i { font-size: 22px; opacity: .6; }
.bk-foot { margin: 22px 2px 8px; text-align: center; }

/* file browser rows (modal) */
.bk-file { display: flex; align-items: center; gap: 10px; padding: 7px 12px; }
.bk-file--sep { border-top: 1px solid var(--border-subtle); }
.bk-file-path { flex: 1; min-width: 0; font-size: 12.5px; font-family: var(--font-mono, monospace); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-file-when { white-space: nowrap; min-width: 120px; text-align: right; }
.bk-file-size { white-space: nowrap; min-width: 60px; text-align: right; }

/* ── tablet ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bk-site-head { grid-template-columns: 12px minmax(0, 1fr) 70px minmax(0, 1fr) 70px 18px; }
  .bk-site-size { display: none; }
}

/* ── phone ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .bk-hero { gap: 12px; }
  .bk-hero-mark { width: 46px; height: 46px; }
  .bk-hero-text { flex-basis: calc(100% - 60px); }
  .bk-hero-text h1 { font-size: 20px; }
  .bk-hero-text p { font-size: 12.5px; }
  .bk-switch { width: 100%; }
  .bk-switch button { flex: 1; justify-content: center; padding: 9px 10px; }
  .bk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bk-stat { padding: 10px 11px; gap: 9px; }
  .bk-stat-ico { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
  .bk-stat b { font-size: 16px; }
  .bk-stat--bad b, .bk-stat--good b, .bk-stat--run b { font-size: 13px; white-space: normal; }
  .bk-toolbar { top: -12px; padding: 8px 0; }
  .bk-search { flex-basis: 100%; height: 42px; }
  .bk-search input { font-size: 16px; } /* 16px stops iOS zooming the page on focus */
  .bk-group-hint { display: none; }

  /* row head: two lines — name and status on the left, points on the right */
  .bk-site-head { grid-template-columns: 10px minmax(0, 1fr) auto 14px; grid-template-areas: "led id num chev" "led status scope chev";
    row-gap: 3px; column-gap: 11px; padding: 12px 13px; }
  .bk-led { grid-area: led; align-self: start; margin-top: 5px; }
  .bk-site-id { grid-area: id; }
  .bk-scope { grid-area: scope; justify-self: end; font-size: 12px; gap: 7px; }
  .bk-site-status { grid-area: status; font-size: 12px; }
  .bk-site-num { grid-area: num; }
  .bk-site-size { display: none; }
  .bk-chev { grid-area: chev; }
  .bk-site-dom { display: none; }
  .bk-site-body { padding: 2px 12px 14px; }
  .bk-actions .btn { flex: 1 1 auto; justify-content: center; }
  .bk-actions .bk-off { margin-left: 0; }
  .bk-nights { width: 100%; justify-content: space-between; }
  .bk-nights-cells i { width: 13px; height: 13px; }

  .bk-rp { grid-template-columns: 1fr; gap: 6px; padding: 11px 10px; }
  .bk-rp-when { flex-direction: row; align-items: baseline; gap: 8px; }
  .bk-part { flex-wrap: nowrap; padding: 3px 3px 3px 8px; }
  .bk-part-txt { flex-direction: column; gap: 0; }
  .bk-part-kind { font-size: 10.5px; }
  .bk-part-acts .bp-act { width: 34px; height: 34px; font-size: 14px; } /* thumb-sized: these replace live data */
  .bk-rp-del { width: 34px; height: 34px; }
  .bk-tiles { grid-template-columns: 1fr 1fr; }
  .bk-tile .btn { align-self: stretch; justify-content: center; font-size: 12px; padding-left: 6px; padding-right: 6px; }
  .bk-file-when { display: none; }
  .bk-first { flex-direction: column; text-align: center; }
}
@media (max-width: 400px) {
  .bk-tiles { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE VAULT (3D)
   ═══════════════════════════════════════════════════════════════════════════ */
.bkv { position: relative; height: calc(100vh - var(--header-height, 64px) - 48px); height: calc(100dvh - var(--header-height, 64px) - 48px);
  min-height: 420px; border-radius: 16px; overflow: hidden; overflow: clip; background: #05070c; isolation: isolate; user-select: none; -webkit-user-select: none;
  touch-action: none; }
.bkv canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: grab; }
.bkv canvas.is-drag { cursor: grabbing; }
.bkv canvas.is-hover { cursor: pointer; }
.bkv-hud { position: absolute; z-index: 2; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.bkv-hud > * { pointer-events: auto; }
.bkv-top { top: 12px; left: 12px; right: 12px; justify-content: space-between; flex-wrap: wrap; }
.bkv-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 14, 22, .72); color: #e2e8f0; font-weight: 600; font-size: 13px; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bkv-btn:hover { background: rgba(30, 41, 59, .85); border-color: rgba(255, 255, 255, .22); }
.bkv-btn:focus-visible { outline: 2px solid #E8720C; outline-offset: 2px; }
.bkv-btn--icon { width: 44px; padding: 0; justify-content: center; font-size: 15px; }
.bkv-title { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 12px; background: rgba(10, 14, 22, .6);
  border: 1px solid rgba(255, 255, 255, .08); color: #e2e8f0; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bkv-title b { font-size: 14px; display: block; }
.bkv-title span { font-size: 11.5px; color: #94a3b8; }
.bkv-title .bk-gear path { fill: #1e293b; stroke: #64748b; }
.bkv-title .bk-gear--accent path { fill: rgba(232, 114, 12, .25); stroke: #E8720C; }
.bkv-legend { display: flex; gap: 12px; padding: 8px 12px; border-radius: 11px; background: rgba(10, 14, 22, .6); border: 1px solid rgba(255, 255, 255, .08);
  color: #cbd5e1; font-size: 11.5px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bkv-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.bkv-bottom { bottom: 12px; left: 50%; transform: translateX(-50%); transition: left .32s cubic-bezier(.2, .8, .2, 1); }
.bkv.has-panel .bkv-bottom { left: calc((100% - min(420px, 100% - 24px) - 24px) / 2); }
.bkv.has-panel .bkv-legend { display: none; }
.bkv-hint { position: absolute; z-index: 2; bottom: 64px; left: 50%; transform: translateX(-50%); padding: 7px 13px; border-radius: 999px;
  background: rgba(10, 14, 22, .7); color: #cbd5e1; font-size: 12px; white-space: nowrap; pointer-events: none; transition: opacity .6s; }
.bkv-hint.is-gone { opacity: 0; }
.bkv-tip { position: absolute; z-index: 3; padding: 6px 10px; border-radius: 8px; background: rgba(10, 14, 22, .88); color: #f1f5f9; font-size: 12px;
  pointer-events: none; white-space: nowrap; transform: translate(-50%, calc(-100% - 14px)); border: 1px solid rgba(255, 255, 255, .12); display: none; }
.bkv-tip small { display: block; color: #94a3b8; font-size: 11px; }
.bkv-skip { position: absolute; z-index: 4; bottom: 18px; right: 18px; }
.bkv-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #cbd5e1;
  text-align: center; padding: 24px; z-index: 5; }

/* the side panel — a drawer on desktop, a bottom sheet on phones */
.bkv-panel { position: absolute; z-index: 4; top: 64px; right: 12px; bottom: 12px; width: min(420px, calc(100% - 24px)); display: flex; flex-direction: column;
  border-radius: 14px; background: var(--bg-surface); border: 1px solid var(--border-default); box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  transform: translateX(calc(100% + 24px)); transition: transform .32s cubic-bezier(.2, .8, .2, 1); color: var(--text-primary); user-select: text; -webkit-user-select: text;
  touch-action: pan-y; }
.bkv-panel.is-open { transform: none; }
/* The wrapper the panel's content is painted into has to be a flex column too, or the body's flex:1 does
   nothing: the body then grows past the panel's bottom (clipped by the frame) instead of scrolling. */
.bkv-panel-inner { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.bkv-panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; border-bottom: 1px solid var(--border-subtle); }
.bkv-panel-head .bk-led { flex: 0 0 auto; }
.bkv-panel-title { flex: 1; min-width: 0; }
.bkv-panel-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bkv-panel-title span { display: block; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bkv-panel-close { width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--bg-elevated); color: var(--text-secondary); cursor: pointer; flex: 0 0 auto; }
.bkv-panel-body { flex: 1; overflow-y: auto; padding: 12px 14px 16px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.bkv-panel-body .bk-actions .btn { flex: 1 1 auto; justify-content: center; }
.bkv-panel-body .bk-actions .bk-off { margin-left: 0; }
.bkv-panel-body .bk-rp { grid-template-columns: 1fr; gap: 6px; }
.bkv-panel-body .bk-rp-when { flex-direction: row; align-items: baseline; gap: 8px; }
.bkv-panel-close:disabled { opacity: .35; cursor: default; }
/* In the rack's list, a restore point's date pulls its unit out of the rack. */
.bkv-panel-body:not(.bkv-drawer-body) .bk-rp-when { cursor: pointer; }
.bkv-panel-body:not(.bkv-drawer-body) .bk-rp-when::after { content: 'Pull out ›'; margin-left: auto; font-size: 11px; font-weight: 600; color: var(--primary); }
.bkv-drawer-tip { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.bkv-drawer-tip i { color: #E8720C; margin-right: 4px; }
.bkv-drawer-body .bk-rp-list { border-color: rgba(var(--primary-rgb), .35); }
.bk-part { transition: box-shadow .2s, background .2s; }
.bk-part.is-flash { box-shadow: 0 0 0 2px var(--primary); background: rgba(var(--primary-rgb), .12); }
.bkv-focus { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 10px; border-radius: 9px; background: var(--bg-elevated); font-size: 12.5px; color: var(--text-secondary); }
.bkv-focus button { margin-left: auto; }
.bkv-grab { display: none; }
.bkv-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.bkv-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border-subtle);
  background: var(--bg-elevated); color: var(--text-secondary); cursor: pointer; }
.bkv-link.is-on { border-color: var(--primary); color: var(--text-primary); }

@media (max-width: 768px) {
  .bkv { height: calc(100vh - var(--header-height, 56px) - 24px); height: calc(100dvh - var(--header-height, 56px) - 24px); border-radius: 12px; min-height: 360px; }
  .bkv-top { top: 8px; left: 8px; right: 8px; }
  .bkv-legend { display: none; }
  .bkv-title span { display: none; }
  .bkv-btn span { display: none; }
  .bkv-btn { padding: 0 12px; height: 42px; }
  .bkv-btn--icon { width: 46px; }
  .bkv-hint { bottom: 70px; font-size: 11.5px; }
  .bkv-panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 58%; border-radius: 16px 16px 0 0; transform: translateY(105%); }
  .bkv-panel.is-open { transform: none; }
  .bkv.has-panel .bkv-bottom { display: none; }
  .bkv-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border-default); margin: 8px auto 0; }
  .bkv-panel-head { padding-top: 8px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SKY HARBOR — CloudSites in 3D (assets/js/cloudsites-3d.js). It shares the
   Vault's frame, HUD and panel (.bkv-*); these are its own pieces.
   ═══════════════════════════════════════════════════════════════════════════ */
.csk { background: #0b0f24; }
.csk-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.csk-facts > div { display: flex; flex-direction: column; padding: 8px 9px; border-radius: 9px; background: var(--bg-elevated); min-width: 0; }
.csk-facts em { font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.csk-facts span { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csk-svc-head { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.csk-svc-head span { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.csk-svcs { display: flex; flex-direction: column; gap: 4px; }
.csk-svc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border-default);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.csk-svc.is-on { border-style: solid; border-color: var(--border-subtle); background: var(--bg-elevated); }
.csk-svc:hover { border-color: var(--primary); }
.csk-svc-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-surface); flex: 0 0 auto; }
.csk-svc:not(.is-on) .csk-svc-ico { opacity: .55; }
.csk-svc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.csk-svc-txt b { font-size: 13px; color: var(--text-primary); }
.csk-svc-txt em { font-style: normal; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csk-svc-go { font-size: 11.5px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.csk-svc:not(.is-on) .csk-svc-go { color: var(--text-muted); }
.csk-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg-elevated); font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.csk-status i { color: var(--text-muted); }
.csk-status.is-on i { color: var(--success); }
.csk-about { font-size: 13px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 12px; }
/* the line from a picked layer's "Open ›" to the panel's button (it sits over the panel, never takes clicks) */
.csk-link { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; overflow: visible; opacity: 0; transition: opacity .25s; color: #6cc895; }
.csk-link.is-on { opacity: 1; }
.csk-link path { fill: none; stroke: currentColor; stroke-linecap: round; }
.csk-link-glow { stroke-width: 14; opacity: .28; }
.csk-link-line { stroke-width: 4; stroke-dasharray: 12 9; animation: csk-link-flow .8s linear infinite; }
.csk-link circle { fill: currentColor; }
.csk-link-to { animation: csk-link-ping 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.csk-link.is-still .csk-link-line, .csk-link.is-still .csk-link-to { animation: none; }
@keyframes csk-link-flow { to { stroke-dashoffset: -21; } }
@keyframes csk-link-ping { 0%, 60% { transform: scale(1); opacity: 1; } 80% { transform: scale(1.8); opacity: .5; } 100% { transform: scale(1); opacity: 1; } }
.bkv-panel .csk-cta-nudge { animation: csk-cta-nudge 1s ease-out .3s 2; }
@keyframes csk-cta-nudge { 0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), .75); } 100% { box-shadow: 0 0 0 14px rgba(var(--primary-rgb), 0); } }
@media (prefers-reduced-motion: reduce) { .csk-link-line, .csk-link-to, .bkv-panel .csk-cta-nudge { animation: none; } }
.bkv-panel-body .bk-actions a.btn { text-decoration: none; }
.bkv-panel-body .bk-actions .btn i { margin-right: 6px; }
.cs-viewbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.cs-viewbar .bk-switch button[data-sky] i { color: #fb923c; }
@media (max-width: 768px) {
  .csk-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Vault: leaving and coming back. Walking out hides the controls; outside the locked door, a card. */
.bkv.is-leaving .bkv-bottom, .bkv.is-outside .bkv-bottom, .bkv.is-outside .bkv-hint, .bkv.is-leaving .bkv-hint,
.bkv.is-outside .bkv-leave, .bkv.is-leaving .bkv-leave, .bkv.is-outside .bkv-legend, .bkv.is-leaving .bkv-legend { display: none; }
.bkv-outside { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 4; display: none; justify-content: center; padding: 0 12px; pointer-events: none; }
.bkv.is-outside .bkv-outside { display: flex; animation: bk-in .4s ease-out; }
.bkv-outside-card { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 20px; border-radius: 14px;
  background: rgba(10, 14, 22, .78); border: 1px solid rgba(255, 255, 255, .1); color: #e2e8f0; text-align: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); max-width: 420px; }
.bkv-outside-card b { font-size: 15px; }
.bkv-outside-card b i { color: #E8720C; margin-right: 6px; }
.bkv-outside-card span { font-size: 12.5px; color: #94a3b8; margin-bottom: 8px; }
.bkv-outside-card > div { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.bkv-outside-card .bkv-btn span { display: inline; }
.bkv-btn--primary { background: #E8720C; border-color: #E8720C; color: #fff; }
.bkv-btn--primary:hover { background: #f08423; border-color: #f08423; }

/* CloudSites 3D: on a phone the layer stack IS the list, so with a site open the sheet only peeks. */
@media (max-width: 768px) {
  .csk .bkv-panel.is-peek { max-height: 34%; }
}
