:root {
  --bg: #0d0e11;
  --panel: #15171b;
  --panel-2: #1c1f25;
  --border: #272b33;
  --text: #ecedf0;
  --muted: #9097a3;
  --faint: #5d636e;
  --accent: #e5322d;
  --accent-2: #ff4b45;
  --accent-soft: rgba(229, 50, 45, 0.14);
  --ok: #2fbf71;
  --radius: 12px;
  --side: 232px;
  --top: 60px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- login ---------- */
#login { position: fixed; inset: 0; display: grid; place-items: center; z-index: 100;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(229,50,45,.18), transparent 60%), var(--bg); }
.login-card { width: min(380px, 92vw); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 32px; }
.login-card h1 { margin: 14px 0 4px; font-size: 22px; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #8f1512);
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(229,50,45,.35); }
.logo svg { width: 17px; height: 17px; stroke: #fff; }
.field { width: 100%; padding: 11px 13px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: var(--panel-2);
  border: 1px solid var(--border); white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #242830; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: #ff7b76; }
.btn.block { width: 100%; justify-content: center; margin-top: 12px; padding: 11px; }
.btn.icon { padding: 8px; }
.err { color: #ff7b76; min-height: 20px; margin-top: 8px; font-size: 13px; }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: var(--side) 1fr; height: 100%; }
#side { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; }
#side .brand { padding: 4px 8px 18px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav:hover { background: var(--panel-2); color: var(--text); }
.nav.active { background: var(--accent-soft); color: #fff; }
.nav.active svg { stroke: var(--accent-2); }
.side-spacer { flex: 1; }
.storage { padding: 12px; border-top: 1px solid var(--border); margin-top: 8px; color: var(--muted); font-size: 12px; }
.meter { height: 5px; background: var(--panel-2); border-radius: 4px; margin: 8px 0 6px; overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.link-btn { color: var(--muted); font-size: 12px; margin-top: 10px; display: inline-flex; gap: 6px; align-items: center; }
.link-btn:hover { color: var(--text); }

#main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
#top { height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--border); flex: none; }
.search { flex: 1; max-width: 560px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { width: 100%; padding: 9px 12px 9px 38px; background: var(--panel); border: 1px solid var(--border); border-radius: 22px; outline: none; }
.search input:focus { border-color: var(--accent); }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
#content { flex: 1; overflow: auto; padding: 18px 22px 120px; position: relative; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; min-height: 38px; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 650; }
.page-head .grow { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 18px; font-weight: 600; }
.crumbs a { color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.crumbs a:hover { background: var(--panel-2); color: var(--text); }
.crumbs a:last-child { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 2px; }
.seg button { padding: 6px 8px; border-radius: 8px; color: var(--muted); }
.seg button.on { background: var(--panel-2); color: var(--text); }
select.field { width: auto; padding: 7px 10px; }

/* ---------- selection bar ---------- */
#selbar { position: sticky; top: -18px; z-index: 20; margin: -18px -22px 14px; padding: 10px 22px; background: rgba(21,23,27,.96);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#selbar .count { font-weight: 600; margin-right: 8px; }

/* ---------- file list ---------- */
.list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.row { display: grid; grid-template-columns: 34px 44px 1fr 160px 100px 40px; align-items: center; gap: 8px; padding: 6px 10px;
  border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel-2); }
.row.sel { background: var(--accent-soft); }
.row.head { cursor: default; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; background: transparent; }
.row.head:hover { background: transparent; }
.row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.row .sub { color: var(--muted); font-size: 12.5px; }
.ficon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); overflow: hidden; }
.ficon img { width: 100%; height: 100%; object-fit: cover; }
.ficon.folder { background: rgba(229,50,45,.12); color: var(--accent-2); }
.check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--faint); display: grid; place-items: center; }
.sel .check, .tile.sel .check { background: var(--accent); border-color: var(--accent); }
.check svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; opacity: 0; }
.sel .check svg { opacity: 1; }
.more { opacity: .6; }
.row:hover .more { opacity: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative; user-select: none; }
.card:hover { border-color: #3a3f49; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.card .thumb { aspect-ratio: 4/3; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb svg { width: 40px; height: 40px; stroke-width: 1.4; }
.card .meta { padding: 9px 11px; }
.card .meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.card .meta .sub { color: var(--muted); font-size: 12px; }
.card .check { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.4); opacity: 0; }
.card:hover .check, .card.sel .check, .selecting .card .check { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 70px 20px; }
.empty svg { width: 48px; height: 48px; stroke-width: 1.3; color: var(--faint); margin-bottom: 10px; }
.empty h3 { color: var(--text); margin: 4px 0; font-weight: 600; }

/* ---------- photo timeline ---------- */
.day { margin-bottom: 18px; }
.day-head { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 4px 0 8px; font-size: 14px; }
.day-head .check { opacity: 0; cursor: pointer; }
.day:hover .day-head .check, .selecting .day-head .check { opacity: 1; }
.month-head { font-size: 22px; font-weight: 700; margin: 26px 0 12px; }
.month-head:first-child { margin-top: 0; }
.justify { display: flex; flex-wrap: wrap; gap: 4px; }
.justify::after { content: ""; flex-grow: 999999; }
.tile { position: relative; height: 200px; overflow: hidden; background: var(--panel-2); cursor: pointer; border-radius: 3px; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tile.sel img { transform: scale(.9); border-radius: 8px; }
.tile.sel { background: var(--accent-soft); }
.tile .check { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.35); border-color: #fff; opacity: 0; transition: opacity .15s; }
.tile:hover .check, .tile.sel .check, .selecting .tile .check { opacity: 1; }
.tile .badge { position: absolute; bottom: 6px; right: 7px; font-size: 11px; font-weight: 600; background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 6px; display: flex; align-items: center; gap: 4px; }
.tile .badge svg { width: 12px; height: 12px; }
.tile .fav { position: absolute; bottom: 6px; left: 7px; color: #fff; }
.tile .fav svg { width: 15px; height: 15px; fill: #fff; }
.tile .noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); }
#sentinel { height: 40px; }

/* ---------- albums ---------- */
.album-card .thumb { aspect-ratio: 1; }
.album-new .thumb { border: 2px dashed var(--border); background: transparent; }

/* ---------- viewer ---------- */
#viewer { position: fixed; inset: 0; background: #000; z-index: 72; display: flex; }
#viewer .stage { flex: 1; position: relative; display: grid; place-items: center; min-width: 0; }
#viewer .stage img, #viewer .stage video { max-width: 100%; max-height: 100vh; object-fit: contain; display: block; }
#viewer .stage iframe { width: min(1000px, 100%); height: calc(100vh - 64px); margin-top: 64px; border: 0; background: #fff; }
#viewer .stage pre { max-width: min(1000px, 94vw); max-height: 86vh; overflow: auto; background: var(--panel); padding: 20px; border-radius: 10px; white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; }
.vbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: 12px 14px;
  background: linear-gradient(rgba(0,0,0,.65), transparent); z-index: 3; }
.vbar .title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.vbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.vbtn:hover { background: rgba(255,255,255,.14); }
.vbtn.on svg { stroke: var(--accent-2); }
.vbtn.fav.on svg { fill: var(--accent-2); }
.vnav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px; background: rgba(0,0,0,.4); }
.vnav.prev { left: 14px; } .vnav.next { right: 14px; }
.vother { text-align: center; color: var(--muted); }
.vother svg { width: 70px; height: 70px; stroke-width: 1.2; }
.vother h3 { color: #fff; margin: 12px 0 4px; }
#vinfo { width: 340px; background: var(--panel); border-left: 1px solid var(--border); overflow: auto; padding: 20px; flex: none; }
#vinfo h4 { margin: 0 0 16px; font-size: 16px; }
.irow { display: flex; gap: 14px; margin-bottom: 16px; }
.irow svg { color: var(--muted); margin-top: 2px; }
.irow .k { font-weight: 500; word-break: break-word; }
.irow .v { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 9px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--muted); }
.chip:hover { color: var(--text); }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modals, menus, toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px; max-height: 88vh; display: flex; flex-direction: column; }
.modal h3 { margin: 0 0 14px; font-size: 18px; }
.modal .body { overflow: auto; flex: 1; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0 6px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.pick:hover { background: var(--panel-2); }
.pick.on { background: var(--accent-soft); }
.linkbox { display: flex; gap: 8px; margin-top: 10px; }
.linkbox input { flex: 1; }
#menu { position: fixed; z-index: 90; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; min-width: 200px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
#menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-align: left; }
#menu button:hover { background: #2a2e36; }
#menu button.danger { color: #ff7b76; }
#menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 2px; }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #24272e; border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: up .2s; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* ---------- uploads ---------- */
#uploads { position: fixed; right: 20px; bottom: 20px; width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; z-index: 70;
  box-shadow: 0 20px 50px rgba(0,0,0,.5); overflow: hidden; }
