@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:opsz,wght@6..12,400;6..12,600;6..12,700&display=swap');

.sdp-tree,
.sdp-fb,
.sdp-dms,
.sdp-menu {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --font-sans: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --ink: #2b3040;
  --ink-muted: #5f6675;
  --ink-subtle: #8a93a1;
  --line: #dfe3e9;
  --surface: #fff;
  --surface-sunken: #f4f6f8;
  --canvas: #cfd5dd;
  --brand-blue: #0a73b8;
  --green-500: #6cc04a;
  --green-600: #2f7a1f;
  --green-50: #eef8e9;
  --blue-700: #0a5f99;
  --blue-50: #e8f2fa;
  --neutral-50: #eef1f4;
  --danger: #b42318;
  --danger-50: #fdeceb;
  --amber-500: #ffcd44;
  --amber-700: #946200;
  --shadow-card: 0 1px 2px rgba(43, 48, 64, .06), 0 4px 16px rgba(43, 48, 64, .06);
  --shadow-lift: 0 8px 24px rgba(43, 48, 64, .14)
}

@keyframes sdp-pop {
  from {
    opacity: 0;
    transform: translateY(-4px)
  }
}

.sdp-search.is-sm {
  height: 36px;
  min-width: 200px
}

.sdp-tree,
.sdp-fb {
  font-family: var(--font-sans);
  color: var(--ink);
}

.sdp-tree *,
.sdp-fb *,
.sdp-tree *::before,
.sdp-fb *::before {
  box-sizing: border-box;
}

.sdp-tree :focus-visible,
.sdp-fb :focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.sdp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.sdp-iconbtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.sdp-iconbtn:hover {
  background: var(--neutral-50);
}

.sdp-iconbtn:disabled {
  color: var(--ink-subtle);
  cursor: default;
  background: none;
}

.sdp-iconbtn.is-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}

.sdp-iconbtn.is-geo {
  color: var(--blue-700);
}

.sdp-check {
  appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
  border: 1.5px solid var(--ink-subtle);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}

.sdp-check:hover {
  border-color: var(--ink);
}

.sdp-check:checked,
.sdp-check:indeterminate {
  background: var(--ink);
  border-color: var(--ink);
}

.sdp-check:checked::after {
  content: '';
  width: 9px;
  height: 5px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}

.sdp-check:indeterminate::after {
  content: '';
  width: 9px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.sdp-menuwrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.sdp-menu {
  position: absolute;
  z-index: 3000;
  font-family: var(--font-sans);
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  animation: sdp-pop .12s ease-out;
}

.sdp-menu.is-up {
  top: auto;
  bottom: calc(100% + 10px);
}

.sdp-menu.is-left {
  right: auto;
  left: 0;
}

.sdp-menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 6px 0;
}

.sdp-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: 400 12px/20px var(--font-sans);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.sdp-menu__item:hover:not(:disabled) {
  background: var(--neutral-50);
}

.sdp-menu__item:disabled {
  color: var(--ink-subtle);
  cursor: default;
}

.sdp-menu__item.is-danger {
  color: var(--danger);
}

.sdp-menu__item.is-danger:hover {
  background: var(--danger-50);
}

.sdp-menu__hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-muted);
}

.sdp-ico-folder path {
  fill: var(--amber-500);
  stroke: var(--amber-700);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.sdp-badge.is-xs {
  height: 20px;
  padding: 0 7px;
  font-size: 11px;
}

.sdp-seg.is-icons .sdp-seg__btn {
  width: 34px;
  padding: 0;
  justify-content: center;
}

/* ---------- FileTree ---------- */
.sdp-tree {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
}

.sdp-tree__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sdp-tree__head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.sdp-tree .sdp-search {
  min-width: 0;
}

.sdp-tree__list {
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px;
}

.sdp-tree__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding-left: calc(var(--d) * 18px);
  border-radius: var(--radius-sm);
}

