[hidden] {
  display: none !important;
}

@font-face {
  font-family: "Helvetica Now";
  src: url("/fonts/HelveticaNowDisplay-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Helvetica Now";
  src: url("/fonts/HelveticaNowDisplay-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Helvetica Now";
  src: url("/fonts/HelveticaNowDisplay-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  font-family: "Helvetica Now", Arial, sans-serif;
  color: #2e2e2e;
  background: #222;
  font-size: 16px;
  --bg: #f7f7f7;
  --bg-alt: #f5f5f3;
  --ink: #2e2e2e;
  --dim: #595959;
  --dimmer: rgba(23, 23, 23, 0.35);
  --line: rgba(23, 23, 23, 0.12);
  --line-strong: rgba(23, 23, 23, 0.2);
  --dark: #222;
  --dark-hover: #3a3a3a;
  --light-hover: #e7e7e2;
  --light-active: #dcdcd6;
  --gold: #d4a537;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(1rem, 2.25vw, 2.5rem);
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #222;
  color: var(--ink);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

.native-select {
  display: none !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  text-align: left;
}

.custom-select-trigger[aria-expanded="true"] {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

.custom-select-arrow {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.18s var(--ease);
}

.custom-select.is-open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  max-height: 15rem;
  padding: 0.25rem;
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.16);
}

.custom-select.opens-up .custom-select-menu {
  top: auto;
  bottom: calc(100% + 0.25rem);
}

.custom-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 500;
}

.custom-select-option.is-selected {
  background: var(--light-hover);
}

.custom-select-option.is-selected::after {
  margin-left: auto;
  color: var(--gold);
  content: "✓";
}

button.custom-select-option:not(:disabled):hover {
  background: var(--dark);
  color: #fff;
}

button,
a,
input,
select {
  touch-action: manipulation;
}

button {
  min-height: 2.5rem;
  padding: 0.55rem 0.875rem;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition:
    color 0.18s var(--ease),
    background-color 0.18s var(--ease);
}

button:not(:disabled):hover {
  background: var(--dark);
  color: #fff;
}

button:not(:disabled):active {
  background: var(--dark-hover);
  color: #fff;
}

.has-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.button-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-only .button-icon {
  width: 1.15rem;
  height: 1.15rem;
}

button.icon-only {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  line-height: 0;
}

button:disabled {
  opacity: 0.38;
  cursor: default;
}

button.primary {
  background: var(--dark);
  color: #fff;
}

button.primary:not(:disabled):hover {
  background: var(--gold);
  color: var(--dark);
}

button.primary:not(:disabled):active {
  background: #bd8d23;
  color: var(--dark);
}

button.danger {
  border: 1px solid #d8a3a3;
  background: #fff3f2;
  color: #a52f2f;
}

button.danger:not(:disabled):hover {
  background: #a52f2f;
  color: #fff;
}

button.ghost {
  background: transparent;
}

button.ghost:not(:disabled):hover {
  background: var(--dark);
  color: #fff;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(23, 23, 23, 0.35);
}

input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  min-height: 0;
  padding: 0;
  accent-color: var(--dark);
}

input:focus,
textarea:focus,
select:focus,
button:focus,
a:focus {
  outline: none;
  box-shadow: none;
}

label {
  display: grid;
  gap: 0.6rem;
  color: var(--dim);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.optional-label {
  margin-left: 0.35rem;
  color: #8a8a8a;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 2.35vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.046875rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03125rem;
}

p {
  line-height: 1.4;
}

small,
.muted {
  color: var(--dim);
}

.brand {
  display: flex;
  align-items: end;
  gap: 1rem;
  margin: 0;
}

.brand-mark {
  display: block;
  width: 3.75rem;
  height: 2.1rem;
  line-height: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-light {
  display: none !important;
}

.brand-product {
  padding-left: 0.875rem;
  border-left: 1px solid var(--line-strong);
  font-size: 0.875rem;
  line-height: 1.4;
}

.shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--dark);
  overflow: hidden;
}

.sidebar {
  height: calc(100dvh - 0.5rem);
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.25rem 0.25rem;
  background: var(--dark);
  color: #fff;
}

.sidebar .brand {
  margin-bottom: 2rem;
  padding-inline: 0.75rem;
}

.sidebar .brand-dark,
.auth-intro .brand-dark {
  display: none !important;
}

.sidebar .brand-light,
.auth-intro .brand-light {
  display: block !important;
}

.sidebar .brand-product,
.auth-intro .brand-product {
  border-color: rgba(255, 255, 255, 0.24);
}

.nav {
  width: 100%;
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #dfdfdf;
  text-align: left;
  font-weight: 400;
}

.nav:last-of-type {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

button.nav:not(:disabled):hover {
  background: var(--dark-hover);
  color: #fff;
}

.nav.active {
  background: #fff;
  color: var(--ink);
}

.nav.active:hover {
  background: var(--light-hover);
}

.nav-index {
  color: #898989;
  font-size: 0.75rem;
  font-weight: 500;
}

.nav.active .nav-index {
  color: var(--dim);
}

.sidebar-footer {
  margin-top: auto;
  padding: 1.5rem 0.75rem 0.5rem;
  color: #898989;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.main {
  min-width: 0;
  min-height: 0;
  height: calc(100dvh - 0.5rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
  overflow: hidden;
}

.topbar {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.625rem var(--gutter);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.search {
  flex: 1;
  min-width: 0;
  max-width: 36rem;
  border-color: transparent;
  background: var(--bg-alt);
}

.account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  white-space: nowrap;
}

.avatar {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  background: var(--dark);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
}

.account .ghost {
  border-left: 1px solid var(--line);
}

.content {
  width: 100%;
  min-height: 0;
  max-width: 120rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  padding: 1.25rem clamp(1.25rem, 2vw, 2rem) 2rem;
  overflow: hidden;
  overscroll-behavior: contain;
}

.heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.summary {
  margin: 0.35rem 0 0;
  color: var(--dim);
  font-size: 0.875rem;
  letter-spacing: 0.009375rem;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--dim);
}

.crumbs button {
  min-height: auto;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 400;
}

.crumbs button:not(:disabled):hover,
.crumbs button:not(:disabled):active {
  border-bottom-color: var(--gold);
  background: transparent;
  color: var(--ink);
}

.table-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.browser-list {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 0.55rem 0.875rem;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #fff;
  color: var(--dim);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  font-size: 0.875rem;
}

td.name {
  font-size: 0.9375rem;
}

td.name:has([data-open]) {
  cursor: pointer;
}

td.check {
  width: 3.25rem;
  cursor: pointer;
}

th.check {
  cursor: pointer;
}

.selection-hit {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  margin: -0.55rem -0.55rem -0.55rem 0;
  cursor: pointer;
}

td.check:hover,
th.check:hover,
.selection-hit:hover {
  background: #eeeeea;
}

tbody tr {
  transition: background-color 0.35s var(--ease);
}

tbody tr.is-selected,
.card.is-selected {
  background: var(--light-hover);
}

tbody tr[data-row-open] {
  cursor: pointer;
}

tbody tr[data-row-open] input,
tbody tr[data-row-open] button {
  cursor: pointer;
}

td.row-options {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #eeeeea;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: 400;
}

button.file-name:not(:disabled):hover {
  background: transparent;
  color: inherit;
}

.initial-loading {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  cursor: wait;
}

.initial-loading > span {
  width: min(24rem, calc(100% - 2rem));
  display: grid;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.9rem 1rem;
  background: var(--dark);
  color: #fff;
}

.initial-loading b {
  font-weight: 500;
}

.browser-loading {
  position: absolute;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(3px);
  cursor: wait;
}

.browser-list.is-loading,
.table-wrap.is-loading {
  overflow: hidden;
}

.browser-loading > span {
  width: min(24rem, calc(100% - 2rem));
  display: grid;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.9rem 1rem;
  background: var(--dark);
  color: #fff;
}

.loading-track {
  position: relative;
  width: 100%;
  height: 0.3rem;
  display: block;
  overflow: hidden;
  background: #555;
}

.loading-track i {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 35%;
  display: block;
  background: var(--gold);
  animation: loading-slide 1.1s ease-in-out infinite;
}

@keyframes loading-slide {
  50% {
    transform: translateX(186%);
  }
}

.browser-loading b {
  font-weight: 500;
}

.is-opening {
  background: var(--light-hover) !important;
}

.file-icon {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}

.file-icon img {
  display: block;
  width: 100%;
  height: 100%;
}

.file-icon.folder {
  background: transparent;
}

.file-icon.file {
  --file-color: #595959;
  background: transparent;
  color: var(--file-color);
}

.file-icon.file svg {
  display: block;
  width: 100%;
  height: 100%;
}

.file-page {
  fill: #fff;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.file-fold {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.file-badge {
  fill: currentColor;
}

.file-badge-text {
  fill: #fff;
  font-family: "Helvetica Now Display", Arial, sans-serif;
  font-size: 5.2px;
  font-weight: 700;
  letter-spacing: 0.12px;
  text-align: center;
  text-anchor: middle;
}

.file-icon.kind-pdf { --file-color: #b94a42; }
.file-icon.kind-image { --file-color: #755b83; }
.file-icon.kind-sheet { --file-color: #47765a; }
.file-icon.kind-document { --file-color: #536f91; }
.file-icon.kind-presentation { --file-color: #9a633d; }
.file-icon.kind-archive { --file-color: #806f3d; }
.file-icon.kind-video { --file-color: #72576f; }
.file-icon.kind-audio { --file-color: #536781; }
.file-icon.kind-code { --file-color: #476f70; }
.file-icon.kind-design { --file-color: #765875; }

.file-icon.kind-generic {
  --file-color: var(--dim);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
  overflow: auto;
  align-content: start;
}

.card {
  min-height: 9.5rem;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: background-color 0.4s var(--ease);
}

.card:hover {
  background: #eeeeea;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: auto;
}

.card .file-name {
  margin-top: 1.25rem;
  word-break: break-word;
}

.card input[type="checkbox"] {
  cursor: pointer;
}

.card small {
  display: block;
  margin-top: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.55rem;
  background: var(--dark);
  color: #fff;
  font-size: 0.75rem;
}

.badge.off {
  background: var(--bg-alt);
  color: var(--dim);
}

.empty {
  padding: 4rem 1.5rem;
  color: var(--dim);
  text-align: center;
}

.empty h2 {
  color: var(--ink);
}

.pagination {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.25rem;
  background: var(--bg);
  color: var(--dim);
  font-size: 0.875rem;
}

.pagination span {
  padding-inline: 1rem;
}

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(28rem, 38rem);
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--dark);
}

.auth-intro,
.auth-box {
  min-height: calc(100dvh - 0.5rem);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 5rem);
  background: var(--dark);
  color: #fff;
}

.auth-intro h2 {
  max-width: 48rem;
  margin: 1rem 0 1.5rem;
  color: #fff;
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.12rem;
}

.auth-eyebrow {
  margin-bottom: 0;
  color: var(--dim);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-intro .auth-eyebrow,
.auth-intro .auth-foot {
  color: #898989;
}

.auth-copy {
  max-width: 34rem;
  margin: 0;
  color: #dfdfdf;
  font-size: 1.125rem;
}

.auth-foot {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.auth-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem);
  background: #fff;
}

.auth-box h1 {
  margin-top: 1rem;
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.login-subtitle {
  max-width: 28rem;
  margin: 1.25rem 0 0;
  color: var(--dim);
}

.auth-box form {
  display: grid;
  gap: 1.5rem;
  margin-top: 3rem;
}

.auth-box form .primary {
  margin-top: 0.5rem;
}

dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0.25rem;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.24);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
}

#modal-form,
.confirm-form {
  max-height: calc(100dvh - 2.5rem);
  display: flex;
  flex-direction: column;
}

.confirm-dialog {
  width: min(30rem, calc(100% - 2rem));
}

.modal-head,
.modal-body,
.modal-foot {
  background: #fff;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.modal-head [data-close] {
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
}

.modal-body {
  display: grid;
  gap: 1.125rem;
  padding: 1.5rem;
  overflow: auto;
}

.modal-body > button {
  justify-self: start;
  border: 1px solid var(--line-strong);
  background: var(--bg);
}

.modal-body > button:not(.danger):not(:disabled):hover {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.25rem;
  padding: 1rem 1.5rem;
}

.modal-foot > button:not(.primary):not(.danger) {
  border: 1px solid var(--line-strong);
  background: var(--bg);
}

.modal-foot > button:not(.primary):not(.danger):not(:disabled):hover {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

.error {
  padding: 1rem;
  border-left: 3px solid #a52f2f;
  background: #fff3f2;
  color: #8a2929;
  font-size: 0.875rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.folder-guide {
  margin-bottom: 0;
  color: var(--dim);
  font-size: 0.8125rem;
}

.field-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.field-heading > div,
.permission-option > span,
.folder-choice > span,
.folder-name > span {
  display: grid;
  gap: 0.2rem;
}

.field-heading b,
.permission-option b,
.folder-choice b,
.folder-name b {
  font-weight: 500;
}

.field-heading small,
.permission-option small,
.folder-choice small,
.folder-name small {
  color: var(--dim);
  font-weight: 400;
}

#member-access {
  display: grid;
  gap: 1rem;
}

#member-access[hidden],
.admin-access[hidden] {
  display: none;
}

.admin-access {
  margin: 0;
  padding: 1rem;
  border-left: 3px solid var(--gold);
  background: var(--bg);
  color: var(--dim);
}

.access-mode {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  border: 0;
}

.access-mode legend {
  grid-column: 1 / -1;
  margin-bottom: 0.6rem;
  color: var(--dim);
  font-size: 0.875rem;
  font-weight: 500;
}

.access-choice {
  position: relative;
  min-width: 0;
  color: var(--ink);
  cursor: pointer;
}

.access-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.access-choice > span {
  min-height: 5.75rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 0.2rem 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.access-choice > span .button-icon {
  grid-row: 1 / 3;
}

.access-choice b {
  font-weight: 500;
}

.access-choice small {
  color: var(--dim);
  font-weight: 400;
  line-height: 1.3;
}

.access-choice:hover > span,
.access-choice input:checked + span {
  background: var(--dark);
  color: #fff;
}

.access-choice:hover small,
.access-choice input:checked + span small {
  color: #d9d9d9;
}

.access-choice input:checked + span {
  border-color: var(--gold);
  box-shadow: inset 0 -3px var(--gold);
}

.access-choice:has(input:disabled) {
  cursor: not-allowed;
}

.access-choice:has(input:disabled) > span,
.access-choice:has(input:disabled):hover > span {
  border-color: var(--line);
  background: var(--bg);
  color: var(--dim);
}

.access-choice:has(input:disabled) small,
.access-choice:has(input:disabled):hover small {
  color: var(--dim);
}

.legal-page {
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.legal-header,
.legal-footer {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem clamp(1.25rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.legal-header .brand {
  color: inherit;
  text-decoration: none;
}

.legal-content {
  width: min(46rem, calc(100% - 2.5rem));
  margin: clamp(3rem, 8vw, 6rem) auto;
}

.legal-content .eyebrow {
  margin: 0 0 0.75rem;
  color: var(--dim);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-content h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 0.95;
}

.legal-content h2 {
  margin: 2.25rem 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 500;
}

.legal-content p {
  margin: 0 0 1rem;
  color: var(--dim);
  line-height: 1.65;
}

.legal-content a,
.legal-footer a {
  color: var(--ink);
  text-decoration-color: var(--gold);
  text-underline-offset: 0.2em;
}

.legal-content .legal-updated {
  margin: 1rem 0 2.5rem;
  font-size: 0.875rem;
}

.legal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--dim);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

@media (max-width: 560px) {
  .legal-header,
  .legal-footer {
    padding-inline: 1.25rem;
  }

  .legal-content {
    margin-block: 2.75rem 4rem;
  }
}

.recipient-editor,
.recipient-editor label {
  display: grid;
  gap: 0.6rem;
}

.recipient-input {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.recipient-input:focus-within {
  border-color: var(--dark);
}

.recipient-input input {
  width: 10rem;
  min-width: 8rem;
  flex: 1 1 10rem;
  border: 0;
  padding: 0.35rem 0.45rem;
}

.recipient-chips {
  display: contents;
}

.recipient-chip {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding-left: 0.55rem;
  background: var(--light-hover);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
}

.recipient-chip button {
  width: 1.85rem;
  min-height: 1.85rem;
  padding: 0;
  background: transparent;
}

.recipient-chip button .button-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.recipient-error {
  color: #8a2929;
  font-size: 0.8125rem;
}

.access-summary {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  background: var(--bg);
}

.access-summary > span {
  padding: 0.35rem 0.55rem;
  background: var(--dark);
  color: #fff;
  font-size: 0.75rem;
}

.permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

.permission-option {
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.permission-option:hover {
  background: var(--light-hover);
}

.permission-option input,
.folder-choice input {
  margin-top: 0.15rem;
}

.folder-picker-crumbs {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--bg);
}

.folder-picker {
  min-height: 12rem;
  max-height: 22rem;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.folder-choice {
  min-height: 3.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.folder-choice.current {
  background: var(--light-hover);
}

.folder-choice:last-child {
  border-bottom: 0;
}

.folder-name {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  text-align: left;
}

.folder-name:not(:disabled):hover {
  background: var(--dark);
  color: #fff;
}

.folder-name:not(:disabled):hover small {
  color: #d9d9d9;
}

.empty.compact {
  min-height: 7rem;
  padding: 1.5rem;
}

.modal-intro {
  margin-bottom: 0;
  color: var(--dim);
}

.modal-intro strong {
  color: var(--ink);
  font-weight: 500;
}

.upload-picker {
  position: relative;
  min-height: 8rem;
  display: grid;
  place-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px dashed var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.upload-picker:hover,
.upload-picker.is-dragging {
  background: var(--dark);
  color: #fff;
}

.upload-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-picker span {
  display: grid;
  gap: 0.25rem;
  text-align: center;
}

.upload-picker b,
.upload-item b {
  font-weight: 500;
}

.upload-picker small {
  color: inherit;
}

.upload-picker-actions {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
}

.upload-picker-actions button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.upload-picker-actions button:not(:disabled):hover {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--dark);
}

.upload-list {
  max-height: 15rem;
  display: grid;
  gap: 0.25rem;
  overflow: auto;
}

.operation-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: var(--dark);
  color: #fff;
}

.operation-progress[hidden] {
  display: none;
}

.operation-progress > div {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.operation-progress b,
.operation-progress small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-progress b {
  font-weight: 500;
}

.operation-progress small {
  color: #d9d9d9;
}

.operation-progress progress,
.transfer-item progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 0.35rem;
  border: 0;
  background: #4a4a4a;
  accent-color: var(--gold);
}

.operation-progress progress::-webkit-progress-bar,
.transfer-item progress::-webkit-progress-bar {
  background: #4a4a4a;
}

.operation-progress progress::-webkit-progress-value,
.transfer-item progress::-webkit-progress-value {
  background: var(--gold);
}

.operation-progress progress::-moz-progress-bar,
.transfer-item progress::-moz-progress-bar {
  background: var(--gold);
}

.transfer-item progress:not([value]) {
  background: linear-gradient(
    90deg,
    #4a4a4a 0 28%,
    var(--gold) 42% 58%,
    #4a4a4a 72% 100%
  );
  background-size: 220% 100%;
  animation: transfer-wait 1.1s linear infinite;
}

@keyframes transfer-wait {
  to {
    background-position: -220% 0;
  }
}

.transfer-item.is-error progress,
.transfer-item.is-error progress::-webkit-progress-value,
.transfer-item.is-error progress::-moz-progress-bar {
  background: #b9473f;
}

.transfer-panel {
  position: fixed;
  z-index: 1000;
  right: 1rem;
  bottom: 1rem;
  width: min(25rem, calc(100% - 2rem));
  border: 1px solid #3a3a3a;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.28);
}

.transfer-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.transfer-panel > header b,
.transfer-item b {
  font-weight: 500;
}

.transfer-panel > header span,
.transfer-item small {
  color: #c9c9c9;
  font-size: 0.75rem;
}

.transfer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.transfer-item:last-child {
  border-bottom: 0;
}

.transfer-item > div {
  min-width: 0;
  display: grid;
}

.transfer-item > div > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-item button {
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  background: transparent;
  color: #fff;
}

.transfer-item button:not(:disabled):hover {
  background: var(--gold);
  color: var(--dark);
}

.upload-list > p {
  margin: 0;
  color: var(--dim);
  font-size: 0.875rem;
}

.upload-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 7rem;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}

.upload-item > span:not(.file-icon) {
  min-width: 0;
  display: grid;
}

.upload-item b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item progress {
  width: 100%;
  height: 0.3rem;
  border: 0;
  background: var(--line);
  accent-color: var(--gold);
}

.upload-item progress::-webkit-progress-bar {
  background: var(--line);
}

.upload-item progress::-webkit-progress-value {
  background: var(--gold);
}

.upload-item.is-complete progress,
.upload-item.is-complete progress::-webkit-progress-value {
  accent-color: var(--dark);
  background: var(--dark);
}

.share-page {
  width: calc(100% - 0.5rem);
  max-width: 120rem;
  height: calc(100dvh - 0.5rem);
  min-height: 0;
  margin: 0.25rem auto;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 2vw, 2rem) var(--gutter) 1.5rem;
  background: var(--bg);
  overflow: hidden;
}

.share-page .brand {
  margin-bottom: clamp(1.5rem, 2vw, 2rem);
}

.share-page h1 {
  max-width: 55rem;
}

.share-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.share-heading .muted {
  margin: 1rem 0 0;
}

.viewer-identity {
  margin: 0.45rem 0 0;
  color: var(--dim);
  font-size: 0.8125rem;
}

.viewer-identity b {
  color: var(--ink);
  font-weight: 500;
}

.viewer-identity button {
  min-height: auto;
  padding: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  font-size: inherit;
}

.viewer-identity button:not(:disabled):hover {
  border-color: var(--gold);
  background: transparent;
  color: var(--ink);
}

.share-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.share-page .table-wrap {
  margin-top: 1rem;
  min-height: 0;
  flex: 1 1 auto;
}

.share-page table th:last-child,
.share-page table td:last-child {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.public-folder-row {
  cursor: pointer;
}

.public-folder-row:hover,
.public-folder-row:focus-visible {
  background: var(--light-hover);
}

.row-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.row-action .button-icon {
  width: 1rem;
  height: 1rem;
}

.download {
  display: inline-block;
  padding: 0.75rem 1rem;
  background: var(--dark);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.4s var(--ease);
}

.download.has-icon {
  display: inline-flex;
}

.download:hover {
  background: var(--gold);
  color: var(--dark);
}

.download-all {
  flex: 0 0 auto;
  padding: 0.7rem 1rem;
}

.loading {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  margin: 0;
  background: var(--bg);
  color: var(--dim);
}

.viewer-gate-page {
  overflow: auto;
}

.viewer-gate-page .brand {
  flex: 0 0 auto;
}

.viewer-gate {
  width: min(29rem, 100%);
  margin: clamp(3rem, 10vh, 6rem) auto auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-top: 3px solid var(--gold);
  background: #fff;
}

.viewer-gate .eyebrow {
  margin: 0 0 0.75rem;
  color: var(--dim);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.viewer-gate h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.5rem);
}

.viewer-gate > p:not(.eyebrow) {
  margin: 1rem 0 0;
  color: var(--dim);
  line-height: 1.5;
}

.provider-actions {
  display: grid;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.provider-button {
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line-strong);
  background: var(--dark);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.provider-button:hover {
  background: var(--gold);
  color: var(--dark);
}

.access-denied {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid #a52f2f;
  background: #fff3f2;
}

.access-denied b {
  font-weight: 500;
}

.access-denied span {
  overflow-wrap: anywhere;
}

.access-denied small,
.provider-unavailable {
  color: var(--dim);
}

.viewer-email-fallback {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.viewer-email-fallback > button {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.viewer-email-fallback > button:not(:disabled):hover {
  background: var(--light-hover);
  color: var(--ink);
}

#email-code-form {
  display: grid;
  gap: 0.75rem;
}

#email-code-form .primary {
  width: 100%;
}

.email-code-sent,
.email-code-status {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.email-code-sent b {
  overflow-wrap: anywhere;
  font-weight: 500;
}

.email-code-status {
  color: #8a2929;
}

.resend-code {
  justify-self: center;
  background: transparent;
  font-size: 0.8125rem;
}

.resend-code:not(:disabled):hover {
  background: var(--light-hover);
  color: var(--ink);
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    height: auto;
    min-height: auto;
    display: grid;
    grid-template-columns: auto repeat(3, minmax(3.5rem, auto));
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .sidebar .brand {
    margin: 0 auto 0 0;
    padding-inline: 0.75rem;
  }

  .nav,
  .nav:last-of-type {
    display: flex;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.625rem;
    border: 0;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

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

  .auth-intro {
    min-height: 42dvh;
  }

  .auth-intro h2 {
    font-size: clamp(2.75rem, 10vw, 5rem);
  }

  .auth-box {
    min-height: 58dvh;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 1rem;
  }

  .sidebar {
    grid-template-columns: auto repeat(3, 3.25rem);
  }

  .sidebar .brand-product,
  .nav-label {
    display: none;
  }

  .nav {
    font-size: 0.75rem;
  }

  .topbar {
    min-height: 4rem;
    gap: 0.75rem;
  }

  .account-name {
    display: none;
  }

  .avatar {
    display: none;
  }

  .account .ghost {
    min-height: 2.5rem;
    padding-inline: 0.75rem;
  }

  .content {
    padding: 1rem 1rem 1.5rem;
  }

  .heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 1.5rem;
  }

  .share-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 2rem;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1 1 calc(50% - 0.25rem);
  }

  h1 {
    font-size: 2.5rem;
  }

  .optional {
    display: none;
  }

  th,
  td {
    padding: 0.65rem 0.75rem;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

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

  .access-mode {
    grid-template-columns: 1fr;
  }

  .field-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .operation-progress {
    grid-template-columns: 1fr;
  }

  .transfer-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .transfer-item progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .upload-item progress {
    grid-column: 1 / -1;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding: 1.25rem;
  }

  .modal-foot {
    flex-wrap: wrap;
  }

  .auth-intro,
  .auth-box {
    padding: 2rem 1.5rem;
  }

  .auth-intro .brand {
    margin-bottom: 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
