/* Simplr's typefaces (as on simplr.my): Cormorant Garamond for headings, Quicksand for text.
   Served by the site itself: the page's security rules only allow its own files. */
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/cormorant-garamond.woff2) format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Quicksand"; src: url(/fonts/quicksand.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #ffffff;
  --rail: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f8f5f0;
  --hover: #f6f3ee;
  --active: #efe9df;
  --border: #ece7df;
  --text: #24201c;
  --muted: #857d72;
  --accent: #7d7262;       /* Simplr tan, deepened so text in it is easy to read */
  --tan: #a39986;          /* the logo's own tan */
  --accent-text: #ffffff;
  --accent-soft: #f3efe8;
  --ink: #24201c;          /* black "+ New" button */
  --ink-text: #ffffff;
  --danger: #c4261d;
  --ok: #12855b;
  --folder-back: #cbbfa9;
  --folder-front: #e3d9c8;
  --folder-people: #7d7262;
  --shadow: 0 1px 2px rgba(36, 32, 28, 0.04), 0 10px 30px rgba(36, 32, 28, 0.08);
  --radius: 12px;
  --serif: "Cormorant Garamond", Garamond, Georgia, serif;
  --sans: "Quicksand", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --rail: #1d1c1b;
    --surface: #201f1e;
    --surface-2: #262524;
    --hover: #2b2a28;
    --active: #33312f;
    --border: #353331;
    --text: #f0edea;
    --muted: #a8a19a;
    --accent: #c9bda6;
    --tan: #b3a891;
    --accent-text: #1b1917;
    --accent-soft: #2e2a24;
    --ink: #f0edea;
    --ink-text: #161514;
    --danger: #ff6b5e;
    --ok: #3ccf91;
    --folder-back: #8a7f6b;
    --folder-front: #b3a891;
    --folder-people: #2b2723;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.55 var(--sans);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }

/* ---------- Buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  padding: 7px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.active { background: var(--active); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.input {
  width: 100%; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
}
.input:focus, .btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, .rail-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.input { min-height: 80px; resize: vertical; }
.error-text { color: var(--danger); font-size: 14px; min-height: 20px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }

.brand { font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: 0.02em; display: flex; align-items: center; gap: 10px; }
/* The cloud-with-box mark (same as the browser tab icon); the "S" inside is hidden. */
.brand-mark {
  width: 34px; height: 34px; display: block; font-size: 0; color: transparent;
  background: url(/img/favicon.svg) center / contain no-repeat;
}

/* ---------- App frame: rail | navigation | content ---------- */
.app-shell { display: grid; grid-template-columns: 76px 256px minmax(0, 1fr); min-height: 100vh; }

.rail {
  background: var(--rail); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0;
  position: sticky; top: 0; height: 100vh;
}
.rail-logo { margin-bottom: 14px; text-decoration: none; }
.rail-item {
  width: 62px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600;
}
.rail-item svg { width: 22px; height: 22px; padding: 6px; box-sizing: content-box; border-radius: 12px; }
.rail-item:hover { color: var(--text); }
.rail-item:hover svg { background: var(--hover); }
.rail-item.active { color: var(--text); font-weight: 600; }
.rail-item.active svg { background: var(--active); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--border);
}

.side {
  border-right: 1px solid var(--border); background: var(--surface);
  padding: 26px 14px; position: sticky; top: 0; height: 100vh; overflow: auto;
}
.side-title { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: 0.01em; line-height: 1.2; padding: 0 12px 18px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-size: 15px;
}
.nav-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--active); font-weight: 600; }
.nav-item.active svg { color: var(--text); }