.sdp-tree__row:hover {
  background: var(--surface-sunken);
}

.sdp-tree__row.is-active {
  background: var(--blue-50);
}

.sdp-tree__row.is-active .sdp-tree__name {
  font-weight: 700;
  color: var(--ink);
}

.sdp-tree__guides {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--d) * 18px);
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 10px, var(--line) 10px 11px, transparent 11px 18px);
}

.sdp-tree__tw {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
  transition: transform .12s;
}

.sdp-tree__tw:hover {
  background: var(--neutral-50);
  color: var(--ink);
}

.sdp-tree__tw.is-open {
  transform: rotate(90deg);
}

.sdp-tree__tw.is-leaf {
  cursor: default;
}

.sdp-tree__name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 100%;
  padding: 0 6px 0 2px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 400 0.75rem/1rem var(--font-sans);
  text-align: left;
  cursor: pointer;
}

.sdp-tree__name>span:first-of-type {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdp-tree__n {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.sdp-tree mark,
.sdp-fb mark {
  background: none;
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--brand-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.sdp-tree__none {
  margin: var(--space-4) 0;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- FileBrowser ---------- */
.sdp-fb {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}

.sdp-fb__bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding-bottom: var(--space-4);
}

.sdp-crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 240px;
}

.sdp-crumbs__home {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
}

.sdp-crumbs__home:hover,
.sdp-crumbs__link:hover {
  background: var(--neutral-50);
  color: var(--ink);
}

.sdp-crumbs__sep {
  flex: none;
  color: var(--ink-subtle);
}

.sdp-crumbs__link {
  flex: 0 1 auto;
  min-width: 48px;
  max-width: 200px;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-muted);
  font: 600 14px/20px var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdp-crumbs__gap {
  padding: 4px 6px;
  color: var(--ink-muted);
  cursor: help;
}

.sdp-crumbs__here {
  padding: 4px 6px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sdp-fb__tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-left: auto;
}

.sdp-fb__tools .sdp-search {
  min-width: 200px;
}

.sdp-fb__tablewrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.sdp-fb__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.sdp-fb__table th {
  height: 40px;
  padding: 0 var(--space-3);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.sdp-th {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-muted);
  font: 600 12px/16px var(--font-sans);
  letter-spacing: .02em;
  cursor: pointer;
}

.sdp-th svg {
  opacity: 0;
  transition: opacity .12s;
}

.sdp-th:hover,
.sdp-th.is-on {
  color: var(--ink);
}

.sdp-th:hover svg {
  opacity: .5;
}

.sdp-th.is-on svg {
  opacity: 1;
}

.sdp-th.is-static {
  cursor: default;
}

.sdp-fb__table td {
  height: 48px;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  white-space: nowrap;
}

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

.sdp-fb__table tbody tr:hover td {
  background: var(--surface-sunken);
}

.sdp-fb__table tbody tr.is-sel td {
  background: var(--blue-50);
}

.sdp-fb__table tr.is-inactive .sdp-fb__label,
.sdp-fb__table tr.is-inactive .sdp-kind,
.sdp-fb__table tr.is-inactive .sdp-ico-folder {
  opacity: .55;
}

.c-check {
  width: 44px;
  padding-right: 0 !important;
}

.c-name {
  width: 46%;
}

.c-size {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.c-size .sdp-th {
  flex-direction: row-reverse;
}

.c-mod {
  font-variant-numeric: tabular-nums;
}

.c-map {
  width: 56px;
  text-align: center !important;
}

.c-act {
  width: 84px;
  text-align: right !important;
}

.sdp-fb__name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 12px var(--font-sans);
  text-align: left;
  cursor: pointer;
}

.sdp-fb__label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdp-fb__name:hover .sdp-fb__label {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sdp-fb__hover {
  opacity: 0;
}

.sdp-fb__table tr:hover .sdp-fb__hover,
.sdp-fb__hover:focus-visible {
  opacity: 1;
}

.sdp-kind {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--neutral-50);
  color: var(--ink-muted);
}

.sdp-kind b {
  position: absolute;
  bottom: -3px;
  right: -5px;
  padding: 0 3px;
  border-radius: 3px;
  background: var(--danger);
  color: #fff;
  font: 800 8px/12px var(--font-sans);
}

.sdp-kind.is-image,
.sdp-kind.is-sheet {
  background: var(--green-50);
  color: var(--green-600);
}

.sdp-kind.is-pdf {
  background: var(--danger-50);
  color: var(--danger);
}

.sdp-kind.is-doc,
.sdp-kind.is-geo {
  background: var(--blue-50);
  color: var(--blue-700);
}

.sdp-kind.is-thumb {
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(43, 48, 64, .12);
}

.sdp-fb__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}

.sdp-fb__tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: box-shadow .12s, border-color .12s;
}

