:root {
  color-scheme: dark;
  font-family: "Segoe UI Variable Display", "Segoe UI", Inter, Roboto, system-ui, -apple-system, sans-serif;

  /* Monochrome glass — white to black, grays in between */
  --bg: #0a0a0b;
  --glow-1: rgba(255, 255, 255, 0.055);
  --glow-2: rgba(255, 255, 255, 0.03);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.12);
  --glass: rgba(18, 18, 19, 0.6);
  --glass-strong: rgba(22, 22, 23, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f2f2f2;
  --muted: #9c9c9c;
  --accent: #f2f2f2;
  --accent-strong: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --accent-contrast: #0d0d0d;
  --highlight: #d6d6d6;
  --highlight-soft: rgba(255, 255, 255, 0.08);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 16px 44px rgba(0, 0, 0, 0.55);
  --blur: blur(18px) saturate(150%);
  --radius: 14px;
  --radius-s: 8px;
  --speed: 160ms;

  background: var(--bg);
  color: var(--text);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f3;
  --glow-1: rgba(255, 255, 255, 0.85);
  --glow-2: rgba(0, 0, 0, 0.035);
  --surface: rgba(255, 255, 255, 0.5);
  --surface-2: rgba(0, 0, 0, 0.05);
  --surface-3: rgba(0, 0, 0, 0.09);
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.17);
  --text: #141414;
  --muted: #6b6b6b;
  --accent: #141414;
  --accent-strong: #000000;
  --accent-soft: rgba(0, 0, 0, 0.07);
  --accent-contrast: #ffffff;
  --highlight: #4d4d4d;
  --highlight-soft: rgba(0, 0, 0, 0.06);
  --danger: #c62f35;
  --danger-soft: rgba(198, 47, 53, 0.1);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.07);
  --shadow-2: 0 16px 44px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 700px at 88% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 640px at -12% 108%, var(--glow-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

body.authed {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

body:not(.authed) .sidebar {
  display: none;
}

body:not(.authed) main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

svg {
  flex: none;
}

html,
body {
  transition: background-color var(--speed) ease, color var(--speed) ease;
}

::selection {
  background: var(--surface-3);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

button,
input,
a {
  font: inherit;
}

button,
a.button,
a[download] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-2);
  padding: 8px 16px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background var(--speed) ease, border-color var(--speed) ease, color var(--speed) ease;
}

button:hover,
a.button:hover,
a[download]:hover {
  background: var(--surface-3);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.primary:hover {
  background: var(--accent-strong);
}

.secondary {
  background: transparent;
  border-color: var(--line-strong);
}

.secondary:hover {
  background: var(--surface-2);
}

.iconBtn {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.uploadToast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  min-width: 230px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-2);
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploadToast:empty {
  display: none;
}

.uploadToast::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--text) var(--p, 0%), var(--surface-3) var(--p, 0%));
}

.langSelect {
  width: 100%;
  margin-top: 12px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.langSelect:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

/* ---------- sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 20px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.brandMark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-1);
}

.nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
}

.nav:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav.active {
  background: var(--surface-3);
  color: var(--text);
}

.nav svg {
  width: 20px;
  height: 20px;
}

.storage {
  margin-top: auto;
  padding: 14px 12px 6px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.label {
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.bar,
.largeBar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bar span,
.largeBar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- topbar ---------- */

main {
  min-width: 0;
}

body.authed main {
  background: var(--surface);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(150px, 232px) minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}

.titleBlock {
  min-width: 0;
}

.titleBlock h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -0.2px;
}

.titleBlock span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.searchWrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 720px;
}

.searchWrap svg {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.searchWrap.hidden {
  display: none;
}

.topbar input[type="search"] {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 16px 9px 40px;
  transition: background var(--speed) ease, border-color var(--speed) ease;
}

.topbar input[type="search"]:hover {
  background: var(--surface-3);
}

.topbar input[type="search"]:focus {
  border-color: var(--line-strong);
  outline: none;
  background: var(--surface);
}

/* ---------- login ---------- */

.login {
  width: min(400px, 100%);
  padding: 32px 30px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-2);
}

.loginBrand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.loginBrand .brandMark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.loginBrand .brandMark svg {
  width: 26px;
  height: 26px;
}

.login h1 {
  font-size: 24px;
  letter-spacing: -0.3px;
  margin: 0;
}

.loginBrand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
}

