/* ===== pixel share =====
 * Brand palette: slate #272D2D, mint #9FD8CB, coral #E08D79.
 * Mint means "go" (primary actions, selection); coral means "careful"
 * (destructive actions, warnings). Light theme follows the system setting.
 */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(/fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(/fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Silkscreen';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/silkscreen-latin.woff2) format('woff2');
}

:root {
  --slate: #272D2D;
  --mint: #9FD8CB;
  --mint-strong: #86cbbb;
  --coral: #E08D79;
  --coral-strong: #d77a64;
  --on-mint: #16201e;
  --on-coral: #2a1410;

  --bg: #eef3f1;
  --surface: #ffffff;
  --surface-2: #e2eae7;
  --line: #ccd9d5;
  --line-strong: #a9bbb6;
  --text: #1e2323;
  --text-2: #55625f;
  --link: #2a7465;
  --danger: #ad4630;
  --focus: #2a7465;
  --tint-mint: #dcefe9;
  --shadow: 0 1px 2px rgba(30, 35, 35, .06), 0 8px 24px rgba(30, 35, 35, .10);

  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-mark: 'Silkscreen', ui-monospace, monospace;
  --radius: 8px;
  --gutter: clamp(16px, 4vw, 40px);
  --page-max: 1240px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e2323;
    --surface: #272d2d;
    --surface-2: #313939;
    --line: #3a4444;
    --line-strong: #4d5a5a;
    --text: #e8efec;
    --text-2: #a3b1ad;
    --link: #9fd8cb;
    --danger: #ec9f8c;
    --focus: #9fd8cb;
    --tint-mint: #2b3e3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

/* ===== base ===== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
img, video { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--surface); padding: 10px 14px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 8px var(--gutter) 160px;
}

/* ===== wordmark + top bar ===== */
.topbar {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mark);
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--text);
  text-decoration: none;
}
/* 2×2 pixel block: the mark that survived from the original pixel theme. */
.wordmark-mark {
  width: 14px; height: 14px; flex: none;
  background:
    linear-gradient(var(--mint), var(--mint)) 0 0 / 7px 7px no-repeat,
    linear-gradient(var(--coral), var(--coral)) 7px 7px / 7px 7px no-repeat,
    linear-gradient(var(--text), var(--text)) 7px 0 / 7px 7px no-repeat;
}

.owner-nav { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s, border-color .12s, transform .06s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--mint); color: var(--on-mint); }
.btn-primary:hover:not(:disabled) { background: var(--mint-strong); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--text-2); }
.btn-quiet { color: var(--text); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); }
.btn-quiet[aria-pressed="true"] { background: var(--tint-mint); }
.btn-danger { background: var(--coral); color: var(--on-coral); }
.btn-danger:hover:not(:disabled) { background: var(--coral-strong); }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 44px; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-small.btn-icon { width: 36px; }

/* ===== form fields ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 600; }
.field-hint { font-weight: 400; color: var(--text-2); }
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px; /* 16px stops iOS zooming into the field */
}
.field select { padding-right: 32px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field input:focus-visible, .field select:focus-visible { outline-offset: 0; border-color: var(--focus); }
.field-note { font-size: 14px; color: var(--text-2); }

.choice-group { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice-group legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.choice {
  display: grid; grid-template-columns: 20px 1fr; gap: 2px 10px; align-items: start;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--focus); background: var(--tint-mint); }
.choice input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--link); }
.choice strong { font-weight: 600; }
.choice small { grid-column: 2; color: var(--text-2); font-size: 14px; }

.form-error { color: var(--danger); font-size: 15px; }

/* ===== login ===== */
.page-login .page {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding-bottom: 8vh;
}
.login { width: min(380px, 100%); display: grid; gap: 28px; }
.login .wordmark { font-size: 20px; }
.login .wordmark-mark { width: 18px; height: 18px; background-size: 9px 9px; background-position: 0 0, 9px 9px, 9px 0; }
.login-title { font-size: 28px; line-height: 1.15; font-weight: 650; letter-spacing: -.015em; }
.login-form { display: grid; gap: 16px; }

/* ===== message pages (404 etc.) ===== */
.message { max-width: 34rem; padding-top: 12vh; display: grid; gap: 12px; }
.message-title { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; font-weight: 650; letter-spacing: -.02em; }
.message p { color: var(--text-2); font-size: 18px; }

