:root {
  --ink: #151513;
  --muted: #706e66;
  --paper: #f5f3ed;
  --card: #fffdf8;
  --line: #d9d5ca;
  --accent: #fb5b48;
  --accent-dark: #dc3c2e;
  --mint: #bff3dc;
  --violet: #d7c8ff;
  --yellow: #ffe28a;
  --danger: #a72a20;
  --shadow: 0 24px 70px rgba(30, 28, 22, 0.12);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(215, 200, 255, 0.42), transparent 26rem),
    radial-gradient(circle at 92% 78%, rgba(191, 243, 220, 0.45), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, system-ui, -apple-system, sans-serif;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, video { max-width: 100%; }
[hidden] { display: none !important; }
.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; }

.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.03em; }
.brand-mark { width: 28px; height: 28px; border: 8px solid var(--ink); border-radius: 50% 50% 50% 12%; transform: rotate(-16deg); }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .nav button { padding: 10px 13px; text-decoration: none; border: 0; background: transparent; border-radius: 99px; cursor: pointer; }
.nav a:hover, .nav button:hover { background: rgba(21, 21, 19, 0.07); }
.nav-user { color: var(--muted); font-size: 0.9rem; padding-right: 6px; }
.inline { display: inline; }

.hero {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(34px, 7vw, 110px);
  align-items: center;
  padding: 40px 0 90px;
}
.eyebrow { margin: 0 0 20px; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.74rem; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
.display {
  max-width: 820px;
  margin-bottom: 26px;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: clamp(4rem, 9vw, 8.6rem);
  line-height: 0.86;
  letter-spacing: -0.075em;
  font-weight: 600;
}
.display .accent { color: var(--accent); }
.lede { max-width: 600px; color: #4f4d47; font-size: clamp(1.03rem, 2vw, 1.28rem); line-height: 1.55; }
.trust-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 30px; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.5); border-radius: 999px; padding: 8px 11px; font-size: .82rem; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--ink); }

