:root {
  font-feature-settings: "cv11", "ss01";
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--tone-9760ce);
  outline-offset: 3px;
}
a {
  color: var(--accent);
}
button {
  border: 1px solid var(--tone-dcd4e5);
  background: var(--surface);
  color: var(--purple);
  padding: 10px 15px;
  border-radius: 7px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
button:hover {
  background: var(--tone-f4eff9);
}
button.primary,
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover {
  background: var(--tone-5d318f);
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  padding: 10px 15px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--tone-dcd4e5);
  background: white;
}
.small-button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 14px;
}
input,
select {
  width: 100%;
  display: block;
  padding: 11px 13px;
  border-radius: 7px;
  border: 1px solid var(--tone-cfc5d9);
  background: white;
  color: var(--tone-28212f);
  min-height: 46px;
  margin-top: 7px;
}
input:focus,
select:focus {
  outline: 2px solid var(--tone-9660c7);
  outline-offset: 2px;
}
label {
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin: 16px 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.035em;
  margin: 0;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 18px;
}
p {
  color: var(--muted);
}
.icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
}
.loading h1,
.loading p {
  margin: 0;
}
.login-page {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 20% 0, var(--tone-75528080), transparent 55%),
    var(--purple);
  display: grid;
  place-items: center;
  padding: 36px 20px;
}
.login-card {
  max-width: 430px;
  width: 100%;
  background: var(--surface);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 28px 75px var(--tone-0b041740);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
}
.login-brand img {
  width: 52px;
  height: 52px;
}
.login-brand strong {
  font-size: 23px;
  font-weight: 650;
  display: block;
  letter-spacing: -0.035em;
}
.login-brand span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2em;
}
.login-card h1 {
  font-size: 26px;
  margin-bottom: 10px;
}
.login-card p {
  font-size: 15px;
}
.login-card .primary {
  width: 100%;
  margin-top: 10px;
}
.login-foot {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}
.login-foot .icon {
  height: 17px;
  width: 17px;
}
.topbar {
  height: 76px;
  background: var(--purple);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}