.content { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 18px 36px;
  position: sticky; top: 0; z-index: 20; background: var(--bg);
}
.nav-toggle, .top-account { display: none; }
.new-btn { background: var(--ink); border-color: var(--ink); color: var(--ink-text); padding: 9px 20px; border-radius: 999px; font-weight: 600; letter-spacing: 0.02em; }
.new-btn:hover { background: var(--ink); filter: brightness(1.25); }
.search-box { position: relative; flex: 1; max-width: 1180px; margin: 0; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-box .input { padding: 10px 18px 10px 44px; border-radius: 999px; border-color: var(--border); background: var(--rail); }
.search-box .input:hover { border-color: var(--muted); }

.page { padding: 10px 36px 72px; min-width: 0; }

/* ---------- Page header ---------- */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 16px 0 26px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border); position: relative;
}
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 1px; background: var(--tan); }
.page-title { flex: 1; min-width: 220px; }
.page-title h1 { margin: 0; font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1.1; letter-spacing: 0.005em; word-break: break-word; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-intro { margin: -8px 0 18px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13.5px; letter-spacing: 0.02em; margin-bottom: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; padding: 1px 4px; border-radius: 6px; }
.crumbs a:hover { color: var(--text); background: var(--hover); }
.crumbs .sep { color: var(--muted); }
.access-pill { display: inline-flex; align-items: center; font-size: 13px; color: var(--muted); padding: 0 4px; }
.access-pill.client, .access-pill.request { color: var(--accent); }
.loading { padding: 20px 0; }

/* ---------- Suggested for you ---------- */
.suggested { margin-bottom: 30px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--text); }
.suggest-strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.suggest-strip::-webkit-scrollbar { display: none; }
.suggest-card {
  flex: 0 0 290px; scroll-snap-align: start; display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; color: var(--text); text-decoration: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.suggest-card:hover { border-color: var(--tan); box-shadow: var(--shadow); }
.suggest-card .folder-icon { width: 40px; height: 40px; flex: none; }
.sc-text { min-width: 0; }
.sc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Toolbar: chips, view switch, selection ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 40px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px;
}
.chip svg { width: 15px; height: 15px; color: var(--accent); }
.chip.active svg { color: inherit; }
.chip:hover { background: var(--hover); }
.chip.active { background: var(--ink); color: var(--ink-text); }
.view-switch { display: flex; gap: 2px; }
.selection-bar { background: var(--accent-soft); border-radius: 10px; padding: 4px 8px; }
.selection-bar strong { margin-right: 8px; }