#uploads .uh { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
#uploads .uh .grow { flex: 1; }
#uploads .ul { max-height: 280px; overflow: auto; }
#uploads.min .ul { display: none; }
.uitem { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.uitem .n { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.uitem .s { color: var(--muted); font-size: 12px; }
.uitem .bar { grid-column: 1 / -1; height: 3px; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.uitem .bar div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.uitem.done .bar div { background: var(--ok); }
.uitem.fail .s { color: #ff7b76; }
#dropzone { position: fixed; inset: 0; z-index: 75; background: rgba(229,50,45,.12); border: 3px dashed var(--accent); display: grid; place-items: center; pointer-events: none; }
#dropzone div { background: var(--panel); padding: 18px 26px; border-radius: 14px; font-weight: 600; font-size: 16px; display: flex; gap: 10px; align-items: center; }

/* ---------- mobile ---------- */
@media (max-width: 800px) {
  #app { grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr) auto; height: 100dvh; }
  #main { height: auto; min-height: 0; }
  #side { order: 2; flex-direction: row; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); gap: 0; justify-content: space-around; }
  #side .brand, .side-spacer, .storage, .nav.desk { display: none; }
  .nav { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 6px 8px; flex: 1; align-items: center; }
  .nav.active { background: transparent; color: var(--accent-2); }
  #top { padding: 0 12px; gap: 8px; }
  #top .brand-m { display: flex !important; }
  .top-actions .label { display: none; }
  #content { padding: 14px 12px 100px; }
  #selbar { margin: -14px -12px 12px; padding: 10px 12px; top: -14px; }
  #selbar .label { display: none; }
  .row { grid-template-columns: 30px 40px 1fr 36px; }
  .row .c-date, .row .c-size { display: none; }
  .tile { height: 110px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  #viewer { flex-direction: column; }
  #vinfo { width: 100%; max-height: 45vh; border-left: 0; border-top: 1px solid var(--border); }
  .vnav { display: none; }
  #uploads { right: 10px; left: 10px; width: auto; bottom: 74px; }
}

/* =====================  2026 refresh  ===================== */
:root { --top: 64px; --ease: cubic-bezier(.2,.8,.2,1); --glass: rgba(18,20,24,.72); }
body { letter-spacing: -0.005em; }
#main { position: relative; }
#top { background: var(--glass); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); position: relative; z-index: 5; }
.search input { background: rgba(255,255,255,.05); border-color: transparent; height: 40px; border-radius: 12px; transition: background .2s, border-color .2s; }
.search input:focus { background: rgba(255,255,255,.08); border-color: rgba(229,50,45,.6); }
.nav { transition: background .15s var(--ease), color .15s var(--ease); }
.nav.active { background: linear-gradient(90deg, rgba(229,50,45,.18), rgba(229,50,45,.06)); box-shadow: inset 2px 0 0 var(--accent); }
.btn { transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s; }
.btn:active { transform: scale(.97); }
.page-head h2 { font-size: 24px; letter-spacing: -0.02em; }
.subhead { color: var(--muted); font-size: 13px; margin-top: 2px; }
.photos-head { align-items: flex-end; margin-bottom: 18px; }
.zoom { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); }
.zoom input { width: 120px; accent-color: var(--accent); }
#main.on-photos #content { padding-right: 70px; }

/* virtual timeline */
#vgrid { position: relative; width: 100%; }
.vb { position: absolute; left: 0; right: 0; }
.vrow { display: flex; gap: 4px; }
.vb.month-head { margin: 0; display: flex; align-items: flex-end; padding-bottom: 8px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.vb.day-head { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: #d7d9de; }
.day-head .day-n { color: var(--faint); font-weight: 500; font-size: 12px; }
.day-head .check { opacity: 0; cursor: pointer; transition: opacity .15s; }
.day-head:hover .check, .selecting .day-head .check, .day-head.sel .check { opacity: 1; }
.day-head.sel .check { background: var(--accent); border-color: var(--accent); }
.day-head.sel .check svg { opacity: 1; }
.vrow .tile { height: 100%; flex: none; border-radius: 6px; }
.tile { background: linear-gradient(100deg, #17191e 30%, #1f2228 50%, #17191e 70%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; }
.tile:has(img.ld), .tile:has(.noimg) { animation: none; background: var(--panel-2); }
@keyframes shimmer { to { background-position: -150% 0; } }
.tile img { opacity: 0; transition: opacity .35s var(--ease), transform .25s var(--ease); }
.tile img.ld { opacity: 1; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 35%); opacity: 0; transition: opacity .15s; pointer-events: none; }
.tile:hover::after, .selecting .tile::after { opacity: 1; }
.tile:hover img.ld { transform: scale(1.02); }
.tile.sel { background: rgba(229,50,45,.18); animation: none; }
.tile.sel img { transform: scale(.88); border-radius: 10px; }
.tile .check { z-index: 2; }
.tile .badge { z-index: 2; backdrop-filter: blur(6px); }

/* memories */
.memories { margin: -4px 0 22px; }
.mem-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; color: #e7e8eb; }
.mem-title svg { color: var(--accent-2); }
.mem-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mem-row::-webkit-scrollbar { display: none; }
.mem { flex: none; width: 168px; height: 220px; border-radius: 16px; position: relative; overflow: hidden; scroll-snap-align: start;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.75)), var(--bg) center / cover, var(--panel-2);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 12px; text-align: left;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.mem:hover { transform: translateY(-3px) scale(1.015); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.mem-k { font-weight: 700; font-size: 16px; color: #fff; }
.mem-s { font-size: 12px; color: rgba(255,255,255,.75); }

/* scrubber */
#scrubber { position: absolute; right: 0; top: var(--top); bottom: 0; width: 60px; z-index: 6; cursor: ns-resize; touch-action: none; user-select: none; }
#main:not(.on-photos) #scrubber, #main:not(.on-photos) #datepill { display: none; }
.sc-years { position: absolute; inset: 14px 0 14px 0; }
.sc-year { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11px; font-weight: 600; color: var(--faint); transition: color .15s; }
.sc-year.dot { width: 4px; height: 4px; border-radius: 50%; background: #3a3e46; right: 14px; }
#scrubber:hover .sc-year { color: var(--muted); }
.sc-thumb { position: absolute; right: 4px; width: 26px; height: 3px; border-radius: 2px; background: var(--accent); transform: translateY(-50%); margin-top: 14px; box-shadow: 0 0 12px rgba(229,50,45,.6); transition: top .08s linear; }
.sc-hover { position: absolute; right: 4px; left: -110px; transform: translateY(-50%); pointer-events: none; opacity: 0; transition: opacity .12s; display: flex; justify-content: flex-start; }
.sc-hover::after { content: ""; position: absolute; right: 0; width: 34px; height: 2px; background: #fff; top: 50%; }
.sc-hover span { background: #fff; color: #111; font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.4); white-space: nowrap; }
#scrubber.hovering .sc-hover, #scrubber.dragging .sc-hover { opacity: 1; }
#datepill { position: absolute; top: calc(var(--top) + 14px); left: 50%; transform: translate(-50%, -8px); z-index: 6; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.08); padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
#datepill.on { opacity: 1; transform: translate(-50%, 0); }

/* viewer */
#viewer { animation: vfade .18s var(--ease); }
@keyframes vfade { from { opacity: 0; } }
.vbar .title { line-height: 1.25; }
.vbar .vsub { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 400; }
.zoomwrap { width: 100%; height: 100vh; display: grid; place-items: center; overflow: hidden; }
.vimg { max-width: 100%; max-height: 100vh; object-fit: contain; cursor: zoom-in; transition: transform .3s var(--ease); user-select: none; -webkit-user-drag: none; }
.vimg.zoomed { transform: scale(2.6); cursor: zoom-out; transition: transform .3s var(--ease), transform-origin .05s linear; }
.vnav { transition: background .15s, opacity .15s; opacity: .75; }
.vnav:hover { opacity: 1; }

@media (max-width: 800px) {
  #main.on-photos #content { padding-right: 34px; }
  #scrubber { width: 30px; }
  .sc-year { display: none; }
  .sc-thumb { width: 18px; }
  .sc-hover { left: -96px; }
  .vrow { gap: 2px; }
  .vrow .tile { border-radius: 3px; }
  .zoom input { width: 80px; }
  .photos-head .btn .label { display: none; }
  .mem { width: 132px; height: 176px; }
}
#app { grid-template-rows: minmax(0, 1fr); }
#main { min-height: 0; overflow: hidden; }
#content { min-height: 0; }
@media (max-width: 800px) { #app { grid-template-rows: minmax(0, 1fr) auto; } }
@media (max-width: 800px) { .nav.active { box-shadow: none; background: transparent; } .day-head .check { display: none; } .selecting .day-head .check { display: grid; } }

.sc-year.nd { font-size: 10px; color: var(--muted); }
.vb.day-head { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Phase 1: storage, security ---------- */
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
#passkey-btn { justify-content: center; }
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1100px; }
.dash .span2 { grid-column: span 2; }
@media (max-width: 800px) { .dash { grid-template-columns: 1fr; } .dash .span2 { grid-column: auto; } }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-h h3 { margin: 0; font-size: 15px; font-weight: 650; }
.panel-h .grow { flex: 1; }
.panel-h > svg { color: var(--accent-2); }
.panel .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.panel .sub, .sub { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.panel .meter { height: 8px; margin: 10px 0; }
.stack { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 6px 0 14px; background: var(--panel-2); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.legend b { font-weight: 600; margin-left: 4px; }
.bars { display: flex; flex-direction: column; gap: 4px; }
.barrow { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 80px 90px; gap: 12px; align-items: center; padding: 7px 8px; border-radius: 9px; font-size: 13px; }
.barrow:hover { background: var(--panel-2); }
.barrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .track { height: 8px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.barrow .track span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 5px; }
.barrow b { text-align: right; font-weight: 600; }
@media (max-width: 800px) { .barrow { grid-template-columns: 1fr 70px; } .barrow .track, .barrow .sub { display: none; } }
.list.compact .row { cursor: pointer; }
.warn { margin-top: 8px; color: #ffb4a8; font-size: 12px; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; }
.callout svg { color: var(--accent-2); flex: none; }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.act-day { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 4px 6px; }
.act { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 8px 4px; border-radius: 10px; font-size: 13.5px; }
.act:hover { background: var(--panel-2); }
.act-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--panel-2); display: grid; place-items: center; }
.act-ic svg { width: 16px; height: 16px; }
.act.bad .act-ic { background: rgba(229,50,45,.18); color: var(--accent-2); }
.act-name { color: var(--text); opacity: .85; overflow-wrap: anywhere; }
.dupes { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.dgroup { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.dg-h { font-weight: 600; margin: 0 4px 10px; overflow-wrap: anywhere; }
.dg-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ditem { display: grid; grid-template-columns: auto 56px 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; }
.ditem.keep { border-color: rgba(80, 200, 120, .5); }
.ditem.drop { opacity: .8; border-style: dashed; }
.dthumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; }
.dthumb img { width: 100%; height: 100%; object-fit: cover; }
.dmeta { min-width: 0; } .dmeta .name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ditem .tag { font-size: 11px; font-weight: 650; margin-top: 3px; }
.ditem.keep .tag { color: #6fdc97; } .ditem.drop .tag { color: var(--accent-2); }
.mob-only { display: none !important; }
@media (max-width: 800px) { .mob-hide { display: none !important; } .mob-only { display: flex !important; } }

/* ---------- Phase 2: AI search ---------- */
.sr-h { margin: 6px 0 10px; font-size: 15px; }
.answer { background: linear-gradient(180deg, rgba(229,50,45,.10), rgba(229,50,45,.03)); border: 1px solid rgba(229,50,45,.35); border-radius: 16px; padding: 16px 18px; margin-bottom: 22px; max-width: 900px; }
.ans-q { display: flex; gap: 10px; align-items: center; font-weight: 650; margin-bottom: 10px; }
.ans-q svg { color: var(--accent-2); flex: none; }
.ans-body { line-height: 1.6; font-size: 14.5px; }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 2px; margin: 0 1px; cursor: pointer; }
.ans-src { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.src-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); font-size: 12.5px; cursor: pointer; max-width: 280px; }
.src-chip:hover { border-color: var(--accent); }
.src-chip img, .src-chip svg { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex: none; }
.src-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typing { display: inline-flex; gap: 4px; margin-right: 6px; vertical-align: middle; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Phase 3: music ---------- */
.pl-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; max-width: 1100px; }
.pl-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px; cursor: pointer; transition: border-color .15s, transform .15s; }
.pl-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.pl-art { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; background: radial-gradient(120% 120% at 0% 0%, #ff4b45 0%, #8f1512 55%, #2a0c0b 100%); color: #fff; }
.pl-art svg { width: 38%; height: 38%; opacity: .9; }
.pl-card.new .pl-art { background: var(--panel-2); color: var(--muted); }
.pl-card .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-tools { display: flex; gap: 10px; margin-bottom: 10px; max-width: 1100px; }
.m-tools .field { max-width: 320px; } .m-tools select.field { width: auto; }
.tracks { max-width: 1100px; }
.trow { display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px 56px 36px; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.trow:hover { background: var(--panel); }
.trow.playing { background: var(--accent-soft); }
.trow.playing .tname { color: #fff; }
.tplay { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--text); }
.trow:hover .tplay, .trow.playing .tplay { background: var(--accent); color: #fff; }
.tplay svg { width: 15px; height: 15px; }
.tname { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmeta .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.twave svg { width: 100%; height: 20px; fill: rgba(255,255,255,.25); }
.trow.playing .twave svg { fill: var(--accent-2); }
.tdur { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 10.5px; font-weight: 650; padding: 1px 7px; border-radius: 20px; background: rgba(179,107,255,.18); color: #cfa8ff; vertical-align: 1px; margin-left: 4px; }
@media (max-width: 800px) { .trow { grid-template-columns: 40px minmax(0, 1fr) 44px 32px; } .twave { display: none; } .m-tools .field { max-width: none; } }

#player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 76px; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(140px, 1fr); gap: 16px; align-items: center;
  padding: 0 16px; background: rgba(21, 23, 27, .92); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-top: 1px solid var(--border); }
body.has-player #main { padding-bottom: 76px; }
body.has-player #uploads { bottom: 96px; }
.pl-left { display: flex; gap: 12px; align-items: center; min-width: 0; }
.pl-cov { width: 48px; height: 48px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; background: radial-gradient(120% 120% at 0% 0%, #ff4b45 0%, #8f1512 60%, #2a0c0b 100%); }
.pl-txt { min-width: 0; } .pl-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-mid { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-ctrl { display: flex; justify-content: center; align-items: center; gap: 6px; }
.pbtn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.pbtn:hover { background: var(--panel-2); }
.pbtn.sm svg { width: 16px; height: 16px; } .pbtn.sm { color: var(--muted); } .pbtn.sm.on { color: var(--accent-2); }
.pbtn.main { width: 40px; height: 40px; background: #fff; color: #000; } .pbtn.main:hover { background: #fff; transform: scale(1.05); }
.pbtn.main svg { width: 17px; height: 17px; fill: currentColor; }
.pl-seek { display: grid; grid-template-columns: 42px 1fr 42px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-seek .t1 { text-align: left; } .pl-seek .t0 { text-align: right; }
.pl-seek canvas { width: 100%; height: 30px; cursor: pointer; touch-action: none; }
.pl-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.vol { width: 110px; accent-color: var(--accent); }
@media (max-width: 800px) {
  #player { bottom: calc(58px + env(safe-area-inset-bottom)); height: auto; grid-template-columns: 1fr auto; padding: 8px 10px; gap: 6px 10px; }
  .pl-mid { grid-column: 1 / -1; order: 3; } .pl-right .vol { display: none; }
  .pl-ctrl .pbtn.sm { display: none; } .pl-cov { width: 40px; height: 40px; }
  body.has-player #main { padding-bottom: 130px; }
}

/* Phase 4: devices */
.steps{margin:14px 0 0;padding-left:20px;line-height:1.55;color:var(--muted)}
.steps li{margin-bottom:8px}.steps b,.steps i{color:var(--text)}
.steps code{font-size:12px;background:var(--hover,rgba(127,127,127,.12));padding:1px 5px;border-radius:5px;word-break:break-all}

/* Phase 5: business tools */
label.chk{display:flex;align-items:center;gap:8px;margin-top:12px;color:var(--text);font-size:14px;cursor:pointer}
label.chk input{width:16px;height:16px;accent-color:var(--accent)}
.cmp-ov{position:fixed;inset:0;background:#000;z-index:80;display:grid;place-items:center}
.cmp-ov .vbar{position:fixed;top:0;left:0;right:0}
.cmp{position:relative;user-select:none;touch-action:none;cursor:ew-resize;max-width:calc(100vw - 40px);margin-top:40px}
.cmp img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.cmp-b{position:absolute;inset:0 auto 0 0;overflow:hidden;width:50%}
.cmp-b img{max-width:none}
.cmp-h{position:absolute;top:0;bottom:0;left:50%;width:3px;margin-left:-1.5px;background:#fff;box-shadow:0 0 12px rgba(0,0,0,.5)}
.cmp-h span{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:42px;height:42px;border-radius:50%;background:#fff;color:#111;display:grid;place-items:center;box-shadow:0 4px 16px rgba(0,0,0,.4)}
.cmp-h svg{width:22px;height:22px}
.cmp-l{position:absolute;top:12px;padding:4px 10px;border-radius:6px;background:rgba(0,0,0,.6);color:#fff;font-weight:800;font-size:12px;letter-spacing:.08em;pointer-events:none}
.cmp-l.l{left:12px}.cmp-l.r{right:12px}

/* Phase 6: viewer quality chip, Office previews, slideshow */
.qchip{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);background:rgba(0,0,0,.6);color:#fff;border:1px solid rgba(255,255,255,.2);border-radius:999px;padding:6px 14px;font-size:12.5px;cursor:pointer;z-index:3}
.docview{position:absolute;inset:60px 0 0;display:flex;justify-content:center;overflow:auto}
.docframe{width:min(100%,1100px);height:100%;border:0;background:#fff;border-radius:10px 10px 0 0}
.ss{position:fixed;inset:0;z-index:120;background:#000;cursor:none}
.ss.awake{cursor:default}
.ss-stage{position:absolute;inset:0;overflow:hidden}
.ss-slide{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity 1.1s ease}
.ss-slide.on{opacity:1}
.ss-slide.kb0.on{animation:kb0 9s ease-out forwards}.ss-slide.kb1.on{animation:kb1 9s ease-out forwards}
.ss-slide.kb2.on{animation:kb2 9s ease-out forwards}.ss-slide.kb3.on{animation:kb3 9s ease-out forwards}
@keyframes kb0{from{transform:scale(1)}to{transform:scale(1.07) translate(-1%,-1%)}}
@keyframes kb1{from{transform:scale(1.07) translate(1%,0)}to{transform:scale(1)}}
@keyframes kb2{from{transform:scale(1)}to{transform:scale(1.07) translate(1%,1%)}}
@keyframes kb3{from{transform:scale(1.06) translate(-1%,1%)}to{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.ss-slide.on{animation:none!important}}
.ss-bar{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;gap:6px;padding:18px 20px calc(18px + env(safe-area-inset-bottom));background:linear-gradient(transparent,rgba(0,0,0,.75));opacity:0;transition:opacity .3s}
.ss.awake .ss-bar{opacity:1}
.ss-bar button{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#fff;background:rgba(255,255,255,.12);font-size:13px;font-weight:700}
.ss-bar button.on{background:var(--accent)}
.ss-bar button svg{width:20px;height:20px}
.ss-count{color:rgba(255,255,255,.75);font-size:13px;margin-left:8px;font-variant-numeric:tabular-nums}
