/* My Work — document explorer (consolidated) */

.document-category-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.document-category {
  min-width: 0;
}
.document-category-body {
  padding: 16px 0 8px;
}
.document-grid .document-upload-card {
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}
.document-grid .document-upload-card:hover {
  border-color: var(--blue);
  background: var(--surface-hover);
}
@media (max-width: 600px) {
  .document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.docs-explorer-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  grid-column: 1 / -1;
  min-height: 40px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.docs-back {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
}
.docs-explorer-root {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}
.docs-explorer-root .document-category-body {
  display: none;
}
.docs-explorer-root {
  grid-template-columns: repeat(auto-fill, 112px);
  gap: 12px;
}
.docs-file-icon {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.document-grid .document-delete {
  position: absolute;
  top: 4px;
  right: 4px;
}
.docs-explorer-root .document-category-access {
  display: none;
}
.docs-explorer-root .document-category-settings {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
}
.docs-explorer-root .document-category-settings,
.document-grid .document-delete {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.docs-explorer-root .document-category-head:hover .document-category-settings,
.docs-explorer-root .document-category-head:focus-within .document-category-settings,
.document-grid .document-file-card:hover .document-delete,
.document-grid .document-file-card:focus-within .document-delete {
  opacity: 1;
}
.docs-explorer-root .document-category-head.docs-selected,
.document-grid .document-open.docs-selected {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  border-radius: 9px;
}
.docs-explorer-root .document-category-head:focus-visible,
.document-grid .document-open:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.document-category-list.docs-explorer-root {
  grid-template-columns: repeat(auto-fill, 112px);
  justify-content: start;
  align-content: start;
  gap: 14px;
}
@media (max-width: 600px) {
  .document-category-list.docs-explorer-root,
  .document-category-body .document-grid {
    grid-template-columns: repeat(auto-fill, 96px);
    gap: 10px;
  }
}
.document-category-body .document-upload-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 112px;
  min-height: 124px;
  padding: 10px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  text-align: center;
}
.document-category-body .document-upload-card:hover {
  background: var(--surface-hover);
  border-color: var(--line);
}
.document-category-body .document-upload-card-plus {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: transparent;
  color: var(--blue);
}
.document-category-body .document-upload-card-plus .icon {
  width: 36px;
  height: 36px;
}
.document-category-body .document-upload-card > span:last-child {
  font-size: 12px;
  line-height: 1.35;
}
.document-grid .document-open::before {
  background: var(--file-color, #64748b);
}
.document-open[data-file-kind='pdf'] {
  --file-color: #e44848;
}
.document-open[data-file-kind='word'] {
  --file-color: #3478d4;
}
.document-open[data-file-kind='excel'] {
  --file-color: #249366;
}
.document-open[data-file-kind='powerpoint'] {
  --file-color: #e37e39;
}
.document-open[data-file-kind='image'] {
  --file-color: #9962d9;
}
.document-open[data-file-kind='archive'] {
  --file-color: #c79524;
}
.document-grid .document-open {
  position: relative;
}
.document-grid .document-open[data-file-ext]::after {
  content: attr(data-file-ext);
  position: relative;
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: end;
  top: auto;
  left: auto;
  transform: none;
  box-sizing: border-box;
  min-width: 30px;
  max-width: 58px;
  height: 15px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--file-color, #64748b);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 11px;
  text-align: center;
  pointer-events: none;
}
@media (max-width: 768px) {
  .document-grid .document-open[data-file-ext]::after {
    font-size: 8px;
    padding: 3px 4px;
  }
}
.docs-explorer-root .document-category-settings,
.document-grid .document-delete,
#new-document-category,
.document-category-body .document-upload-card {
  display: none !important;
}
#view:has(.document-category-list) {
  min-height: 100dvh;
}
#view:has(.document-category-list) .document-category-list {
  min-height: calc(100dvh - 230px);
}
.docs-child-folders .document-category-access,
.docs-child-folders .document-category-settings {
  display: none !important;
}
.docs-crumb {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  font: inherit;
  color: var(--blue);
  cursor: pointer;
}
.docs-crumb:disabled {
  color: var(--text);
  cursor: default;
  opacity: 1;
}
.docs-selection-marquee {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  border: 1px solid var(--blue);
  background: color-mix(in srgb, var(--blue) 15%, transparent);
  border-radius: 2px;
}
body.docs-marquee-active,
body.docs-marquee-active * {
  user-select: none !important;
}
.document-category-list .document-category-head.docs-selected,
.document-category-list .document-open.docs-selected {
  background: color-mix(in srgb, var(--blue) 17%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 55%, transparent);
  border-radius: 9px;
}
.document-grid .document-file-card:has(.document-open.docs-selected) {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  border-color: color-mix(in srgb, var(--blue) 45%, transparent);
}
.docs-child-folders .document-category-head.docs-selected {
  background: color-mix(in srgb, var(--blue) 17%, transparent);
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
}
.document-category-list.docs-drop-active {
  outline: 2px dashed color-mix(in srgb, var(--blue) 45%, transparent);
  outline-offset: -3px;
  border-radius: 12px;
}
.document-category-list .document-category-head.docs-drop-folder {
  background: color-mix(in srgb, var(--blue) 20%, transparent);
  border: 2px solid var(--blue);
  border-radius: 10px;
}
.docs-explorer-root > .document-category:not([data-document-category]):has(.document-grid) {
  display: contents !important;
}
.docs-explorer-root > .document-category:not([data-document-category]) > .document-category-head {
  display: none !important;
}
.docs-explorer-root > .document-category:not([data-document-category]) > .document-category-body {
  display: contents !important;
}
.docs-explorer-root
  > .document-category:not([data-document-category])
  > .document-category-body
  > .document-grid {
  display: contents !important;
}
.document-category-list.docs-moving {
  cursor: grabbing;
}
.document-category-list .document-category-head.docs-move-target {
  background: color-mix(in srgb, var(--blue) 23%, transparent);
  border: 2px solid var(--blue);
  border-radius: 10px;
}
.document-category-list.docs-moving .docs-selected {
  opacity: 0.65;
}
.docs-explorer-nav .docs-crumb.docs-move-target {
  background: color-mix(in srgb, var(--blue) 15%, transparent);
  color: var(--blue);
  border-radius: 6px;
  outline: 1px solid var(--blue);
  outline-offset: 2px;
}
.document-category-list.docs-explorer-root > .card:has(.empty) {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  min-height: 320px;
  margin: 0;
  padding: 48px 24px;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.document-category-list.docs-explorer-root > .card:has(.empty) .empty {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}
.docs-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--blue) 20%, transparent);
  border-radius: 9px;
}
.docs-selection-toolbar[hidden] {
  display: none !important;
}
.docs-selection-count {
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.docs-clear-selection {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.docs-clear-selection:hover {
  color: var(--text);
}
@media (max-width: 600px) {
  .docs-selection-toolbar {
    gap: 8px;
    padding: 6px 8px;
  }
}
.docs-delete-selected {
  border: 0;
  background: transparent;
  color: #dc3545;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.docs-delete-selected:hover {
  color: #b91c1c;
}
.docs-explorer-nav {
  position: relative;
}
.docs-selection-toolbar:not([hidden]) {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 4px 10px;
  gap: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  box-shadow: none;
}
.docs-explorer-nav:has(.docs-selection-toolbar:not([hidden])) > .docs-back,
.docs-explorer-nav:has(.docs-selection-toolbar:not([hidden])) > .docs-path {
  visibility: hidden;
}
.docs-selection-toolbar .docs-selection-count {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 8px;
}
.docs-selection-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.docs-selection-toolbar button[hidden] {
  display: none !important;
}
.docs-selection-toolbar .docs-clear-selection {
  font-size: 16px;
  font-weight: 400;
}
.docs-toolbar-divider {
  height: 22px;
  width: 1px;
  background: var(--line, #e5e7eb);
  margin: 0 4px;
}
.docs-selection-toolbar .docs-delete-selected {
  font-size: 22px;
  font-weight: 400;
}
.docs-selection-toolbar .docs-delete-selected:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.07);
}
.docs-selection-toolbar .docs-move-selected,
.docs-selection-toolbar .docs-copy-selected {
  width: auto;
  min-width: 0;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.docs-selection-toolbar {
  overflow-x: auto;
  scrollbar-width: none;
}
.docs-selection-toolbar::-webkit-scrollbar {
  display: none;
}
.docs-selection-toolbar button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.docs-explorer-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.docs-explorer-nav .docs-back,
.docs-explorer-nav .docs-path {
  visibility: visible !important;
  opacity: 1 !important;
}
.docs-selection-toolbar:not([hidden]) {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  min-height: 34px;
  margin: 0 0 0 auto;
  padding: 3px 8px;
  gap: 4px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.docs-selection-toolbar .docs-selection-count {
  margin-right: 4px;
  font-size: 12px;
  font-weight: 600;
}
.docs-toolbar-divider {
  height: 16px;
  margin: 0 4px;
}
.docs-selection-toolbar button {
  width: auto;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
}
.docs-selection-toolbar .docs-clear-selection,
.docs-selection-toolbar .docs-download-selected,
.docs-selection-toolbar .docs-delete-selected {
  width: 28px;
  min-width: 28px;
  padding: 0;
}
.docs-selection-toolbar .docs-move-selected,
.docs-selection-toolbar .docs-copy-selected {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .docs-selection-toolbar:not([hidden]) {
    margin-left: 0;
  }
}
.docs-explorer-nav {
  min-height: 42px;
  gap: 12px;
}
.docs-explorer-nav:has(.docs-selection-toolbar:not([hidden])) > .docs-back,
.docs-explorer-nav:has(.docs-selection-toolbar:not([hidden])) > .docs-path {
  visibility: visible !important;
}
.docs-selection-toolbar:not([hidden]) {
  min-height: 36px;
  padding: 3px 6px;
  gap: 3px;

  background: color-mix(in srgb, var(--surface) 65%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 11px;

  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.045);

  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.docs-selection-toolbar .docs-selection-count {
  padding: 0 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}
.docs-selection-toolbar button {
  height: 28px;
  min-height: 28px;
  border-radius: 7px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.docs-selection-toolbar .docs-delete-selected:hover {
  background: rgba(220, 53, 69, 0.09);
  color: #dc3545;
}
.docs-toolbar-divider {
  margin: 0 5px;
  opacity: 0.65;
}
@media (max-width: 600px) {
  .docs-explorer-nav {
    gap: 8px;
  }
  .docs-selection-toolbar:not([hidden]) {
    max-width: 100%;
    margin-left: 0;
    padding: 3px 5px;
  }
  .docs-selection-toolbar .docs-selection-count {
    font-size: 11px;
  }
}
.docs-move-picker {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.docs-move-tree {
  padding-left: 12px;
}
.docs-move-node {
  margin-top: 3px;
}
.docs-move-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.docs-move-choice:hover {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}
.docs-move-choice.is-selected {
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  font-weight: 600;
}
.docs-move-folder-symbol {
  color: #f59e0b;
  font-size: 17px;
}
.docs-move-children {
  padding-left: 14px;
}
.docs-move-children summary {
  padding: 5px 12px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.docs-move-search {
  width: 100%;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.docs-move-search:focus {
  outline: none;
  border-color: var(--blue);
}
.docs-move-node[hidden] {
  display: none !important;
}
.docs-move-path {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 6%, transparent);
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.docs-move-picker {
  padding: 6px;
}
.docs-move-node {
  margin-top: 1px;
}
.docs-move-choice {
  min-height: 32px;
  padding: 6px 9px;
  gap: 8px;
  font-size: 12px;
}
.docs-move-folder-symbol {
  font-size: 15px;
  line-height: 1;
}
.docs-move-children {
  position: relative;
  padding-left: 15px;
}
.docs-move-children > summary {
  display: flex;
  align-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 2px 0 2px 9px;
  list-style: none;
  cursor: pointer;
}
.docs-move-children > summary::-webkit-details-marker {
  display: none;
}
.docs-move-children > summary::before {
  content: '›';
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.docs-move-children[open] > summary::before {
  transform: rotate(90deg);
}
.docs-move-row {
  display: flex;
  align-items: center;
  min-height: 34px;
}
.docs-move-row > .docs-move-choice {
  flex: 1;
  min-width: 0;
}
.docs-move-toggle,
.docs-move-toggle-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 28px;
}
.docs-move-toggle {
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
.docs-move-toggle.is-open {
  transform: rotate(90deg);
}
.docs-move-children {
  padding-left: 18px;
}
.docs-move-children[hidden] {
  display: none !important;
}
.docs-move-row .docs-move-choice {
  padding: 7px 9px;
  min-height: 32px;
}
.document-grid .document-file-card .document-open.docs-selected {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  outline: none;
}
.document-grid .document-file-card:has(.document-open.docs-selected) {
  background: color-mix(in srgb, var(--blue) 17%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 55%, transparent);
  border-radius: 10px;
}
.docs-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 38px;
  margin-top: 16px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.docs-status-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.docs-status-folder {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.docs-status-details {
  color: var(--muted);
}
.docs-status-state {
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}
.docs-status-bar {
  position: sticky;
  bottom: 12px;
  z-index: 8;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  min-height: 42px;
  margin: 16px 0 12px;
  padding: 9px 14px;

  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 11px;

  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);

  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.docs-status-folder {
  font-size: 12px;
  font-weight: 600;
}
.docs-status-details {
  font-size: 11px;
  color: var(--muted);
}
.docs-status-state {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .docs-status-bar {
    bottom: 8px;
    padding: 9px 10px;
    gap: 6px;
  }
}
.docs-status-bar {
  width: 100%;
  margin: 0;
  bottom: 0;
  border-radius: 0;
  box-shadow: none;

  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.document-category-list.docs-explorer-root > .document-category:not([data-document-category]) {
  display: contents !important;
}
.document-category-list.docs-explorer-root
  > .document-category:not([data-document-category])
  > .document-category-head {
  display: none !important;
}
.document-category-list.docs-explorer-root
  > .document-category:not([data-document-category])
  > .document-grid {
  display: contents !important;
}
.document-category-list.docs-explorer-root .document-file-card {
  min-width: 0;
}
.docs-footer {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: auto;
}
.docs-footer .docs-selection-toolbar:not([hidden]) {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  width: 100% !important;
  min-height: 38px;
  margin: 0 !important;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: none;
  backdrop-filter: blur(14px);
}
.docs-footer .docs-status-bar {
  position: static;
  bottom: auto;
  width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
.docs-footer .docs-selection-toolbar button {
  flex-shrink: 0;
}
.docs-footer {
  position: fixed;
  left: var(--docs-footer-left, 234px);
  right: 0;
  bottom: 0;
  width: auto;
  margin: 0;
  padding: 0;
  gap: 3px;
  z-index: 15;
}
.docs-footer .docs-selection-toolbar:not([hidden]),
.docs-footer .docs-status-bar {
  width: 100% !important;
  margin: 0 !important;
  border-radius: 0;
  box-shadow: none;

  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.docs-footer .docs-status-bar {
  min-height: 40px;
  padding: 9px 18px;
}
.docs-footer .docs-selection-toolbar:not([hidden]) {
  min-height: 40px;
  padding: 5px 12px;
}
#view:has(.docs-footer) {
  padding-bottom: 100px;
}
.docs-footer .docs-status-bar {
  border: none !important;
  box-shadow: none;
}
@media (max-width: 768px) {
  .docs-footer {
    left: 0 !important;
    right: 0;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    z-index: 15;
    gap: 0;
  }
  .docs-footer .docs-selection-toolbar:not([hidden]) {
    min-height: 42px;
    padding: 5px 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .docs-footer .docs-selection-toolbar::-webkit-scrollbar {
    display: none;
  }
  .docs-footer .docs-status-bar {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 11px;
  }
  #view:has(.docs-footer) {
    padding-bottom: calc(165px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 768px) {
  .docs-footer {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

/* --------------------------------------------------------------------------
   Explorer tiles — shared by Desktop and all nested folders
   Single source of truth for dimensions, typography, icons and metadata.
   -------------------------------------------------------------------------- */
.document-category-list {
  --docs-tile-width: 112px;
  --docs-tile-height: 132px;
  --docs-icon-size: 56px;
  --docs-tile-gap: 14px;
}

.document-category-list.docs-explorer-root,
.document-category-list:not(.docs-explorer-root) .document-category-body:not([hidden]) {
  grid-template-columns: repeat(auto-fill, var(--docs-tile-width));
  justify-content: start;
  align-content: start;
  gap: var(--docs-tile-gap);
}

.document-category-body .document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--docs-tile-width));
  gap: var(--docs-tile-gap);
}

.document-category-list:not(.docs-explorer-root) .document-category-body:not([hidden]) {
  display: grid !important;
}

.document-category-list:not(.docs-explorer-root)
  .document-category-body:not([hidden])
  > :is(.docs-child-folders, .document-grid) {
  display: contents !important;
}

.docs-explorer-root .document-category-head,
.docs-child-folders .document-category-head,
.document-grid .document-file-card {
  width: var(--docs-tile-width);
  height: var(--docs-tile-height);
  min-height: var(--docs-tile-height);
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

/* All folder tiles, including DOM clones created when navigating deeper. */
.docs-explorer-root .document-category-head,
.docs-child-folders .document-category-head {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  overflow: hidden;
}

:is(.docs-explorer-root, .docs-child-folders) .document-category-title {
  display: grid;
  grid-template-rows: 92px 14px;
  gap: 4px;
  justify-items: center;
  align-content: start;
  width: 100%;
  min-width: 0;
}

:is(.docs-explorer-root, .docs-child-folders) .document-folder-name {
  display: grid;
  grid-template-rows: var(--docs-icon-size) 32px;
  gap: 4px;
  justify-items: center;
  align-items: start;
  width: 100%;
  height: 92px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
  text-align: center;
  overflow: hidden;
  overflow-wrap: anywhere;
}

:is(.docs-explorer-root, .docs-child-folders) .document-folder-name::before {
  content: '';
  display: block;
  width: var(--docs-icon-size);
  height: var(--docs-icon-size);
  background: #f4a623;
  -webkit-mask: url('/icons/Папка.svg') center / contain no-repeat;
  mask: url('/icons/Папка.svg') center / contain no-repeat;
}

:is(.docs-explorer-root, .docs-child-folders) .document-folder-meta {
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
}

.document-grid .document-file-card {
  position: relative;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.document-grid .document-open {
  position: relative;
  display: grid;
  grid-template-rows: var(--docs-icon-size) 32px 14px;
  gap: 4px;
  justify-items: center;
  align-content: start;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  text-align: center;
}

.document-grid .docs-file-icon {
  display: none;
}

.document-grid .document-open::before {
  grid-column: 1;
  grid-row: 1;
  content: '';
  display: block;
  width: var(--docs-icon-size);
  height: var(--docs-icon-size);
  background: var(--file-color, #64748b);
  -webkit-mask: url('/icons/Документ-пустой.svg') center / contain no-repeat;
  mask: url('/icons/Документ-пустой.svg') center / contain no-repeat;
}

.document-grid .document-open h3 {
  grid-column: 1;
  grid-row: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  width: 100%;
  min-width: 0;
  max-height: 32px;
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.document-grid .document-open p {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
}

.document-grid .document-file-card:hover,
:is(.docs-explorer-root, .docs-child-folders) .document-category-head:hover {
  background: var(--surface-hover);
  border-color: var(--line);
}

/* Select the outer tile only: no double blue frame on files. */
.document-grid .document-open.docs-selected {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  outline: none;
}
.document-grid .document-file-card:has(.document-open.docs-selected),
:is(.docs-explorer-root, .docs-child-folders) .document-category-head.docs-selected {
  background: color-mix(in srgb, var(--blue) 17%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 55%, transparent);
  border-radius: 10px;
}

@media (max-width: 600px) {
  .document-category-list {
    --docs-tile-width: 96px;
    --docs-icon-size: 48px;
    --docs-tile-gap: 10px;
  }
  :is(.docs-explorer-root, .docs-child-folders) .document-category-title {
    grid-template-rows: 84px 14px;
  }
  :is(.docs-explorer-root, .docs-child-folders) .document-folder-name {
    grid-template-rows: var(--docs-icon-size) 32px;
    height: 84px;
  }
  .document-grid .document-open {
    grid-template-rows: var(--docs-icon-size) 32px 14px;
  }
}

/* Explorer action icons */

.docs-selection-toolbar button img,
.docs-context-action .docs-action-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: contain;
}

.docs-selection-toolbar button {
  gap: 7px;
}

.docs-context-action {
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-status-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
}

/* Explorer menu icon contrast */

.docs-context-action .docs-action-icon,
.docs-selection-toolbar button img,
.docs-status-icon {
  filter: brightness(0);
  opacity: 0.72;
}

.docs-context-action.danger .docs-action-icon,
.docs-delete-selected img {
  filter: brightness(0) saturate(100%) invert(27%) sepia(90%) saturate(1958%) hue-rotate(340deg)
    brightness(95%) contrast(95%);
  opacity: 1;
}

.docs-context-action:hover .docs-action-icon,
.docs-selection-toolbar button:hover img {
  opacity: 1;
}

/* Theme-aware document action icons */

.docs-context-action .docs-action-icon,
.docs-selection-toolbar .docs-ui-icon,
.docs-status-icon {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: var(--docs-icon) center / contain no-repeat;
  mask: var(--docs-icon) center / contain no-repeat;
  filter: none !important;
  opacity: 1 !important;
}

/* Context menu: icon left, label right */

.docs-context-menu .docs-context-action {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
}

.docs-selection-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.docs-status-icon {
  flex-basis: 16px;
  width: 16px;
  height: 16px;
}

/* Flat document actions toolbar */

.docs-footer .docs-selection-toolbar:not([hidden]) {
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
}

.docs-selection-toolbar .docs-download-selected,
.docs-selection-toolbar .docs-delete-selected {
  width: auto;
  min-width: 0;
  padding: 0 8px;
  white-space: nowrap;
}

.docs-selection-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

/* Unified action menu typography */

.docs-context-menu .docs-context-action,
.docs-selection-toolbar button,
.docs-selection-toolbar .docs-selection-count {
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.4;
}

.docs-selection-toolbar .docs-move-selected,
.docs-selection-toolbar .docs-copy-selected,
.docs-selection-toolbar .docs-download-selected,
.docs-selection-toolbar .docs-delete-selected {
  font-size: 12px !important;
  font-weight: 400 !important;
}

.docs-selection-toolbar button {
  min-height: 30px;
  gap: 7px;
}

.docs-selection-toolbar .docs-ui-icon,
.docs-context-action .docs-action-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

/* Explorer file extension alignment */

/* Explorer breadcrumbs */

.docs-explorer-nav .docs-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.docs-explorer-nav .docs-crumb::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  -webkit-mask: url('/icons/Folder.svg') center / contain no-repeat;
  mask: url('/icons/Folder.svg') center / contain no-repeat;
}

@media (max-width: 600px) {
  .document-grid .document-open[data-file-ext]::after {
  }
}

/* Breadcrumb separator */

.docs-path-separator {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0 8px;
  align-self: center;
  background: currentColor;
  -webkit-mask: url('/icons/Chevron_Right.svg') center / contain no-repeat;
  mask: url('/icons/Chevron_Right.svg') center / contain no-repeat;
}

.docs-explorer-nav .docs-path {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 6px;
}