form {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

label input,
input {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  padding: 11px 13px;
  transition: border-color var(--speed) ease, background var(--speed) ease, box-shadow var(--speed) ease;
}

label input:focus {
  outline: none;
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#loginError {
  color: var(--danger);
  min-height: 20px;
  font-size: 14px;
}

.deviceStatus {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  min-height: 20px;
  font-size: 14px;
}

.deviceStatus::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
  transition: background var(--speed) ease;
}

.deviceStatus.ok {
  color: var(--text);
}

.deviceStatus.ok::before {
  background: var(--text);
}

.hidden {
  display: none !important;
}

/* ---------- content panels ---------- */

.gallery,
.storagePanel {
  padding: 20px 24px;
}

#galleryPanel {
  padding-right: 64px;
}

.dropZone {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(8px);
}

.dropZone.dragging {
  display: grid;
}

.dropZone div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-2);
  color: var(--muted);
}

.dropZone strong {
  font-size: 16px;
  color: var(--text);
}

/* ---------- photo grid ---------- */

.day {
  margin: 0 0 26px;
}

.day h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  grid-auto-rows: 168px;
  gap: 4px;
}

.tile {
  min-height: 0;
  padding: 0;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms ease;
}

.tile img:not([src]) {
  opacity: 0;
}

.tile:hover img {
  transform: scale(1.04);
}

.tile.noThumb {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.tile.noThumb > svg {
  width: 34px;
  height: 34px;
}

.tileBadge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.tileBadge svg {
  width: 14px;
  height: 14px;
}

/* ---------- multi-select ---------- */

.tileCheck {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.35);
  color: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
  z-index: 2;
}

.tile:hover .tileCheck,
.tile.selected .tileCheck {
  opacity: 1;
}

.tile.selected .tileCheck {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-contrast);
}

.tileCheck svg {
  width: 14px;
  height: 14px;
}

.tile.selected img {
  transform: scale(0.9);
}

.tile.selected {
  outline: 3px solid var(--accent-strong);
  outline-offset: -3px;
}

.selectionBar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.selectionBar.hidden {
  display: none;
}

.selectionBar .selectionCount {
  font-weight: 600;
  white-space: nowrap;
}

.selectionBar .actions {
  display: flex;
  gap: 8px;
}

.albumPicker {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg, #141414);
  color: inherit;
  padding: 20px;
  min-width: 280px;
  max-width: 90vw;
}

.albumPicker::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.albumPicker h3 {
  margin: 0 0 14px;
}

.albumPicker .pickerList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.albumPicker .pickerList button {
  width: 100%;
  text-align: left;
}

.albumPicker .pickerCancel {
  margin-top: 14px;
  width: 100%;
}

/* ---------- timeline scrubber ---------- */

.timeline {
  position: fixed;
  top: 78px;
  bottom: 16px;
  right: 0;
  width: 56px;
  z-index: 6;
  user-select: none;
  touch-action: none;
  cursor: pointer;
}

.timelineYears span {
  position: absolute;
  right: 12px;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}

.timelineHandle {
  position: absolute;
  right: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
}

.timelineHandle::after {
  content: "";
  position: absolute;
  right: 8px;
  top: -1px;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--text);
}

.timelineHandle span {
  position: absolute;
  right: 44px;
  top: 0;
  transform: translateY(-50%);
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.timeline:hover .timelineHandle span,
.timeline.dragging .timelineHandle span {
  opacity: 1;
}

.timeline:hover .timelineYears span,
.timeline.dragging .timelineYears span {
  color: var(--text);
}

/* ---------- drive ---------- */

.driveHeader,
.sectionHead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.driveHeader h2,
.sectionHead h2 {
  margin: 0 auto 0 0;
  font-size: 20px;
  letter-spacing: -0.2px;
}

.sectionHead span {
  color: var(--muted);
}

.drivePath {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.drivePath button {
  background: transparent;
  color: var(--text);
  padding: 5px 10px;
  min-height: 30px;
  font-weight: 600;
}

.drivePath button:hover {
  background: var(--surface-2);
}

.drivePath span {
  color: var(--muted);
}

.driveList {
  display: grid;
}

.driveRow {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  transition: background var(--speed) ease;
}

.driveRow:hover {
  background: var(--surface);
}

.driveRow strong,
.driveRow span {
  display: block;
}

.driveRow span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.driveRow strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  font-size: 14.5px;
}

.driveRow .download,
.driveRow .delete {
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 6px 12px;
}

.driveRow .download:hover {
  background: var(--surface-2);
  color: var(--text);
}

.driveRow .delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.driveOpen {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  background: transparent;
}

.driveOpen:hover {
  background: var(--surface-2);
}

.driveIcon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  color: var(--muted);
}