.sdp-fb__tile:hover {
  box-shadow: var(--shadow-card);
  border-color: var(--ink-subtle);
}

.sdp-fb__tile.is-sel {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.sdp-fb__tile.is-inactive {
  opacity: .6;
}

.sdp-fb__tilecheck {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  opacity: 0;
}

.sdp-fb__tile:hover .sdp-fb__tilecheck,
.sdp-fb__tilecheck:checked,
.sdp-fb__tilecheck:focus-visible {
  opacity: 1;
}

.sdp-fb__tilebtn {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 0 10px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
}

.sdp-fb__tilemedia {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  margin-bottom: 8px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--surface-sunken);
  overflow: hidden;
}

.sdp-fb__tilemedia img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sdp-fb__tilemedia .sdp-kind {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
}

.sdp-fb__tilename {
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdp-fb__tilemeta {
  padding: 0 10px;
  font-size: 12px;
  color: var(--ink-muted);
}

.sdp-fb__tilegeo {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--blue-700);
  box-shadow: var(--shadow-card);
}

.sdp-fb__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: 64px var(--space-6);
  border: 1px dashed var(--ink-subtle);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--ink-muted);
  font-size: 10px;
}

.sdp-fb__empty strong {
  color: var(--ink);
  font-size: 16px;
}

.sdp-fb__empty .sdp-btn {
  margin-top: var(--space-2);
}

.sdp-fb__foot {
  padding: var(--space-3) 2px;
  font-size: 12px;
  color: var(--ink-muted);
}

.sdp-selbar {
  position: sticky;
  bottom: var(--space-4);
  z-index: 20;
  align-self: center;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 32px rgba(43, 48, 64, .28);
  animation: sdp-pop .15s ease-out;
  max-width: 100%;
}

.sdp-selbar__count {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.sdp-selbar__count strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--green-500);
  color: var(--ink);
  font-size: 13px;
}

.sdp-selbar__clear {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 4px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
}

.sdp-selbar__clear:hover {
  background: rgba(255, 255, 255, .22);
}

.sdp-selbar__acts {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: var(--space-2);
  border-left: 1px solid rgba(255, 255, 255, .16);
}

.sdp-selbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: #fff;
  font: 600 13px/18px var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
}

.sdp-selbar__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, .12);
}

.sdp-selbar__btn:disabled {
  color: rgba(255, 255, 255, .4);
  cursor: default;
}

.sdp-selbar :focus-visible {
  outline-color: #fff;
}

.sdp-selbar .sdp-menu {
  color: var(--ink);
  right: 0;
}

@media (max-width: 760px) {

  .sdp-fb__table .c-type,
  .sdp-fb__table .c-mod {
    display: none;
  }

  .sdp-selbar__btn span {
    display: none;
  }

  .sdp-fb__tools {
    width: 100%;
  }

  .sdp-fb__tools .sdp-search {
    flex: 1;
    min-width: 0;
  }
}

.sdp-fb__main {
  min-width: 0
}