/* ===== dashboard ===== */
.dash-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 24px; }
.dash-title { font-size: clamp(36px, 6vw, 56px); line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.dash-intro { color: var(--text-2); margin: 12px 0 32px; max-width: 40rem; }

.folder-list { border-top: 1px solid var(--line); }
.folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.folder-row-name {
  font-size: 20px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25;
  color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Whole row is clickable through the name link; buttons sit above it. */
.folder-row-name::after { content: ''; position: absolute; inset: 0; }
.folder-row-name:hover { text-decoration: underline; }
.folder-row-facts {
  grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px 18px;
  font-size: 14px; color: var(--text-2);
}
.folder-row-actions { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; position: relative; z-index: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 8px; border-radius: 999px;
  background: var(--tint-mint); color: var(--text); font-weight: 500;
}
.pill::before { content: ''; width: 6px; height: 6px; background: var(--link); }
.folder-row.is-new { animation: row-flash 1.6s ease-out; }
@keyframes row-flash { from { background: var(--tint-mint); } to { background: transparent; } }

.empty-state { padding: 48px 0; max-width: 32rem; display: grid; gap: 16px; justify-items: start; }
.empty-state h2 { font-size: 22px; font-weight: 650; }
.empty-state p { color: var(--text-2); }

/* ===== folder page ===== */
.folder-head { padding: 20px 0 28px; display: grid; gap: 10px; }
.folder-title {
  font-size: clamp(40px, 8vw, 88px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.022em;
  font-variation-settings: 'opsz' 96;
  overflow-wrap: anywhere;
  max-width: 18ch;
}
.folder-count { font-size: 18px; font-weight: 500; margin-top: 6px; }
.folder-terms {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 4px 20px;
  color: var(--text-2); font-size: 15px;
}
.folder-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin-top: 18px; }
.folder-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.field-inline { min-width: min(280px, 100%); }

.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow);
  display: grid;
}
.menu-right { left: auto; right: 0; }
.menu button {
  display: grid; text-align: left; gap: 1px;
  padding: 10px 12px; border: 0; border-radius: 6px; background: none; cursor: pointer;
  font-size: 15px; font-weight: 600;
}
.menu button small { font-weight: 400; font-size: 13px; color: var(--text-2); }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button.danger { color: var(--danger); }

/* ===== gallery ===== */
.gallery-section + .gallery-section { margin-top: 40px; }
.gallery-heading {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 15px; font-weight: 650; margin-bottom: 12px;
}
.gallery-heading .count { color: var(--text-2); font-weight: 400; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px;
}
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0 calc(var(--gutter) * -1 + 2px); }
}

.tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  display: block;
  width: 100%;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.tile img, .tile video {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .2s, transform .15s;
  pointer-events: none;
}
.tile img.loaded, .tile video.loaded { opacity: 1; }
.tile:focus-visible { outline-offset: -3px; }
.tile-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: lowercase;
}
.tile-badge {
  position: absolute; left: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px 3px 5px; border-radius: 4px;
  background: rgba(16, 20, 20, .72); color: #fff; font-size: 12px; font-weight: 600;
}
.tile-badge svg { width: 12px; height: 12px; }
.is-new-file { animation: arrive .5s ease-out; }
@keyframes arrive { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* Selection: a check circle in the corner. Hover reveals it on desktop so
   people can see that items are selectable without a hidden gesture. */
.tile-check, .row-check {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid #fff; background: rgba(16, 20, 20, .35); color: transparent;
  transition: background-color .1s, opacity .1s;
}
.tile-check { position: absolute; top: 8px; left: 8px; opacity: 0; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.tile-check svg, .row-check svg { width: 14px; height: 14px; }
@media (hover: hover) {
  .tile:hover .tile-check { opacity: 1; }
}
.is-selecting .tile-check { opacity: 1; }
.is-selected .tile-check, .is-selected .row-check { background: var(--mint); border-color: var(--mint); color: var(--on-mint); }
.tile.is-selected img, .tile.is-selected video { transform: scale(.88); border-radius: 4px; }
.tile.is-selected::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--mint); pointer-events: none; }

/* documents */
.doc-list { border-top: 1px solid var(--line); }
.doc-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.row-check { border-color: var(--line-strong); background: transparent; cursor: pointer; display: none; padding: 0; }
.is-selecting .row-check { display: grid; }
.doc-icon {
  width: 44px; height: 52px; position: relative; flex: none;
  display: grid; align-items: end; justify-items: center; padding-bottom: 7px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px;
  font-size: 10px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .02em;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.doc-icon::before { content: ''; position: absolute; top: 0; right: 0; width: 12px; height: 12px; background: var(--line-strong); }
.doc-lead { display: flex; align-items: center; gap: 14px; min-width: 0; }
.doc-text { min-width: 0; }
.doc-name {
  display: block; font-weight: 600; color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer; max-width: 100%;
}
.doc-name:hover { text-decoration: underline; }
.doc-meta { font-size: 14px; color: var(--text-2); }
.doc-row.is-selected { background: var(--tint-mint); }

.load-more { margin-top: 16px; }
.sentinel { height: 1px; }
.gallery-status { padding: 32px 0; color: var(--text-2); }
.gallery-empty { padding: 40px 0 0; max-width: 30rem; display: grid; gap: 8px; }
.gallery-empty h2 { font-size: 22px; font-weight: 650; }
.gallery-empty p { color: var(--text-2); }

/* skeleton while the first page loads */
.grid-skeleton .tile { cursor: default; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ===== dock: selection bar + upload tray, pinned to the bottom ===== */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; justify-items: center; gap: 8px;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.dock > * { pointer-events: auto; width: min(720px, 100%); }

.selbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 8px 8px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
}
.selbar-count { font-weight: 650; margin-right: auto; padding-left: 4px; }
.selbar-actions { display: flex; gap: 8px; }
/* Phones: a two-row sheet, with full-width labelled actions underneath. */
@media (max-width: 560px) {
  .selbar { padding: 6px 8px 8px; gap: 4px 8px; }
  .selbar-actions { flex: 1 1 100%; }
  .selbar-actions .btn { flex: 1 1 0; padding: 0 8px; }
}

/* ===== upload tray ===== */
.tray {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  display: grid; gap: 10px;
}
.tray-head { display: flex; align-items: center; gap: 8px; }
.tray-title { font-weight: 650; margin-right: auto; }
.tray-sub { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The pixel progress bar: progress fills in whole 8px blocks. It's the one
   place the old 8-bit look lives on, and it reads at a glance. */
.pixel-bar {
  --block: 10px;
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--surface-2) 0 8px, transparent 8px var(--block));
  position: relative;
  overflow: hidden;
}
.pixel-bar-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: repeating-linear-gradient(90deg, var(--mint) 0 8px, transparent 8px var(--block));
  transition: width .2s steps(4, end);
}
.tray.is-paused .pixel-bar-fill { background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px var(--block)); }
.tray.is-done .pixel-bar-fill { width: 100% !important; }