.driveIcon svg {
  width: 20px;
  height: 20px;
}

.driveIcon.folder {
  background: var(--surface-3);
  color: var(--text);
}

.driveIcon.pdf {
  background: var(--danger-soft);
  color: var(--danger);
}

.driveIcon.image,
.driveIcon.text {
  background: var(--surface-2);
  color: var(--text);
}

.driveIcon.video {
  background: var(--highlight-soft);
  color: var(--highlight);
}

/* ---------- storage panel ---------- */

.storageHero {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.largeBar {
  height: 10px;
  margin: 0;
  border-radius: 6px;
}

.metricGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  letter-spacing: -0.4px;
}

.emptyState {
  display: grid;
  place-items: center;
  min-height: 200px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ---------- viewer ---------- */

dialog {
  width: 100vw;
  height: 100vh;
  border: 0;
  padding: 0;
  max-width: none;
  max-height: none;
  background: #000;
  color: #f5f5f5;
}

dialog[open] {
  animation: fadeIn 200ms ease;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.viewerTop {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: linear-gradient(rgba(0, 0, 0, 0.75), transparent);
  transition: opacity 250ms ease;
}

@media (hover: hover) {
  .viewerTop {
    opacity: 0;
  }

  dialog:hover .viewerTop,
  dialog:focus-within .viewerTop {
    opacity: 1;
  }
}

.viewerTop button,
.viewerTop a {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.viewerTop button:hover,
.viewerTop a:hover {
  background: rgba(255, 255, 255, 0.22);
}

#viewerName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #fff;
}

.viewerTop > div:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewerNav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.viewerNav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.viewerNav.prev {
  left: 14px;
}

.viewerNav.next {
  right: 14px;
}

#viewerImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: pinch-zoom;
  animation: fadeIn 220ms ease;
}

#viewerFrame,
#viewerVideo,
#viewerText {
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 86px 24px 24px;
  background: #050505;
  color: #f5f5f5;
}

#viewerVideo {
  object-fit: contain;
  padding: 86px 0 24px;
}

#viewerText {
  overflow: auto;
  white-space: pre-wrap;
}

.viewerStrip {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  overflow-x: auto;
  scrollbar-width: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.viewerStrip::-webkit-scrollbar {
  display: none;
}

.stripThumb {
  flex: 0 0 auto;
  width: 54px;
  height: 64px;
  padding: 0;
  min-height: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0.55;
  box-shadow: none;
  transition: opacity 160ms ease, outline-color 160ms ease;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.stripThumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stripThumb.current,
.stripThumb:hover {
  opacity: 1;
}

.stripThumb.current {
  outline-color: #fff;
}

/* ---------- animations ---------- */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  body.authed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    height: auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: var(--glass-strong);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-top: 1px solid var(--line);
  }

  body.authed main {
    padding-bottom: 84px;
  }

  .brand,
  .storage,
  .timeline {
    display: none;
  }

  .nav {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    font-size: 11.5px;
    border-radius: var(--radius-s);
  }

  .topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 10px 14px;
  }

  .titleBlock,
  #logoutButton {
    display: none;
  }

  .searchWrap {
    flex: 1 1 100%;
    order: 2;
    max-width: none;
  }

  .uploadToast {
    right: 12px;
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .gallery,
  .storagePanel {
    padding: 14px;
  }

  #galleryPanel {
    padding-right: 14px;
  }

  .tiles {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    grid-auto-rows: 112px;
    gap: 3px;
  }

  .driveRow {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .driveRow .download {
    display: none;
  }

  .metricGrid {
    grid-template-columns: 1fr;
  }

  .viewerNav.prev {
    left: 8px;
  }

  .viewerNav.next {
    right: 8px;
  }
}

/* ---------- shared albums (owner) ---------- */
.albumList { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.albumCard {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.albumCard .albumOpen {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  border-radius: var(--radius-s);
}
.albumCard .albumOpen:hover { background: var(--surface-3); }
.albumCard .albumOpen strong { font-size: 15px; }
.albumCard .albumOpen span { color: var(--muted); font-size: 13px; }
.albumCard .actions { display: flex; gap: 6px; padding: 0 6px 4px; }
.albumCard .actions button { flex: 1; }
.albumDetailHead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.albumDetailHead h3 { flex: 1; margin: 0; font-size: 18px; }
.contribList { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.contribRow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 8px 12px;
}
.contribRow span { flex: 1; font-size: 14px; }
.contribRow .actions { display: flex; gap: 6px; }
.tileWho {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  padding: 10px 4px 3px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