.card { background: rgba(255, 253, 248, 0.92); border: 1px solid rgba(21,21,19,.11); border-radius: 28px; box-shadow: var(--shadow); }
.auth-card { padding: clamp(26px, 4vw, 42px); position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; width: 190px; height: 190px; right: -78px; top: -82px; border-radius: 50%; background: var(--yellow); }
.auth-card > * { position: relative; }
.auth-card h2 { font-family: "Avenir Next", Avenir, system-ui, sans-serif; font-size: 2rem; letter-spacing: -.045em; margin-bottom: 9px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.auth-foot { margin: 22px 0 0; font-size: .9rem; color: var(--muted); }
.auth-foot a { text-underline-offset: 3px; }

.form-grid { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; }
.field label, .label { font-weight: 650; font-size: .88rem; }
.field-hint { color: var(--muted); font-size: .78rem; line-height: 1.45; }
input, textarea, select {
  width: 100%;
  border: 1px solid #cbc7bc;
  background: #fffefa;
  color: var(--ink);
  padding: 13px 14px;
  border-radius: 12px;
  outline: none;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21,21,19,.09); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 17px;
  border-radius: 99px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-accent { border-color: var(--accent); background: var(--accent); }
.button-secondary { background: transparent; color: var(--ink); }
.button-danger { background: transparent; color: var(--danger); border-color: #d5aaa5; }
.button-small { min-height: 36px; padding: 8px 12px; font-size: .82rem; }
.button-block { width: 100%; }

.notice { margin: 0 0 22px; border: 1px solid #d7bf79; background: #fff2c8; border-radius: 14px; padding: 12px 14px; line-height: 1.45; }
.notice-error { border-color: #ddb0aa; background: #ffe3df; color: #7d211a; }
.notice-success { border-color: #8fcbb1; background: #dff8ec; color: #17593c; }

.page { padding: 50px 0 90px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 34px; }
.page-title { font-family: "Avenir Next", Avenir, system-ui, sans-serif; font-size: clamp(2.7rem, 7vw, 5.6rem); line-height: .95; letter-spacing: -.065em; margin-bottom: 11px; }
.page-subtitle { color: var(--muted); margin: 0; max-width: 650px; line-height: 1.55; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: 20px; }
.feature-card { min-height: 330px; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; background: var(--accent); color: #fff; }
.feature-card .eyebrow { color: #fff; opacity: .84; }
.feature-card h2 { font-family: "Avenir Next", Avenir, system-ui, sans-serif; font-size: clamp(2.3rem, 5vw, 4.4rem); line-height: .95; letter-spacing: -.06em; }
.feature-card .button { align-self: flex-start; background: #fff; color: var(--ink); border-color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { border: 1px solid var(--line); background: rgba(255,255,255,.5); border-radius: 20px; padding: 22px; }
.stat strong { display: block; font: 600 clamp(2rem, 5vw, 3.6rem)/1 "Avenir Next", Avenir, system-ui, sans-serif; letter-spacing: -.06em; }
.stat span { color: var(--muted); font-size: .82rem; }
.section-card { padding: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-family: "Avenir Next", Avenir, system-ui, sans-serif; letter-spacing: -.04em; }

.share-list { display: grid; gap: 10px; }
.share-row { border: 1px solid var(--line); background: #fffefa; border-radius: 17px; padding: 15px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.share-title { font-weight: 700; margin-bottom: 4px; }
.share-meta { color: var(--muted); font-size: .8rem; display: flex; gap: 9px; flex-wrap: wrap; }
.share-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.preview-progress { max-width: 360px; margin-top: 10px; }
.preview-progress-label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .76rem; }
.preview-progress-label strong { color: var(--ink); font-weight: 700; }
.preview-progress-track { height: 7px; margin-top: 5px; overflow: hidden; border-radius: 99px; background: #e8e2d8; }
.preview-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
.preview-progress.is-complete .preview-progress-track span { background: #42a978; }
.status { padding: 4px 8px; border-radius: 99px; background: var(--mint); color: #165b3e; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.status-off { background: #eadfdd; color: #7e3a33; }
.empty { border: 1px dashed #c7c2b7; border-radius: 16px; color: var(--muted); padding: 28px; text-align: center; }
.library-roots-card { margin-bottom: 20px; padding: 20px; }
.library-roots-card .section-head { margin-bottom: 12px; }
.library-roots-card .section-head p { margin: 3px 0 0; }
.source-selection-state { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; border: 1px solid #8fcbb1; background: #e7f8ef; border-radius: 14px; padding: 13px; }
.source-selection-state strong, .source-selection-empty strong, .source-selection-empty span { display: block; }
.source-selection-empty { margin-bottom: 12px; border: 1px dashed #c7c2b7; background: #fffefa; border-radius: 14px; padding: 16px; }
.source-selection-empty span { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.location-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.path-form { flex: 1 1 440px; display: flex; align-items: center; gap: 7px; }
.path-form input { min-width: 220px; }

.editor-layout { display: grid; grid-template-columns: minmax(0, .82fr) minmax(360px, 1.18fr); gap: 20px; align-items: start; }
.form-card { padding: clamp(22px, 4vw, 38px); }
.radio-group { display: grid; gap: 9px; }
.radio-card { display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 13px; cursor: pointer; background: #fffefa; }
.radio-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(251,91,72,.14); }
.radio-card strong { display: block; margin-bottom: 2px; }
.access-panel { margin-top: 10px; border-left: 3px solid var(--violet); padding: 5px 0 5px 13px; }
.file-picker { padding: 20px; position: sticky; top: 16px; }
.file-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.file-toolbar p { margin: 0; }
.media-breadcrumb { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-height: 42px; margin: 4px 0 12px; padding: 9px 11px; border: 1px solid var(--line); background: #fffefa; border-radius: 12px; font-size: .78rem; }
.media-breadcrumb a { color: var(--muted); text-underline-offset: 3px; }
.media-breadcrumb span[aria-current="page"] { font-weight: 700; }
.source-choice { display: grid; gap: 7px; margin-bottom: 12px; }
.selected-folder { display: flex; align-items: flex-start; gap: 11px; border: 1px solid #8fcbb1; background: #e7f8ef; border-radius: 14px; padding: 13px; }
.selected-folder strong { display: block; margin-bottom: 2px; }
.file-list { max-height: 620px; overflow: auto; display: grid; gap: 6px; padding-right: 3px; }
.folder-option { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); background: #fffefa; color: var(--ink); border-radius: 12px; text-decoration: none; }
.folder-option:hover { border-color: var(--ink); background: #f4f1e8; }
.folder-option strong, .folder-option span { display: block; }
.folder-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--mint); display: grid !important; place-items: center; font-weight: 800; }
.folder-parent { border-style: dashed; }
.file-option { display: grid; grid-template-columns: auto 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.file-option.file-readonly { grid-template-columns: 34px minmax(0, 1fr); cursor: default; }
.file-option:hover { background: #f4f1e8; border-color: var(--line); }
.file-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--violet); display: grid; place-items: center; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.file-path { color: var(--muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.users-grid { display: grid; grid-template-columns: minmax(290px, .65fr) minmax(0, 1.35fr); gap: 20px; align-items: start; }
.user-account-list { display: grid; }
.user-account { display: grid; gap: 13px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.user-account:first-child { padding-top: 4px; }
.user-account:last-child { padding-bottom: 0; border-bottom: 0; }
.user-account-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.user-account-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.password-reset-form { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(170px, 1fr) auto; gap: 8px; }
.password-reset-form input { min-width: 0; padding-block: 9px; }
.account-note { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.role { display: inline-block; padding: 4px 8px; background: var(--violet); border-radius: 99px; font-size: .72rem; text-transform: uppercase; font-weight: 700; }
.client-folders-card { margin-top: 20px; padding: clamp(22px, 4vw, 34px); }
.client-folder-manager { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
.client-folder-form { padding: 18px; border-radius: 18px; background: #f3efe6; }
.client-member-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.client-member-field legend { margin-bottom: 8px; padding: 0; font-weight: 650; font-size: .88rem; }
.client-member-options { display: flex; flex-wrap: wrap; gap: 7px; }
.client-member-option { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fffefa; cursor: pointer; font-size: .84rem; }
.client-member-option:has(input:checked) { border-color: var(--accent); background: rgba(251,91,72,.08); box-shadow: 0 0 0 2px rgba(251,91,72,.1); }
.client-member-option input { width: auto; margin: 0; }
.client-folder-list { display: grid; gap: 8px; }
.client-folder-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fffefa; text-decoration: none; }
.client-folder-row:hover { border-color: var(--ink); transform: translateY(-1px); }
.client-folder-row strong, .client-folder-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-folder-row small { margin-top: 2px; color: var(--muted); }
.client-folder-icon, .portal-folder-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--mint); font-weight: 800; }

.client-portal { max-width: 1040px; }
.portal-folder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.portal-folder-card { min-height: 132px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 22px; border: 1px solid rgba(21,21,19,.11); border-radius: 22px; background: rgba(255,253,248,.92); box-shadow: var(--shadow); text-decoration: none; }
.portal-folder-card:hover { transform: translateY(-2px); border-color: var(--ink); }
.portal-folder-card .portal-folder-mark { width: 52px; height: 52px; border-radius: 16px; }
.portal-folder-card strong, .portal-folder-card small { display: block; }
.portal-folder-card strong { font-size: 1.2rem; }
.portal-folder-card small { margin-top: 5px; color: var(--muted); }
.portal-empty { grid-column: 1 / -1; padding: 30px; }
.portal-other { margin-top: 22px; }
.portal-project-list { display: grid; }
.portal-project { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.portal-project:first-child { padding-top: 4px; }
.portal-project:last-child { padding-bottom: 0; border-bottom: 0; }
.portal-project p { margin: 4px 0; color: #514f48; line-height: 1.45; }
.portal-project span { color: var(--muted); font-size: .78rem; }
.portal-folder-head { margin-top: 18px; }
.back-link { display: inline-block; color: var(--muted); text-underline-offset: 3px; }
.folder-access-card { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr); gap: 22px; align-items: start; margin-bottom: 18px; padding: 22px; }
.folder-access-card h2 { margin-bottom: 4px; }
.folder-member-form { display: grid; gap: 12px; justify-items: start; }
.client-access-panel { background: rgba(215,200,255,.22); border-radius: 0 12px 12px 0; }
.client-access-panel strong, .client-access-panel span { display: block; }

.share-page { min-height: 100vh; padding: 24px 0 70px; }
.share-hero { padding: 70px 0 46px; }
.share-hero h1 { font-family: "Avenir Next", Avenir, system-ui, sans-serif; font-size: clamp(3.4rem, 10vw, 8rem); line-height: .87; letter-spacing: -.075em; max-width: 900px; margin-bottom: 18px; }
.share-description { font-size: 1.08rem; line-height: 1.6; color: #514f48; max-width: 640px; }
.share-client-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: -18px 0 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.82); }
.share-client-toolbar > div { min-width: 0; display: grid; gap: 3px; }
.share-client-toolbar span { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.share-client-toolbar .button { flex: 0 0 auto; }
.gallery-browser { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 18px; }
.gallery-browser .media-breadcrumb { flex: 1; margin: 0; }
.gallery-browser p { margin: 0; white-space: nowrap; }
.folder-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.public-folder { min-height: 92px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); background: rgba(255,253,248,.9); border-radius: 18px; text-decoration: none; }
.public-folder:hover { border-color: var(--ink); transform: translateY(-1px); }
.public-folder-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--mint); font-weight: 800; }
.public-folder strong, .public-folder small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-folder small { color: var(--muted); margin-top: 2px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gallery > .empty { grid-column: 1 / -1; }
.media-card { position: relative; overflow: hidden; border-radius: 20px; border: 1px solid rgba(21,21,19,.12); background: #e6e1d7; min-height: 250px; }
.media-card img, .media-card video { width: 100%; height: 100%; min-height: 250px; object-fit: cover; display: block; }
.media-preview-trigger { position: relative; display: block; width: 100%; height: 100%; min-height: 250px; padding: 0; border: 0; background: #e6e1d7; color: inherit; cursor: zoom-in; overflow: hidden; }
.media-preview-trigger:focus-visible { outline: 4px solid var(--yellow); outline-offset: -4px; }
.media-preview-trigger video { pointer-events: none; }
.video-play-badge { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; padding-left: 4px; background: rgba(255,255,255,.92); color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.24); font-size: 1rem; }
.media-file { min-height: 250px; display: grid; place-items: center; padding: 24px; text-align: center; background: linear-gradient(135deg, var(--violet), var(--mint)); }
.media-file strong { max-width: 100%; overflow-wrap: anywhere; }
.media-document .button { margin-top: 18px; }
.media-overlay { position: absolute; inset: auto 10px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 9px 8px 12px; background: rgba(21,21,19,.78); color: white; backdrop-filter: blur(8px); border-radius: 12px; }
.media-overlay span { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-overlay .media-actions { display: flex; gap: 5px; overflow: visible; }
.media-overlay a { flex: 0 0 auto; text-decoration: none; border-radius: 99px; background: white; color: var(--ink); padding: 7px 9px; font-size: .72rem; font-weight: 700; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-top: 24px; }
.pagination > :last-child { justify-self: end; }

.gallery-lightbox { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #0d0d0c; color: white; }
.gallery-lightbox::backdrop { background: rgba(0,0,0,.9); }
.lightbox-shell { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; height: 100%; }
.lightbox-toolbar, .lightbox-footer { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 22px; background: rgba(13,13,12,.92); }
.lightbox-toolbar { min-height: 66px; display: grid; grid-template-columns: 1fr auto 1fr; }
.lightbox-toolbar > [data-gallery-counter] { justify-self: start; }
.lightbox-close, .lightbox-arrow { border: 0; color: white; background: rgba(255,255,255,.13); cursor: pointer; }
.lightbox-close { width: 42px; height: 42px; border-radius: 50%; justify-self: end; font-size: 1.8rem; line-height: 1; }
.lightbox-close:hover, .lightbox-arrow:hover { background: rgba(255,255,255,.24); }
.lightbox-close:focus-visible, .lightbox-arrow:focus-visible, .lightbox-download:focus-visible, .lightbox-share:focus-visible, .lightbox-zoom-controls button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.lightbox-zoom-controls { display: inline-flex; align-items: center; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.13); }
.lightbox-zoom-controls button { min-width: 40px; height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: white; cursor: pointer; font-weight: 750; }
.lightbox-zoom-controls button[data-gallery-zoom-reset] { min-width: 62px; font-size: .78rem; }
.lightbox-zoom-controls button:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.lightbox-zoom-controls button:disabled { color: rgba(255,255,255,.3); cursor: default; }
.lightbox-stage { min-width: 0; min-height: 0; display: grid; place-items: center; padding: 12px 78px; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.lightbox-stage.is-image { touch-action: none; cursor: zoom-in; }
.lightbox-stage.is-zoomed { cursor: grab; }
.lightbox-stage.is-panning { cursor: grabbing; }
.lightbox-media { display: block; object-fit: contain; border-radius: 4px; box-shadow: 0 18px 60px rgba(0,0,0,.36); }
img.lightbox-media { max-width: none; max-height: none; transform-origin: center; will-change: transform; }
video.lightbox-media { width: min(100%, 1280px); height: 100%; max-height: 100%; }
.lightbox-arrow { position: absolute; z-index: 3; top: 50%; translate: 0 -50%; width: 52px; height: 52px; border-radius: 50%; font-size: 2.35rem; line-height: 1; }
.lightbox-previous { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-details { min-width: 0; display: grid; gap: 3px; }
.lightbox-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-details span { color: rgba(255,255,255,.62); font-size: .78rem; }
.lightbox-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.lightbox-download, .lightbox-share { min-width: 92px; padding: 9px 14px; border-radius: 999px; text-align: center; font: 700 .82rem/1.2 inherit; }
.lightbox-download { background: white; color: var(--ink); text-decoration: none; }
.lightbox-share { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.13); color: white; cursor: pointer; }
.lightbox-share:hover:not(:disabled) { background: rgba(255,255,255,.24); }
.lightbox-share:disabled { cursor: wait; opacity: .72; }

.locked { min-height: calc(100vh - 78px); display: grid; place-items: center; padding: 40px 0 90px; }
.locked-card { width: min(480px, 100%); padding: clamp(28px, 5vw, 46px); }
.lock-orb { width: 68px; height: 68px; border-radius: 50%; background: var(--violet); display: grid; place-items: center; font-weight: 800; margin-bottom: 25px; }
.locked-card h1 { font: 600 clamp(2.7rem, 9vw, 4.5rem)/.95 "Avenir Next", Avenir, system-ui, sans-serif; letter-spacing: -.065em; }

.error-page { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.error-page h1 { font: 600 clamp(4rem, 12vw, 9rem)/.9 "Avenir Next", Avenir, system-ui, sans-serif; letter-spacing: -.08em; margin-bottom: 18px; }

@media (max-width: 900px) {
  .hero, .dashboard-grid, .editor-layout, .users-grid, .client-folder-manager, .folder-access-card { grid-template-columns: 1fr; }
  .hero { align-items: start; padding-top: 55px; }
  .auth-card { max-width: 580px; }
  .file-picker { position: static; }
  .gallery, .folder-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-browser { align-items: flex-start; flex-direction: column; }
  .gallery-browser p { white-space: normal; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1180px); }
  .topbar { min-height: 68px; }
  .nav-user { display: none; }
  .nav a, .nav button { padding: 8px 9px; font-size: .82rem; }
  .hero { min-height: auto; gap: 42px; padding: 40px 0 65px; }
  .display { font-size: clamp(3.6rem, 18vw, 6rem); }
  .page { padding-top: 34px; }
  .page-head { align-items: start; flex-direction: column; }
  .path-form { align-items: stretch; flex-direction: column; }
  .path-form .button { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:last-child { grid-column: 1 / -1; }
  .share-row { grid-template-columns: 1fr; }
  .share-actions { justify-content: flex-start; }
  .gallery, .folder-gallery { grid-template-columns: 1fr; }
  .portal-folder-grid { grid-template-columns: 1fr; }
  .portal-project { align-items: flex-start; flex-direction: column; }
  .portal-project .button { width: 100%; }
  .share-client-toolbar { align-items: stretch; flex-direction: column; margin-top: -12px; }
  .share-client-toolbar .button { width: 100%; }
  .user-account-actions, .password-reset-form { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .user-account-actions form:not(.password-reset-form) .button, .password-reset-form .button { width: 100%; }
  .account-note { white-space: normal; }
  .media-card, .media-card img, .media-card video, .media-file { min-height: 310px; }
  .media-preview-trigger { min-height: 310px; }
  .share-hero { padding-top: 55px; }
  .lightbox-toolbar, .lightbox-footer { padding: 11px 12px; }
  .lightbox-toolbar { gap: 8px; }
  .lightbox-zoom-controls button { min-width: 34px; height: 34px; padding-inline: 7px; }
  .lightbox-zoom-controls button[data-gallery-zoom-reset] { min-width: 52px; }
  .lightbox-stage { padding: 8px 10px; }
  .lightbox-arrow { width: 44px; height: 44px; background: rgba(13,13,12,.58); }
  .lightbox-previous { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-details span { display: none; }
  .lightbox-download, .lightbox-share { min-width: 82px; padding-inline: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .card, .stat, .media-card { animation: arrive .45s ease both; }
  @keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
}