.brand img {
  width: 40px;
  height: 40px;
}
.brand strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}
.brand small {
  display: block;
  font-size: 11px;
  color: var(--tone-ded1e8);
  letter-spacing: 0.17em;
}
.topbar .search {
  width: min(450px, 38vw);
  position: relative;
}
.search input {
  background: var(--tone-ffffff14);
  border-color: var(--tone-ffffff2a);
  color: white;
  margin: 0;
  padding-left: 42px;
}
.search input::placeholder {
  color: var(--tone-d1c4de);
}
.search > .icon {
  position: absolute;
  left: 12px;
  top: 12px;
  color: var(--tone-d5c4e6);
}
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.profile > span {
  font-size: 14px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile button {
  background: var(--tone-ffffff0a);
  color: var(--white);
  border-color: var(--tone-ffffff30);
  padding: 8px 12px;
}
.avatar {
  width: 35px;
  height: 35px;
  background: var(--gold);
  color: var(--tone-352341);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100dvh - 76px);
}
.sidebar {
  background: var(--tone-f1eef5);
  border-right: 1px solid var(--line);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.sidebar button {
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  color: var(--tone-665772);
  font-weight: 500;
  font-size: 15px;
  padding: 11px 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.sidebar button.selected {
  background: var(--tone-e1d5ee);
  color: var(--tone-4c2775);
  font-weight: 650;
}
.sidebar .caption {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--tone-83758e);
  padding: 0 14px;
  margin: 0 0 9px;
  font-weight: 600;
}
.sidefoot {
  margin-top: auto;
  padding: 20px 12px 0;
  border-top: 1px solid var(--tone-dfd7e8);
}
.sidefoot p {
  font-size: 13px;
  margin: 7px 0;
}
.sidefoot strong {
  font-size: 14px;
  font-weight: 600;
}
.sidefoot .icon {
  width: 17px;
  height: 17px;
}
.content {
  padding: 34px 38px 70px;
  min-width: 0;
  max-width: 1650px;
  width: 100%;
  margin: 0 auto;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.pagehead p {
  font-size: 15px;
  margin: 8px 0 0;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.syncbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--tone-e2dce9);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--tone-706479);
}
.syncbar .icon {
  color: var(--tone-866598);
}
.syncbar strong {
  color: var(--tone-463651);
  font-weight: 600;
}
.syncbar .right {
  margin-left: auto;
  white-space: nowrap;
  font-size: 13px;
}
.dot {
  width: 8px;
  height: 8px;
  background: var(--tone-3e9168);
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
}
.dot.off {
  background: var(--tone-b39971);
}
.filepanel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  min-height: 340px;
}
.filepanel.dragover {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.crumbs {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 17px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.crumbs button {
  font-size: 14px;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
}
.crumbs .icon {
  width: 16px;
  height: 16px;
  color: var(--tone-9e91a9);
}
.filetable {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
}
.filetable th {
  font-size: 13px;
  font-weight: 600;
  color: var(--tone-857b8e);
  background: var(--tone-fbfafc);
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.filetable td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--tone-eeeaf2);
  font-size: 14px;
  color: var(--tone-7b7283);
  vertical-align: middle;
}
.filetable tr:last-child td {
  border-bottom: 0;
}
.filetable th:first-child {
  width: 44%;
}
.filetable th:nth-child(2) {
  width: 25%;
}
.filetable th:nth-child(3) {
  width: 13%;
}
.filetable th:last-child {
  width: 18%;
}
.filetable tbody tr:hover {
  background: var(--tone-fcfaff);
}
.filename {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--tone-3d304b);
  min-width: 0;
}
.filename strong {
  font-size: 15px;
  font-weight: 550;
  overflow-wrap: anywhere;
  display: block;
}
.filename small {
  display: block;
  font-size: 13px;
  color: var(--tone-92869c);
  margin-top: 3px;
}
.file-icon {
  background: var(--tone-f1eafa);
  color: var(--tone-8b59bd);
  display: grid;
  place-items: center;
  width: 40px;
  height: 45px;
  border-radius: 7px;
  flex-shrink: 0;
}
.file-icon.video {
  color: var(--tone-477dba);
  background: var(--tone-eaf2fc);
}
.file-icon.folder {
  background: transparent;
  color: var(--tone-bd984a);
}
.file-icon.folder .icon {
  width: 32px;
  height: 32px;
}
.folder-link {
  border: 0;
  padding: 0;
  min-height: 0;
  background: transparent !important;
  text-align: left;
  font-weight: 550;
  font-size: 15px;
  justify-content: flex-start;
}
.filetable .download {
  border: 0;
  min-height: 34px;
  padding: 5px 8px;
  color: var(--tone-775892);
  font-size: 14px;
  background: transparent;
}
.filetable .download .icon {
  width: 18px;
  height: 18px;
}
.badge {
  font-size: 12px;
  border-radius: 4px;
  padding: 4px 7px;
  background: var(--tone-ecf6ef);
  color: var(--tone-3b7755);
  display: inline-block;
}
.badge.waiting {
  background: var(--tone-fff5e5);
  color: var(--tone-92733c);
}
.badge.incomplete {
  background: var(--tone-f4eef9);
  color: var(--tone-8b60a6);
}
.filetable time {
  font-size: 13px;
}
.empty {
  text-align: center;
  padding: 65px 20px;
}
.empty > .icon {
  width: 46px;
  height: 46px;
  color: var(--tone-bba4d2);
}
.empty h2 {
  font-size: 21px;
  margin: 18px 0 10px;
}
.empty p {
  max-width: 360px;
  margin: 0 auto 23px;
  font-size: 15px;
}
.hint {
  font-size: 13px;
  color: var(--tone-93869f);
  margin: 18px 0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.hint .icon {
  width: 16px;
  height: 16px;
}
.message {
  padding: 13px 16px;
  border-radius: 8px;
  margin: 0 0 20px;
  font-size: 15px;
  overflow-wrap: anywhere;
  background: var(--tone-edf5ee);
  color: var(--tone-376246);
  border: 1px solid var(--tone-d0e6d4);
}
.message.error {
  background: var(--tone-fff0f1);
  color: var(--tone-993d4f);
  border-color: var(--tone-efc9d0);
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 25px;
}
.card h2 {
  margin: 0 0 12px;
}
.card p {
  font-size: 15px;
}
.card form {
  max-width: 550px;
}
.card .small {
  font-size: 13px;
}
.card + .card {
  margin-top: 0;
}
.full {
  grid-column: 1/-1;
}
.account {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.account:last-child {
  border-bottom: 0;
}
.account > div:first-child {
  flex: 1;
  min-width: 150px;
}
.account p {
  margin: 3px 0;
  font-size: 14px;
}
.account strong {
  font-size: 16px;
}
.code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--tone-f6f2fa);
  border: 1px solid var(--tone-e0d4ed);
  padding: 14px;
  border-radius: 7px;
  color: var(--tone-5f3f7b);
  font:
    14px/1.6 ui-monospace,
    monospace;
}
.steps {
  padding-left: 23px;
  color: var(--tone-756981);
  font-size: 15px;
}
.steps li {
  margin: 11px 0;
}
.uploadtray {
  position: fixed;
  right: 26px;
  bottom: 22px;
  width: min(440px, calc(100vw - 36px));
  background: var(--surface);
  border: 1px solid var(--tone-d2c0e1);
  box-shadow: 0 12px 45px var(--tone-30204030);
  border-radius: 12px;
  z-index: 20;
  padding: 20px;
  max-height: 55vh;
  overflow: auto;
}
.uploadtray h3 {
  margin: 0 0 12px;
}
.upload-item {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.upload-item strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.upload-item p {
  font-size: 13px;
  margin: 5px 0;
}
.upload-item progress {
  width: 100%;
  height: 7px;
  accent-color: var(--accent);
}
.upload-item button {
  font-size: 13px;
  min-height: 31px;
  padding: 4px 10px;
}
.dialog {
  border: 1px solid var(--tone-d5c7e2);
  border-radius: 12px;
  padding: 28px;
  width: min(460px, calc(100vw - 32px));
  box-shadow: 0 20px 70px var(--tone-27143633);
}
.dialog::backdrop {
  background: var(--tone-241a3866);
}
.dialog h2 {
  margin: 0 0 15px;
}
.dialog .actions {
  justify-content: flex-end;
  margin-top: 22px;
}
.dialog p {
  font-size: 15px;
}
.dialog .message {
  margin-top: 15px;
}
.mobile-search {
  display: none;
}
.muted {
  color: var(--tone-8c8194);
  font-size: 14px;
}
details {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
summary {
  cursor: pointer;
  color: var(--tone-61437d);
  font-size: 15px;
  font-weight: 600;
}
.danger {
  color: var(--tone-a14455);
}
.upload-pick {
  display: none;
}
@media (min-width: 1500px) {
  .filetable th:first-child {
    width: 49%;
  }
  .filetable th:nth-child(2) {
    width: 23%;
  }
  .filetable th:nth-child(3) {
    width: 12%;
  }
  .filetable th:last-child {
    width: 16%;
  }
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 200px 1fr;
  }
  .sidebar {
    padding: 22px 10px;
  }
  .content {
    padding: 28px 22px 60px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .filetable td,
  .filetable th {
    padding-left: 13px;
    padding-right: 13px;
  }
  .filetable th:first-child {
    width: 52%;
  }
  .filetable th:nth-child(2) {
    width: 28%;
  }
  .filetable th:nth-child(3) {
    display: none;
  }
  .filetable td:nth-child(3) {
    display: none;
  }
  .filetable th:last-child {
    width: 20%;
  }
  .filename {
    gap: 10px;
  }
  .profile > span {
    display: none;
  }
  .brand {
    min-width: 190px;
  }
  .topbar {
    padding: 0 20px;
  }
  .brand strong {
    font-size: 20px;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: 68px;
    padding: 0 16px;
  }
  .brand {
    min-width: 0;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .brand strong {
    font-size: 19px;
  }
  .brand small {
    font-size: 10px;
  }
  .topbar .search {
    display: none;
  }
  .profile {
    gap: 8px;
  }
  .profile .avatar {
    display: none;
  }
  .profile button {
    font-size: 13px;
    min-height: 38px;
    padding: 7px 10px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    display: block;
  }
  .sidebar nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
  }
  .sidebar nav button {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 40px;
    font-size: 14px;
    padding: 8px 12px;
  }
  .sidebar .caption,
  .sidefoot {
    display: none;
  }
  .sidebar #queens-nav {
    margin-top: 8px;
  }
  .content {
    padding: 24px 16px 60px;
  }
  .pagehead {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
  }
  h1 {
    font-size: 27px;
  }
  .pagehead p {
    font-size: 14px;
  }
  .pagehead .actions {
    width: 100%;
    gap: 8px;
  }
  .pagehead .actions button {
    flex: 1;
    font-size: 14px;
    padding: 9px 12px;
  }
  .syncbar {
    align-items: flex-start;
    font-size: 13px;
    padding: 12px;
  }
  .syncbar .right {
    display: none;
  }
  .filetable th:nth-child(2) {
    width: 30%;
  }
  .filetable th:first-child {
    width: 70%;
  }
  .filetable th:last-child {
    display: none;
  }
  .filetable td:last-child {
    display: none;
  }
  .filetable td,
  .filetable th {
    padding: 14px 11px;
  }
  .filename {
    gap: 9px;
  }
  .filename strong {
    font-size: 14px;
  }
  .file-icon {
    width: 30px;
    height: 36px;
  }
  .file-icon .icon {
    width: 19px;
    height: 19px;
  }
  .filename small {
    font-size: 12px;
  }
  .badge {
    font-size: 11px;
    padding: 4px 5px;
  }
  .filetable .mobile-download {
    display: inline-flex;
    font-size: 12px;
    min-height: 28px;
    padding: 3px 0;
  }
  .mobile-search {
    display: block;
    margin-bottom: 18px;
  }
  .mobile-search input {
    margin: 0;
    background: var(--surface);
  }
  .empty {
    padding: 46px 15px;
  }
  .empty h2 {
    font-size: 20px;
  }
  .empty p {
    font-size: 14px;
  }
  .login-card {
    padding: 29px 25px;
  }
  .login-card h1 {
    font-size: 24px;
  }
  .cards {
    gap: 18px;
  }
  .card {
    padding: 21px;
  }
  .uploadtray {
    right: 18px;
    bottom: 16px;
  }
  .account .actions {
    width: 100%;
  }
  .hint {
    align-items: flex-start;
  }
  .hint .icon {
    flex-shrink: 0;
    margin-top: 2px;
  }
}
@media (min-width: 701px) {
  .filetable .mobile-download {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.privacy-footer {
  text-align: center;
  padding: 12px;
  font-size: 12px;
}
.privacy-footer a {
  color: var(--tone-635273);
}
.privacy-page {
  max-width: 800px;
  margin: 32px auto;
  padding: 24px;
  line-height: 1.6;
  background: white;
}
.privacy-page h2 {
  margin-top: 28px;
}
/* Folder browser: the same controls work with mouse, keyboard and touch. */
.browser-tools,
.browser-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0;
}
.browser-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 640px;
}
.browser-search input {
  margin: 0;
  min-width: 0;
}
.browser-search .icon {
  flex-shrink: 0;
}
.browser-footer {
  color: var(--muted);
  font-size: 14px;
}
.browser-table td:last-child {
  position: relative;
}
.file-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.folder-menu-button {
  font-size: 25px;
  min-width: 44px;
  padding: 0 10px;
}
.folder-context {
  position: absolute;
  right: 12px;
  top: 46px;
  z-index: 10;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px var(--tone-21152b25);
  border-radius: 10px;
  padding: 6px;
  min-width: 190px;
}
.folder-context button {
  display: block;
  border: 0;
  width: 100%;
  text-align: left;
}
.folder-context button:hover {
  background: var(--tone-f2edf7);
}
.search-summary {
  padding: 14px 20px;
  background: var(--tone-f8f5fb);
}
.permissions-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: 90vh;
  overflow: auto;
}
.permission-path {
  overflow-wrap: anywhere;
  font-weight: 600;
  color: var(--accent);
}
.fixed-access {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--tone-f5f1f8);
  border-radius: 8px;
  padding: 12px;
}
.fixed-access span {
  font-size: 13px;
}
.inherit-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 4px;
}
.inherit-control input {
  width: 20px;
  height: 20px;
  margin: 0;
}
.permission-users {
  max-height: 300px;
  overflow: auto;
  margin-top: 14px;
  border-block: 1px solid var(--line);
}
.permission-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.permission-user[hidden] {
  display: none;
}
.permission-user select {
  width: 180px;
  margin: 0;
}
.permission-user span {
  overflow-wrap: anywhere;
}
.access-summary {
  color: var(--muted);
  font-size: 13px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--tone-a06ac6);
  outline-offset: 3px;
}
.crumbs {
  flex-wrap: wrap;
}
.crumbs [aria-current] {
  font-weight: 700;
  color: var(--tone-352044);
}
@media (max-width: 700px) {
  .browser-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .browser-tools > .small {
    display: none;
  }
  .browser-search {
    gap: 6px;
  }
  .browser-search > .icon {
    display: none;
  }
  .browser-search button {
    padding: 8px;
  }
  .browser-table th:nth-child(2),
  .browser-table td:nth-child(2) {
    display: none;
  }
  .browser-table th:last-child,
  .browser-table td:last-child {
    display: table-cell;
    width: 70px;
  }
  .browser-table td:first-child {
    width: auto;
    max-width: 0;
  }
  .browser-table .filename {
    overflow-wrap: anywhere;
  }
  .file-actions .download span {
    display: none;
  }
  .file-actions button {
    font-size: 12px;
  }
  .permissions-dialog {
    padding: 18px;
  }
  .permission-user {
    gap: 8px;
    font-size: 14px;
  }
  .permission-user select {
    width: 145px;
    flex-shrink: 0;
  }
  .browser-footer {
    flex-wrap: wrap;
  }
}
.explorer-tree {
  margin-top: 22px;
  overflow: auto;
  max-height: 65vh;
  padding-bottom: 12px;
}
.tree-children {
  padding-left: 16px;
}
.tree-line {
  display: flex;
  align-items: center;
  border-radius: 7px;
  position: relative;
}
.tree-line.selected {
  background: var(--tone-eee5f6);
}
.tree-line button {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 34px;
  border-radius: 5px;
  padding: 5px 3px;
}
.tree-toggle,
.tree-spacer {
  width: 20px;
  flex: 0 0 20px;
}
.tree-folder {
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  font-size: 13px;
  min-width: 140px;
}
.tree-folder .icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--tone-9562b5);
}
.tree-folder span {
  white-space: nowrap;
}
.tree-toggle:hover,
.tree-folder:hover {
  background: var(--tone-eee5f6);
}
.shell {
  grid-template-columns: 270px minmax(0, 1fr);
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .explorer-tree {
    display: none;
  }
  .shell {
    display: block;
  }
  .sidebar nav {
    display: flex;
  }
  .browser-table .filename strong {
    word-break: break-word;
  }
}
.permissions-dialog[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
.permissions-dialog > p {
  margin: 5px 0 12px;
}
.permissions-dialog form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.permissions-dialog .permission-users {
  min-height: 70px;
  max-height: 27vh;
  overflow: auto;
  flex: 1;
}
.permissions-dialog .actions {
  flex-shrink: 0;
  margin-top: 8px;
}
.permissions-dialog .inherit-control {
  margin-top: 14px;
}
.permissions-dialog .small {
  margin: 7px 0;
}
.permissions-dialog .access-summary {
  margin: 10px 0 0;
}
@media (min-width: 701px) {
  .sidebar {
    position: sticky;
    top: 76px;
    height: calc(100dvh - 76px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar > nav {
    flex-shrink: 0;
  }
  .explorer-tree {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
  .sidebar .sidefoot {
    margin-top: 12px;
    flex-shrink: 0;
  }
}
.preview-dialog[open] {
  display: flex;
  flex-direction: column;
  width: min(1000px, calc(100vw - 24px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}
.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.preview-heading h2 {
  overflow-wrap: anywhere;
  font-size: 20px;
}
.preview-heading button {
  flex-shrink: 0;
}
.preview-content {
  overflow: auto;
  min-height: 80px;
  flex: 1;
  padding: 14px 0;
}
.preview-content video {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  margin: auto;
  background: var(--tone-140f21);
}
.preview-content audio {
  width: 100%;
  margin: 25px 0;
}
.preview-content iframe {
  width: 100%;
  height: 65vh;
  border: 0;
}
.preview-content img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  margin: auto;
}
.preview-content pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 15px/1.7 system-ui;
}
.preview-content section {
  border-bottom: 1px solid var(--line);
  padding: 12px 6px;
}
.preview-footer {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.preview-footer a {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .preview-dialog {
    padding: 16px;
  }
  .preview-footer {
    flex-wrap: wrap;
  }
  .file-actions {
    flex-direction: column;
  }
  .file-actions button {
    min-height: 32px;
  }
}

/* Live DJ sync */
#sync-live {
  margin-bottom: 24px;
}
.sync-device + .sync-device {
  border-top: 1px solid var(--border, var(--tone-ddd));
  margin-top: 24px;
  padding-top: 20px;
}
.sync-state {
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-block;
  margin-left: 12px;
}
.sync-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0;
}
.sync-metrics strong {
  display: block;
  font-size: 1.35rem;
}
.sync-metrics span {
  display: block;
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 5px;
}
#sync-live progress {
  display: block;
  width: 100%;
  height: 12px;
  accent-color: var(--tone-cf3f91);
}
.sync-transfer {
  padding: 16px;
  border: 1px solid var(--border, var(--tone-ddd));
  border-radius: 12px;
  margin: 14px 0;
  overflow-wrap: anywhere;
}
.sync-table-wrap {
  overflow-x: auto;
}
.sync-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.sync-table th,
.sync-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border, var(--tone-ddd));
}
#sync-live summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
}
@media (max-width: 650px) {
  .sync-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sync-metrics strong {
    font-size: 1.1rem;
  }
  .sync-state {
    display: block;
    margin: 6px 0;
  }
  .sync-table {
    min-width: 540px;
  }
}

/* Native file pickers retain their unfiltered selection; labels open the existing input. */
.upload-drop .icon {
  width: 24px;
  height: 24px;
}
.empty label.button {
  cursor: pointer;
  display: inline-flex;
  width: auto;
}

/* Keep the own-track download action explicit on phones. */
@media (max-width: 700px) {
  .file-actions .download span { display: inline; }
  .browser-table th:last-child, .browser-table td:last-child { width: 108px; }
}