/* ---------- File table (list view) ---------- */
.file-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-table th, .file-table td { padding: 0 10px; height: 52px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-table th { height: 44px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.file-table th.sortable button {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 0; cursor: pointer; color: inherit;
  font-weight: inherit; font-size: inherit; letter-spacing: inherit; text-transform: inherit;
}
.file-table th.sortable button:hover, .file-table th[aria-sort] button { color: var(--text); }
.file-table th svg { width: 14px; height: 14px; }
.file-table td { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-table tbody tr { cursor: default; }
.file-table tbody tr:hover { background: var(--surface-2); }
.file-table tbody tr.selected { background: var(--accent-soft); }
.col-check { width: 44px; }
.col-name { width: auto; }
.col-modified { width: 190px; }
.col-size { width: 110px; }
.col-access { width: 190px; }
.col-location { width: 260px; }
.col-location a { color: var(--muted); text-decoration: none; }
.col-location a:hover { color: var(--accent); text-decoration: underline; }
.col-actions { width: 160px; text-align: right !important; }
.existing-link { margin-bottom: 8px; }
.existing-link .link-box { margin-top: 4px; }
.request-name .folder-icon, .request-name > svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.access-pill.link { color: var(--accent); }
.star-mark { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: #f5b400; }
.star-mark svg { width: 14px; height: 14px; }
.file-table td.col-actions .star-btn.on { opacity: 1; color: #f5b400; }

/* Quick access (starred items) in the navigation panel */
.side-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 22px 12px 6px; }
.quick-item { font-size: 14px; padding: 9px 12px; }
.quick-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-item .folder-icon, .quick-item svg { width: 18px; height: 18px; flex: none; }

/* Folder tree (the "Folders" panel), like Dropbox's. */
.tree { margin-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.tree-row { display: flex; align-items: center; gap: 4px; border-radius: 12px; min-width: 0; }
.tree-row:hover { background: var(--hover); }
.tree-row.active { background: var(--active); font-weight: 600; }
.tree-toggle {
  flex: none; width: 24px; height: 28px; display: grid; place-items: center;
  border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 0;
}
.tree-toggle svg { width: 14px; height: 14px; }
.tree-toggle:hover { color: var(--text); }
.tree-toggle.leaf { visibility: hidden; } /* no subfolders */
.tree-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 2px;
  color: var(--text); text-decoration: none; font-size: 14px;
}
.tree-link .folder-icon { width: 18px; height: 18px; flex: none; }
.tree-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-note { padding: 4px 0; }
.nav-only-phone { display: none; }

/* Photos page */
.photo-day { margin-bottom: 26px; }
.photo-day h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
/* Photos: title, controls and selection bar stay pinned under the top bar (not on phones). */
.photo-pinned {
  position: sticky; top: var(--top-h, 78px); z-index: 15; background: var(--bg);
  margin: 0 -36px 18px; padding: 0 36px 2px; border-bottom: 1px solid var(--border);
}
.photo-pinned .photos-bar:not(:empty) { margin-bottom: 10px; }
@media (max-width: 640px) { .photo-pinned { position: static; } }
/* Photos page controls: filter | grouping | zoom (like Dropbox's Photos). */
.photo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -8px 0 14px; }
.photo-controls .view-switch { margin-left: auto; } /* at the right, as on the other pages */
.photo-controls .divider { width: 1px; align-self: stretch; background: var(--border); }
@media (max-width: 640px) { .photo-controls .divider { display: none; } }
.seg { display: inline-flex; gap: 2px; }
.seg-btn { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg-btn:hover { background: var(--hover); color: var(--text); }
.seg-btn.active { background: var(--active); color: var(--text); }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.zoom { display: inline-flex; align-items: center; gap: 6px; }
.zoom-slider { width: 130px; accent-color: var(--accent); cursor: pointer; }
.photo-day h2 { display: flex; align-items: center; gap: 10px; }
.photo-day h2 span:first-of-type { font-family: var(--serif); font-size: 22px; }
.video-badge {
  position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(36, 32, 28, 0.6); color: #fff; pointer-events: none;
}
.video-badge svg { width: 13px; height: 13px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--tile, 150px), 45vw), 1fr)); gap: 4px; }
.photo { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; cursor: pointer; border-radius: 4px; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.15s; }
.photo:hover img { transform: scale(1.03); }
.photo.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo.selected img { transform: scale(0.92); }
.photo:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo .check {
  position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(0, 0, 0, 0.15); display: grid; place-items: center;
  opacity: 0; transition: opacity 0.1s; color: #fff;
}
.photo:hover .check, .photo.selected .check, .photo-grid.selecting .check { opacity: 1; }
.photo.selected .check { background: var(--accent); border-color: var(--accent); }
.photo .check svg { width: 14px; height: 14px; }
.photo-noprev { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; padding: 8px; color: var(--muted); font-size: 12px; text-align: center; word-break: break-all; }
.photo-noprev svg { width: 28px; height: 28px; }
.photos-more { padding: 16px 0 40px; text-align: center; }
.file-table td.col-actions { overflow: visible; }
.file-table td.col-actions .icon-btn { opacity: 0; }
.file-table tr:hover .col-actions .icon-btn, .file-table tr.selected .col-actions .icon-btn, .file-table .col-actions .icon-btn:focus-visible { opacity: 1; }
.file-table td.col-name { color: var(--text); }
.name-link { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-width: 0; }
.name-link:hover .row-name { text-decoration: underline; }
.row-thumb {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 6px; overflow: hidden; color: var(--muted);
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb svg { width: 26px; height: 26px; }
.row-thumb .folder-icon { width: 32px; height: 32px; }
.row-name { overflow: hidden; text-overflow: ellipsis; }
.cell-note { font-size: 12px; color: var(--muted); line-height: 1.2; }
.file-table.with-restore td { height: 58px; }
.file-table.with-restore .col-actions { width: 160px; }
.file-table td.col-actions .restore-btn { opacity: 1; }
.file-table.selecting .col-check input, .file-table tr:hover .col-check input { opacity: 1; }

/* ---------- File requests table ---------- */
.requests-bar { margin: -6px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips .chip { border: 1px solid transparent; cursor: pointer; font-size: 14px; }
.filter-chips .chip.active { background: var(--surface); color: var(--text); border-color: var(--text); }
.requests-table td { height: 62px; }
.requests-table .col-rname { width: auto; }
.requests-table .col-created { width: 150px; }
.requests-table .col-uploads { width: 100px; }
.requests-table .col-submitters { width: 110px; }
.requests-table .col-ractions { width: 540px; text-align: right; }
.link-btn { border: 0; background: none; padding: 2px 6px; border-radius: 6px; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }
.link-btn:hover { background: var(--accent-soft); }
.emails-input { min-height: 60px; }
.submitter-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; max-height: 320px; overflow: auto; }
.submitter { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--border); }
.submitter:last-child { border-bottom: 0; }
.submitter-info { flex: 1; min-width: 0; }
.submitter-email { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.requests-table td.col-rname { color: var(--text); }
.request-name { color: var(--text); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.request-name:hover { text-decoration: underline; }
.request-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.closed-row .request-name { color: var(--muted); }
.row-buttons { display: flex; justify-content: flex-end; gap: 6px; }
.small-btn { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.small-btn svg { width: 15px; height: 15px; }

/* ---------- Grid view ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 16px; margin-top: 6px; }
.tile { position: relative; border-radius: 12px; cursor: pointer; user-select: none; padding: 0 0 4px; }
.tile:hover .thumb { background: var(--hover); }
.tile.selected .thumb { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile .thumb {
  aspect-ratio: 1 / 0.92; background: var(--surface-2); border-radius: 10px;
  display: grid; place-items: center; overflow: hidden; padding: 9%; transition: background 0.1s;
}
/* Single files: the picture sits inside the grey square, not cropped. */
.tile .thumb > img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.tile .thumb > svg { width: 56px; height: 56px; color: var(--muted); }
.tile .thumb > .folder-icon { width: 58%; height: auto; }
.tile .meta { display: flex; align-items: flex-start; gap: 8px; padding: 10px 2px 0; }
.tile .meta-icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; color: var(--muted); }
.tile .meta-icon svg { width: 20px; height: 20px; }
.tile .meta-icon .folder-icon { width: 22px; height: 22px; }
.tile .meta-text { min-width: 0; flex: 1; }
.tile .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Small grid: more, smaller tiles; just the name under each. */
.grid.small { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px 12px; }
.grid.small .tile .thumb { padding: 7%; border-radius: 9px; }
.grid.small .tile .thumb > svg { width: 38px; height: 38px; }
.grid.small .tile .meta { padding-top: 7px; gap: 6px; }
.grid.small .tile .meta-icon { display: none; }
.grid.small .tile .name { font-size: 13px; }
.grid.small .tile .sub { display: none; }

/* Folder previews: up to three photos fanned out, like a little stack of prints. */
.preview-stack { position: relative; width: 100%; height: 100%; }
.preview-stack img {
  position: absolute; max-width: 62%; max-height: 72%; object-fit: contain;
  background: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18); border-radius: 2px;
}
.preview-stack.n1 img { left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%; max-height: 85%; }
.preview-stack.n2 img:nth-child(1) { left: 6%; top: 8%; }
.preview-stack.n2 img:nth-child(2) { right: 6%; bottom: 8%; }
.preview-stack.n3 img:nth-child(1) { left: 2%; top: 4%; }
.preview-stack.n3 img:nth-child(2) { left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; }
.preview-stack.n3 img:nth-child(3) { right: 2%; bottom: 4%; z-index: 2; }
.tile .check {
  position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--border); display: grid; place-items: center;
  opacity: 0; transition: opacity 0.1s; color: #fff;
}
.tile:hover .check, .tile.selected .check, .grid.selecting .check { opacity: 1; }
.tile.selected .check { background: var(--accent); border-color: var(--accent); }
.tile .check svg { width: 14px; height: 14px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); border: 2px dashed var(--border); border-radius: 12px; margin-top: 8px; }
.empty svg { width: 48px; height: 48px; }