.tray-problems { display: grid; gap: 6px; font-size: 14px; }
.tray-problems ul { margin: 0; padding: 0; list-style: none; max-height: 132px; overflow: auto; }
.tray-problems li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-top: 1px solid var(--line); }
.tray-problems li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-problems li span:last-child { color: var(--danger); flex: none; }
.tray-note { font-size: 14px; color: var(--text-2); }

/* drag & drop overlay */
.drop-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.drop-overlay p {
  padding: 28px 36px; max-width: 90vw;
  border: 3px dashed var(--link); border-radius: 16px;
  font-size: 22px; font-weight: 650; text-align: center;
  background: var(--surface);
}

/* ===== dialogs ===== */
.dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(16, 20, 20, .5); }
.dialog-body { padding: 24px; display: grid; gap: 18px; }
.dialog-title { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
.dialog-text { color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.btn-delete-folder { color: var(--danger); margin-right: auto; }
.dialog-wide { width: min(560px, calc(100vw - 32px)); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* ===== lightbox ===== */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #0d1010; color: #eef3f1;
  overflow: hidden;
}
.lightbox::backdrop { background: #0d1010; }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lb-bar {
  display: flex; align-items: center; gap: 4px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px 16px;
}
.lb-title { margin-right: auto; min-width: 0; }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pos { font-size: 13px; color: #9fb0ab; }
.lightbox .btn-quiet { color: #eef3f1; }
.lightbox .btn-quiet:hover { background: rgba(255,255,255,.1); }
.lb-stage { position: relative; display: grid; place-items: center; touch-action: pan-y pinch-zoom; overflow: hidden; }
.lb-stage img, .lb-stage video {
  max-width: 100%; max-height: 100%; object-fit: contain;
  grid-area: 1 / 1; user-select: none; -webkit-user-drag: none;
}
.lb-stage .lb-placeholder { width: 100%; height: 100%; filter: blur(8px); opacity: .6; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.08); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-nav svg { width: 24px; height: 24px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
@media (hover: none) { .lb-nav { display: none; } }
.lb-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); font-size: 14px; color: #9fb0ab; text-align: center; min-height: 44px; }
.lb-error { color: #9fb0ab; text-align: center; padding: 24px; display: grid; gap: 12px; justify-items: center; }

/* ===== share page (legacy single-file links) ===== */
.share { max-width: 760px; display: grid; gap: 14px; justify-items: start; padding-top: 16px; }
.share-preview { width: 100%; background: var(--surface-2); border-radius: 4px; overflow: hidden; display: grid; place-items: center; }
.share-preview img, .share-preview video { max-height: 70vh; }
.share-preview audio { width: 100%; margin: 24px; }
.share-title { font-size: clamp(26px, 4vw, 40px); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.share-meta { color: var(--text-2); }

/* ===== toasts ===== */
.toasts {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: 10px;
  background: var(--slate); color: #eef3f1; box-shadow: var(--shadow);
  font-weight: 500; animation: toast-in .18s ease-out;
}
.toast.is-error { background: var(--coral); color: var(--on-coral); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* ===== responsive ===== */
@media (max-width: 600px) {
  .topbar { padding-top: 14px; padding-bottom: 6px; }
  .owner-nav .btn { min-height: 38px; padding: 0 12px; font-size: 14px; }
  .folder-head { padding-top: 12px; }
  .folder-buttons { width: 100%; }
  .folder-buttons > .btn-primary { flex: 1 1 100%; }
  .folder-row-name { white-space: normal; overflow-wrap: anywhere; }
  .folder-row-actions .btn-label { display: none; }
  .folder-row-actions .btn:not(.btn-icon) { width: 44px; padding: 0; }
  .dash-head .btn { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