.sdp-fb__bars {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: sticky;
  bottom: var(--space-4);
  z-index: 20;
  pointer-events: none;
  position: fixed;
  bottom: 30px;
}

.sdp-fb__bars>* {
  pointer-events: auto
}

.sdp-fb__bars .sdp-selbar {
  position: static;
  margin-top: var(--space-4)
}

.sdp-selbar.is-clip {
  background: var(--blue-700)
}

.sdp-selbar.is-clip .sdp-selbar__count strong {
  background: #fff;
  color: var(--ink)
}

.sdp-fb .sdp-btn:disabled,
.sdp-iconbtn:disabled {
  opacity: .5;
  cursor: default
}

.sdp-fb__table tr[data-id] {
  cursor: default
}

.sdp-dms {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: stretch;
  height: 100%;
  min-height: 0;
  font-family: var(--font-sans);
  color: var(--ink)
}

.sdp-dms>* {
  box-sizing: border-box
}

.sdp-dms__card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  min-height: 0;
  overflow: auto
}

.sdp-dms--single {
  grid-template-columns: minmax(0, 1fr)
}

.sdp-dms__loader {
  position: absolute;
  inset: 0;
  z-index: 99;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(255, 255, 255, .7);
  border-radius: inherit
}

.sdp-dms__search {
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
  padding-top: var(--space-4)
}

@media (max-width:991px) {
  .sdp-dms {
    grid-template-columns: minmax(0, 1fr)
  }

  .sdp-dms__tree {
    display: none
  }
}

.c-extra {
  white-space: nowrap
}

.sdp-selbar {
  flex-wrap: wrap;
  justify-content: center;
  box-sizing: border-box
}

.sdp-selbar__acts {
  flex-wrap: wrap;
  justify-content: center
}

.sdp-fb.is-compact .sdp-selbar__btn span {
  display: none
}

.sdp-fb.is-compact .sdp-selbar__btn {
  padding: 0 10px
}

.sdp-fb.is-compact .sdp-fb__table .c-type,
.sdp-fb.is-compact .sdp-fb__table .c-mod {
  display: none
}

.sdp-fb.is-compact .sdp-fb__tools {
  width: 100%
}

.sdp-fb.is-compact .sdp-fb__tools .sdp-search {
  flex: 1;
  min-width: 0
}

.sdp-selbar.is-static {
  animation: none
}

.sdp-search input,
.sdp-search input:focus,
.sdp-search input:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  background: none !important;
  border-radius: 0 !important;
  -webkit-appearance: none;
  appearance: none
}

.sdp-search input::-webkit-search-cancel-button,
.sdp-search input::-webkit-search-decoration {
  -webkit-appearance: none;
  display: none
}

.sdp-fb__table tr.is-system .sdp-fb__label {
  color: var(--ink-muted);
  font-style: italic
}

.sdp-fb__table tr.is-system .sdp-ico-folder,
.sdp-fb__tile.is-system .sdp-ico-folder {
  filter: grayscale(1);
  opacity: .55
}

.sdp-fb__table tr.is-system td {
  background: var(--surface-sunken)
}

.sdp-fb__table tr.is-system:hover td {
  background: var(--neutral-50)
}

.sdp-fb__tile.is-system {
  background: var(--surface-sunken);
  border-style: dashed
}

.sdp-fb__table tr.is-system.is-sel td {
  background: var(--blue-50)
}

/* A file's name is a link that opens it; the rest of the row still selects. */
.sdp-fb__name.is-file:hover .sdp-fb__label { text-decoration: none; }
.sdp-fb__label.is-link:hover,
.sdp-fb__tilename.is-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Inline uploader inside an empty folder */
.sdp-fb__emptyupload { width: 100%; max-width: 440px; margin-top: var(--space-3); }

/* Menus are floated on <body> so table scroll containers can't clip them */
.sdp-menu--float { color: var(--ink); z-index: 4000; }