/* ---------- Pop-up menus ---------- */
.menu {
  position: fixed; z-index: 90; min-width: 210px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; text-align: left; cursor: pointer; color: var(--text); font-size: 14px;
}
.menu-item svg { width: 17px; height: 17px; color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-header { padding: 4px 10px; font-size: 14px; font-weight: 600; }
.menu-header.muted { font-weight: 400; font-size: 13px; color: var(--muted); padding-bottom: 8px; }

/* ---------- Activity panel (bell in the rail) ---------- */
button.rail-item { border: 0; background: none; cursor: pointer; font: inherit; font-size: 11.5px; }
button.nav-item { border: 0; background: none; cursor: pointer; font: inherit; font-size: 15px; width: 100%; text-align: left; }
.activity-btn { position: relative; }
.activity-btn.unread::after {
  content: ''; position: absolute; top: 7px; left: calc(50% + 7px); width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--rail);
}
.nav-item.activity-btn.unread::after { top: 9px; left: 26px; box-shadow: 0 0 0 2px var(--surface); }
.activity-panel {
  left: 80px; top: 70px; width: 400px; max-height: calc(100vh - 90px); padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.activity-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--border); }
.activity-head h2 { font-size: 17px; margin: 0; }
.activity-list { overflow: auto; padding: 6px 8px 10px; }
.activity-section { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 6px; font-weight: 600; font-size: 14px; }
.activity-section .btn { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.activity-section .btn svg { width: 15px; height: 15px; }
.activity-row { display: flex; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none; position: relative; }
.activity-row:hover { background: var(--hover); }
.activity-row.unread::before { content: ''; position: absolute; left: 1px; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.activity-who {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--active); font-size: 12px; font-weight: 700;
}
.activity-text { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.activity-when { color: var(--muted); font-size: 12.5px; }
.activity-empty { padding: 16px 10px; }
@media (max-width: 900px) {
  .activity-panel { left: 8px; right: 8px; top: 8px; width: auto; max-height: calc(100vh - 16px); }
}

/* ---------- Drag and drop overlay ---------- */
.drop-overlay {
  position: fixed; inset: 0; background: rgba(163, 153, 134, 0.12); border: 3px dashed var(--accent);
  display: grid; place-items: center; z-index: 50; pointer-events: none; font-size: 20px; font-weight: 600; color: var(--accent);
}

/* ---------- Upload panel ---------- */
.upload-panel {
  position: fixed; right: 20px; bottom: 20px; width: 360px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); z-index: 40; overflow: hidden;
}
.upload-panel header { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.upload-panel .body { padding: 12px 14px; }
.upload-panel ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 160px; overflow: auto; font-size: 13px; }
.upload-panel li { color: var(--danger); padding: 2px 0; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.bar.done > div { background: var(--ok); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92); z-index: 60; display: flex; flex-direction: column; color: #fff; }
.lightbox header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.lightbox header .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox .btn { background: rgba(255, 255, 255, 0.1); border-color: transparent; color: #fff; }
.lightbox .stage { flex: 1; display: grid; place-items: center; min-height: 0; position: relative; overflow: hidden; }
.lightbox .stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* The video is held to the space between the title bar and the controls, whatever its size. */
.lightbox .stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-controls { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 10px 14px 16px; }
.video-controls .btn { min-width: 64px; justify-content: center; gap: 4px; }
.video-controls .btn svg { width: 18px; height: 18px; }
.video-controls .btn[aria-label="Play"], .video-controls .btn[aria-label="Pause"] { min-width: 52px; padding: 9px; border-radius: 50%; }
.video-cant { text-align: center; max-width: 420px; padding: 24px; display: grid; justify-items: center; gap: 6px; }
.video-cant > svg { width: 48px; height: 48px; opacity: 0.7; }
.video-cant p { margin: 0; }
.video-cant .small { opacity: 0.75; margin-bottom: 10px; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .nav.prev { left: 12px; }
.lightbox .nav.next { right: 12px; }

/* ---------- Cards (file requests, clients) ---------- */
.cards { display: flex; flex-direction: column; gap: 12px; max-width: 1100px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 500; }
.badge.on { background: rgba(18, 133, 91, 0.12); color: var(--ok); }
.link-box { display: flex; gap: 8px; margin-top: 10px; }
.link-box .input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; z-index: 70; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; width: min(480px, 100%); max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 28px 30px 24px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 18px; font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.15; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
/* New folder: "Who will have access" choice cards. */
.access-choices { border: 0; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 10px; }
.access-choices legend { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0; }
.access-choices > p { margin: 0 0 2px; }
.access-choice {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.access-choice:hover { border-color: var(--tan); }
.access-choice:has(input:checked) { border-color: var(--text); background: var(--surface-2); }
.access-choice input { accent-color: var(--text); width: 18px; height: 18px; margin: 0; flex: none; }
.ac-text { display: flex; flex-direction: column; gap: 2px; }
.share-sub { display: flex; align-items: center; gap: 8px; margin: -10px 0 18px; }
.share-sub .folder-icon { width: 18px; height: 18px; }

/* Folder picker (Move / Copy) */
.modal.picker { width: min(520px, 100%); }
.picker-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: 10px; font-size: 14px; }
.picker-crumbs .sep { color: var(--muted); }
.link-btn.plain { text-decoration: none; color: var(--text); font-weight: 500; }
.link-btn.plain:last-child { font-weight: 700; }
.picker-list { border: 1px solid var(--border); border-radius: 10px; height: 300px; overflow: auto; margin-bottom: 12px; }
.picker-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border);
  background: none; text-align: left; cursor: pointer; font-size: 14px;
}
.picker-row:hover:not(:disabled) { background: var(--hover); }
.picker-row:disabled { opacity: 0.45; cursor: not-allowed; }
.picker-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-row .folder-icon { width: 24px; height: 24px; }
.picker-row > svg:last-child { width: 16px; height: 16px; color: var(--muted); }
.picker-empty { padding: 14px; margin: 0; }
.modal .actions .spacer { flex: 1; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Login and set-password pages ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--rail); }
.login-card { width: 380px; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 24px; justify-content: center; font-size: 30px; flex-direction: column; gap: 6px; }
.login-card .brand .brand-mark { width: 48px; height: 48px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; }

/* ---------- Share link page ---------- */
.share-top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.share-main { max-width: 1280px; margin: 0 auto; padding: 18px 24px 30px; }
.share-message { text-align: center; padding: 80px 16px; }
.share-lock { margin: 60px auto; }
.share-lock h2 { margin: 0 0 6px; }
.zip-status { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.share-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 20px; }
.share-folder { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.share-folder:hover { background: var(--hover); }
.share-folder .folder-icon { width: 32px; height: 32px; flex: none; }
.share-folder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-photos { margin-bottom: 24px; }
.share-files { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; }
.share-file { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.share-file:last-child { border-bottom: 0; }
.share-file > svg { width: 24px; height: 24px; color: var(--muted); flex: none; }
.sf-text { flex: 1; min-width: 0; }
.sf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .share-main { padding: 14px 12px 24px; }
  .share-top { padding: 12px 16px; }
}

/* ---------- Public upload page (file request links) ---------- */
.req-wrap { max-width: 640px; margin: 0 auto; padding: 40px 16px; }
.req-wrap h1 { margin: 0 0 6px; font-size: 26px; }
.req-message { white-space: pre-wrap; margin: 0 0 20px; color: var(--muted); }
.dropzone {
  border: 2px dashed var(--border); border-radius: 14px; background: var(--surface);
  padding: 44px 20px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 48px; height: 48px; color: var(--accent); }
.dropzone .big { font-size: 18px; font-weight: 600; margin: 8px 0 4px; }
.status-card { margin-top: 20px; }
.file-list { list-style: none; padding: 0; margin: 12px 0 0; max-height: 280px; overflow: auto; font-size: 14px; }
.file-list li { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.file-list li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li.error { color: var(--danger); }
.file-list li.done .s { color: var(--ok); }
.footer-note { margin-top: 32px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
  .col-access { width: 150px; }
  .col-modified { width: 160px; }
  /* Request actions become icon-only buttons (names show on hover). */
  .requests-table .col-ractions { width: 230px; }
  .requests-table .btn-label { display: none; }
}
@media (max-width: 640px) {
  .requests-table .col-created, .requests-table .col-uploads { display: none; }
  .requests-table .col-submitters { width: 56px; }
  .requests-table .col-ractions { width: 200px; }
  .row-buttons { gap: 2px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .nav-only-phone { display: flex; } /* no rail on phones: switch panels from the drawer */
  /* The navigation panel becomes a slide-out drawer. */
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 60; height: auto;
    transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow);
  }
  body.nav-open .side { transform: none; }
  .nav-backdrop { display: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.35); }
  .nav-toggle { display: inline-grid; }
  .top-account { display: block; }
  .top { padding: 10px 16px; gap: 10px; }
  .page { padding: 4px 16px 60px; }
  .photo-pinned { margin: 0 -16px 18px; padding: 0 16px 2px; }
  .col-access, .col-location { display: none; }
}
@media (max-width: 640px) {
  .new-btn { padding: 8px 12px; }
  .col-modified { display: none; }
  .col-size { width: 80px; }
  .col-actions { width: 120px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 3px; }
  .file-table td.col-actions a.icon-btn { display: none; }
  .file-table.with-restore .col-actions { width: 130px; }
  .file-table td.col-actions .icon-btn { opacity: 1; }
  .page-title h1 { font-size: 32px; }
  .suggest-card { flex-basis: 240px; padding: 14px; }
  .section-head .muted { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 10px; }
  .tile .name { font-size: 14px; }
}
@media (min-width: 901px) {
  .nav-backdrop { display: none; }
}

/* ---------- Motion: gentle, quick, and off for people who ask for less ---------- */
:root { --ease: cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Hover and focus colour changes fade instead of snapping. */
.btn, .icon-btn, .chip, .seg-btn, .new-btn, .avatar, .nav-item, .rail-item, .rail-item svg, .tree-row, .tree-toggle,
.menu-item, .crumbs a, .file-table tbody tr, .access-choice, .activity-row, .picker-row, .input, .search-box .input, .link-btn {
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease),
    box-shadow 0.2s var(--ease), filter 0.18s var(--ease), transform 0.12s var(--ease);
}
/* A slight press when clicked. */
.btn:active:not(:disabled), .icon-btn:active, .chip:active, .seg-btn:active, .new-btn:active, .rail-item:active svg, .menu-item:active {
  transform: scale(0.97);
}
/* Tiles lift a little on hover. */
.tile .thumb { transition: background-color 0.18s var(--ease), box-shadow 0.22s var(--ease), transform 0.22s var(--ease); }
.tile:hover .thumb { transform: translateY(-2px); box-shadow: var(--shadow); }
.photo img { transition: transform 0.35s var(--ease); }

/* Menus and pop-ups (+ New, ⋯, account, Activity) drop in; dialogs rise in. */
@keyframes sc-drop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
@keyframes sc-rise-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes sc-fade-in { from { opacity: 0; } }
.menu { animation: sc-drop-in 0.18s var(--ease); transform-origin: top center; }
.modal-backdrop { animation: sc-fade-in 0.2s ease-out; }
.modal { animation: sc-rise-in 0.24s var(--ease); }
.lightbox { animation: sc-fade-in 0.22s ease-out; }
.toast { animation: sc-rise-in 0.24s var(--ease); }
.drop-overlay:not(.hidden) { animation: sc-fade-in 0.15s ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile:hover .thumb { transform: none; }
}
