/* Sparkles desktop workspace: shared spacing, clear hierarchy, compact file rows. */
:root {
  font-feature-settings: "cv11", "ss01";
}
body {
  font-size: 14px;
}
.topbar {
  height: 68px;
  padding: 0 26px;
  background: var(--shell);
  border-bottom: 1px solid var(--tone-ffffff0d);
}
.brand strong {
  font-size: 20px;
  font-weight: 700;
}
.brand small {
  font-size: 9px;
  letter-spacing: 0.22em;
}
.brand img {
  width: 34px;
  height: 34px;
}
.avatar {
  width: 30px;
  height: 30px;
}
.profile button {
  font-size: 12px;
  min-height: 34px;
}
.shell {
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100dvh - 68px);
}
.sidebar {
  background: var(--tone-f5f3f8);
  padding: 20px 12px;
  gap: 18px;
}
.sidebar > nav button {
  font-size: 13px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
}
.sidebar > nav .icon {
  width: 19px;
  height: 19px;
}
.sidebar button.selected {
  background: var(--tone-e8dff1);
  color: var(--tone-54347c);
}
.content {
  padding: 30px 32px 44px;
}
.pagehead {
  margin-bottom: 22px;
}
.pagehead h1 {
  font-size: 27px;
  letter-spacing: -0.045em;
}
.pagehead p {
  font-size: 13px;
  margin-top: 7px;
  line-height: 1.6;
}
.pagehead .actions button {
  font-size: 12px;
  min-height: 37px;
  padding: 8px 12px;
}
.pagehead .actions .icon {
  width: 17px;
  height: 17px;
}
.browser-tools {
  gap: 12px;
  margin: 0 0 18px;
}
.browser-search {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px 0 12px;
  max-width: none;
  gap: 7px;
  height: 40px;
}
.browser-search input {
  border: 0;
  min-height: 36px;
  padding: 8px 4px;
  font-size: 13px;
  outline-offset: 0;
  background: transparent;
}
.browser-search .icon {
  width: 17px;
  height: 17px;
  color: var(--tone-91869b);
}
.browser-search button {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 11px;
  border: 0;
  background: var(--tone-f4f0f8);
  color: var(--tone-795993);
}
.sort-control {
  margin: 0;
  flex-shrink: 0;
}
.sort-control select {
  margin: 0;
  height: 40px;
  min-height: 40px;
  padding: 6px 30px 6px 12px;
  font-size: 12px;
  width: 150px;
  border-color: var(--line);
}
.storage-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--tone-7b7286);
}
.storage-status .dot {
  width: 6px;
  height: 6px;
}
.filepanel {
  border-radius: 10px;
  min-height: 320px;
  box-shadow: 0 2px 8px var(--tone-30204003);
  overflow: visible;
}
.crumbs {
  padding: 10px 12px;
  gap: 0;
  background: var(--surface);
  border-radius: 10px 10px 0 0;
}
.crumbs button {
  font-size: 12px;
  color: var(--tone-8a8094);
  min-height: 28px;
}
.crumbs button[aria-current] {
  color: var(--tone-4d365f);
}
.crumbs .icon {
  width: 13px;
  height: 13px;
}
.filetable th {
  padding: 10px 16px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--tone-8c8496);
  font-weight: 600;
  background: var(--tone-faf9fc);
}
.browser-table th:first-child {
  width: 54%;
}
.browser-table th:nth-child(2) {
  width: 18%;
}
.browser-table th:nth-child(3) {
  width: 10%;
}
.browser-table th:last-child {
  width: 18%;
  text-align: right;
}
.browser-table td {
  padding: 10px 16px;
  font-size: 12px;
  border-bottom-color: var(--tone-f0edf4);
  height: 58px;
}
.browser-table tr:last-child td:first-child {
  border-radius: 0 0 0 10px;
}
.browser-table tr:last-child td:last-child {
  border-radius: 0 0 10px 0;
}
.browser-table tbody tr:hover {
  background: var(--tone-f8f5fc);
}
.filename {
  gap: 10px;
}
.file-icon {
  width: 30px;
  height: 34px;
  border-radius: 6px;
  background: var(--tone-f2edf8);
}
.file-icon .icon {
  width: 18px;
  height: 18px;
}
.file-icon.folder .icon {
  width: 26px;
  height: 26px;
  color: var(--tone-b79854);
  fill: var(--tone-f7edc9);
  stroke-width: 1.3;
}
.folder-link,
.file-title {
  font-size: 13px;
  font-weight: 550;
  color: var(--tone-3c314a);
  line-height: 1.5;
}
.file-title {
  display: block;
  padding: 0;
  border: 0;
  min-height: 0;
  background: transparent;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
  font-weight: 550;
}
.filename > div {
  min-width: 0;
}
.filename small {
  font-size: 11px;
  color: var(--tone-9a91a4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.folder-link {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge {
  font-size: 10px;
  letter-spacing: 0;
  padding: 3px 6px;
  border-radius: 5px;
}
.badge.waiting {
  background: var(--tone-f4f1e8);
  color: var(--tone-897445);
}
.browser-table .file-actions {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.preview-action {
  min-height: 30px;
  padding: 4px 9px;
  background: transparent;
  border-color: transparent;
  font-size: 11px;
  color: var(--tone-7b6098);
}
.preview-action:hover {
  background: var(--tone-eee6f7);
}
.folder-menu-button {
  min-width: 30px;
  min-height: 30px;
  font-size: 21px;
  padding: 0 7px;
  border-color: transparent;
  background: transparent;
  line-height: 1;
}
.browser-table td:last-child {
  text-align: right;
}
.folder-menu-button:hover {
  background: var(--tone-eee6f7);
}
.folder-context[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 210px;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--tone-e5deec);
  padding: 5px;
  box-shadow: 0 8px 35px var(--tone-231b3530);
  background: white;
}
.folder-context button {
  font-size: 12px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 5px;
}
.folder-context .danger {
  color: var(--tone-ae4561);
}
.folder-context::backdrop {
  background: transparent;
}
.browser-footer {
  font-size: 11px;
  margin: 14px 2px;
}
.browser-footer button {
  min-height: 30px;
  font-size: 11px;
}
.hint {
  font-size: 11px;
  color: var(--tone-9b91a6);
}
.explorer-tree {
  margin-top: 6px;
}
.tree-line button {
  font-size: 12px;
  min-height: 31px;
}
.tree-folder .icon {
  width: 16px;
  height: 16px;
  fill: var(--tone-eee3f4);
  color: var(--tone-a48ab9);
}
.tree-line.selected {
  background: var(--tone-e9e0f2);
}
.tree-children {
  padding-left: 13px;
  border-left: 1px solid var(--tone-e9e1ef);
  margin-left: 9px;
}
.tree-toggle,
.tree-spacer {
  width: 17px;
  flex-basis: 17px;
}
.sidefoot {
  padding: 15px 8px 0;
}
.sidefoot strong {
  font-size: 12px;
}
.sidefoot p {
  font-size: 11px;
  line-height: 1.7;
}
.dialog {
  border-radius: 15px;
  box-shadow: 0 28px 90px var(--tone-1d102544);
}
.dialog h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
}
.dialog p {
  font-size: 13px;
}
.dialog button,
.dialog select,
.dialog input {
  font-size: 13px;
}
.permissions-dialog {
  padding: 25px;
}
.permission-user {
  font-size: 13px;
  padding: 9px 0;
}
.permission-user select {
  min-height: 36px;
  padding: 6px 10px;
  width: 164px;
}
.permission-filter {
  min-height: 38px;
}
.fixed-access {
  font-size: 12px;
}
.fixed-access span {
  font-size: 11px;
}
.permission-path {
  font-size: 12px !important;
}
.inherit-control {
  font-size: 13px;
}
.permissions-dialog .small {
  font-size: 11px;
}
.permissions-dialog .actions button {
  min-height: 37px;
}
.permission-users {
  border-bottom: 0;
}
.permissions-dialog .access-summary {
  font-size: 11px;
}
.message {
  font-size: 13px;
  padding: 11px 14px;
}
.message .small-button {
  min-height: 28px;
  font-size: 11px;
}
.drop-target {
  outline: 2px solid var(--tone-9561c0);
  outline-offset: -2px;
  background: var(--tone-eee4f8) !important;
}
.cards {
  gap: 20px;
}
.card {
  padding: 23px;
  border-radius: 12px;
}
.card h2 {
  font-size: 18px;
}
.card p,
.steps {
  font-size: 13px;
  line-height: 1.7;
}
.account strong {
  font-size: 14px;
}
.account p {
  font-size: 12px;
}
.account button {
  font-size: 11px;
  min-height: 32px;
}
.card label {
  font-size: 13px;
}
.card input {
  font-size: 13px;
  min-height: 40px;
}
.code {
  font-size: 12px;
}
.privacy-footer {
  font-size: 10px;
}
.mobile-folders,
.folder-overlay {
  display: none;
}
@media (min-width: 701px) {
  .sidebar {
    top: 68px;
    height: calc(100dvh - 68px);
  }
}
@media (max-width: 1100px) {
  .storage-status {
    display: none;
  }
  .content {
    padding: 25px 22px;
  }
  .shell {
    grid-template-columns: 225px minmax(0, 1fr);
  }
  .browser-table th:first-child {
    width: 57%;
  }
  .browser-table th:nth-child(2) {
    width: 21%;
  }
  .browser-table th:last-child {
    width: 22%;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: 62px;
    padding: 0 14px;
    gap: 10px;
  }
  .mobile-folders {
    display: flex;
    min-height: 34px;
    padding: 5px;
    color: var(--tone-eaddf7);
    border: 0;
    background: transparent;
  }
  .brand {
    flex: 1;
    gap: 8px;
  }
  .brand strong {
    font-size: 17px;
  }
  .brand small {
    font-size: 8px;
  }
  .brand img {
    width: 27px;
    height: 27px;
  }
  .profile button {
    font-size: 11px;
    padding: 5px;
    min-height: 33px;
  }
  .profile button .icon {
    display: none;
  }
  .shell {
    display: block;
    min-height: calc(100dvh - 62px);
  }
  .sidebar {
    padding: 9px 12px;
    gap: 0;
  }
  .sidebar > nav {
    display: flex;
    gap: 5px;
  }
  .sidebar > nav button {
    font-size: 12px;
    min-height: 34px;
    padding: 6px 10px;
  }
  .sidebar > nav .icon {
    width: 17px;
    height: 17px;
  }
  .content {
    padding: 22px 14px 35px;
  }
  .pagehead h1 {
    font-size: 24px;
  }
  .pagehead p {
    font-size: 12px;
  }
  .pagehead .actions {
    gap: 6px;
  }
  .pagehead .actions button {
    min-height: 35px;
    font-size: 11px;
    flex: 0 1 auto;
  }
  .browser-tools {
    display: grid;
    grid-template-columns: 1fr 130px;
    gap: 8px;
  }
  .browser-search {
    grid-column: 1/-1;
  }
  .sort-control {
    grid-column: 2;
    justify-self: end;
  }
  .sort-control select {
    width: 130px;
    font-size: 11px;
    height: 34px;
    min-height: 34px;
  }
  .browser-table td {
    padding: 10px 11px;
  }
  .browser-table th {
    padding: 9px 11px;
  }
  .browser-table th:first-child {
    width: calc(100% - 48px);
  }
  .browser-table th:last-child {
    width: 48px;
  }
  .browser-table td:last-child {
    width: 48px;
  }
  .preview-action {
    display: none;
  }
  .browser-table .file-actions {
    display: flex;
    flex-direction: row;
  }
  .filename {
    gap: 8px;
  }
  .file-title {
    font-size: 12px;
  }
  .filename small {
    font-size: 10px;
  }
  .folder-link {
    font-size: 12px;
  }
  .file-icon {
    width: 26px;
    height: 30px;
  }
  .file-icon.folder .icon {
    width: 23px;
    height: 23px;
  }
  .filepanel {
    min-height: 260px;
  }
  .hint {
    font-size: 10px;
  }
  .folders-open .folder-overlay {
    display: block;
    position: fixed;
    inset: 62px 0 0;
    z-index: 21;
    background: var(--tone-1c102a66);
    border: 0;
    border-radius: 0;
    width: 100%;
    height: calc(100dvh - 62px);
  }
  .folders-open .explorer-tree {
    display: block;
    position: fixed;
    top: 62px;
    bottom: 0;
    left: 0;
    width: min(85vw, 330px);
    z-index: 22;
    max-height: none;
    background: var(--tone-f5f3f8);
    margin: 0;
    padding: 20px 12px;
    box-shadow: 10px 0 40px var(--tone-21102c25);
    overflow: auto;
  }
  .folders-open .tree-line button {
    min-height: 38px;
    font-size: 13px;
  }
  .tree-folder {
    min-width: 0;
  }
  .dialog {
    padding: 19px;
  }
  .permissions-dialog .permission-users {
    max-height: 30vh;
  }
  .fixed-access {
    font-size: 11px;
    padding: 10px;
  }
  .fixed-access .icon {
    width: 17px;
    height: 17px;
  }
  .permission-user {
    font-size: 12px;
    gap: 8px;
  }
  .permission-user select {
    width: 145px;
  }
  .preview-dialog {
    padding: 17px;
  }
  .preview-heading h2 {
    font-size: 16px;
  }
  .preview-footer {
    gap: 8px;
  }
  .preview-content iframe {
    height: 60vh;
  }
  .preview-footer p {
    font-size: 11px;
  }
  .preview-footer a {
    font-size: 12px;
    min-height: 35px;
  }
  .card {
    padding: 19px;
  }
  .cards {
    gap: 15px;
  }
}
@media (max-width: 700px) {
  .folder-menu-button {
    min-height: 44px;
    min-width: 36px;
  }
  .browser-table th:last-child,
  .browser-table td:last-child {
    width: 52px;
  }
  .browser-table td {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}
.file-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.message .small-button {
  margin-left: 10px;
}
.sort-control select:focus-visible {
  outline: 2px solid var(--tone-9972bd);
}
.accounts-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
}
.accounts-controls input,
.accounts-controls select {
  margin: 0;
  min-height: 38px;
  font-size: 12px;
}
.accounts-controls select {
  width: 170px;
}
.accounts-directory {
  grid-column: 1/-1;
}
.account[hidden] {
  display: none;
}
.account-count {
  font-size: 12px;
  color: var(--muted);
}

.migration-page {
  max-width: 1000px;
  margin: auto;
  padding: 40px 24px;
}
.migration-summary {
  margin-bottom: 20px;
}
.migration-kicker {
  color: var(--tone-73627f);
  font-weight: 600;
  font-size: 14px;
}
.migration-progress-number {
  font-size: 40px;
  font-weight: 700;
  margin: 18px 0;
  letter-spacing: -1px;
}
.migration-progress-number small {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--tone-80748a);
}
.migration-summary progress {
  width: 100%;
  height: 13px;
  accent-color: var(--tone-795494);
}
.migration-metrics {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  color: var(--tone-786982);
}
.migration-metrics strong {
  color: var(--tone-36293f);
}
.migration-page summary {
  cursor: pointer;
  font-weight: 600;
}
.migration-issues {
  background: var(--tone-fff3e9);
  padding: 16px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .migration-page {
    padding: 24px 16px;
  }
  .migration-progress-number {
    font-size: 32px;
  }
  .migration-progress-number small {
    display: block;
    margin-top: 8px;
  }
  .migration-metrics {
    flex-direction: column;
  }
}

.deleted-list {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}
.deleted-card {
  background: var(--surface);
  border: 1px solid var(--tone-e7e1eb);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.deleted-card > div:first-child {
  min-width: 0;
}
.deleted-card strong {
  overflow-wrap: anywhere;
}
.deleted-card p {
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.deleted-card small {
  color: var(--tone-817489);
}
.deleted-card .actions {
  flex-wrap: wrap;
  flex-shrink: 0;
}
.danger {
  color: var(--tone-9b3548) !important;
  border-color: var(--tone-dfb8c0) !important;
}
@media (max-width: 850px) {
  .deleted-card {
    align-items: stretch;
    flex-direction: column;
  }
  .deleted-card .actions {
    gap: 8px;
  }
}

.security-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--tone-e7b65c);
  border-radius: 12px;
  background: var(--tone-fff5df);
  color: var(--tone-674414);
}
.security-warning button {
  flex-shrink: 0;
}
.deleted-card p {
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .security-warning {
    align-items: flex-start;
    flex-direction: column;
  }
}
#security-count[hidden] {
  display: none;
}

#add-queen [hidden] {
  display: none;
}

.studio-nav {
  display: block;
  padding: 13px 12px;
  margin: 6px 0 12px;
  background: var(--tone-f1e5fa);
  color: var(--tone-542269);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}

/* Keyboard users see the same action emphasis as pointer users. */
.folder-tile:focus-within {
  border-color: var(--accent);
}
.filetable tr:focus-within {
  background: var(--tone-fff6f9);
}
