/* SFTP browser — Apple/Finder symmetric dual-pane. Ported from the design
   reference; drives off the app token system (no standalone window chrome). */

/* Base hidden / active display is owned by terminal.css
   (.sftp-workspace { display:none } / .active { display:grid }); override the
   active layout to a flex column for the twin shell. */
.sftp-workspace.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  /* Grey field so the white pane / toolbar / transfer cards stand out
     (Default-scheme design language). */
  background: var(--app-bg);
}

.sftp-workspace .workspace-toolbar {
  flex: 0 0 auto;
  margin-bottom: 0;
}

/* Single-row titlebar: left = kind glyph + label/protocol picker; center = user@host;
   right = actions (terminal / close). A 3-column grid keeps the host centered
   regardless of the left/right group widths. */
.sftp-toolbar.workspace-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 22px;
  /* Same total vertical padding; the extra top pixel optically centers the glyph + title. */
  padding: 3px 6px 1px 14px;
}
/* Slim the action controls so they don't force the half-height titlebar taller. */
.sftp-toolbar .toolbar-button {
  height: 22px;
  padding: 0 8px;
}
.sftp-toolbar .sftp-bar-close {
  width: 22px;
  height: 22px;
}
.sftp-bar-left {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sftp-bar-kind {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.sftp-bar-kind img {
  flex: 0 0 auto;
}
.sftp-protocol-menu-host {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.sftp-protocol-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.sftp-protocol-change:hover,
.sftp-protocol-change[aria-expanded="true"] {
  background: var(--hover);
  color: var(--text-muted);
}
.sftp-protocol-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: -6px;
  z-index: 20;
  display: grid;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sftp-protocol-menu button {
  display: flex;
  align-items: center;
  min-height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  padding: 0 9px;
  text-align: left;
  cursor: pointer;
}
.sftp-protocol-menu button:hover,
.sftp-protocol-menu button.active {
  background: var(--hover);
  color: var(--text);
}
.sftp-protocol-port-row {
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 5px 6px 2px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 650;
}
.sftp-protocol-port-input {
  width: 58px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 0 6px;
}
.sftp-protocol-port-input:focus {
  border-color: var(--accent);
  outline: none;
}
.sftp-bar-center {
  justify-self: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.sftp-bar-right {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sftp-title-warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 118px;
  min-height: 22px;
  border: 1px solid color-mix(in srgb, var(--notice-warning) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--notice-warning) 10%, transparent);
  color: var(--notice-warning);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  padding: 0 7px;
  white-space: nowrap;
}
.sftp-title-warning svg {
  flex: 0 0 auto;
}
.sftp-bar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.sftp-bar-close:hover {
  background: var(--hover);
  color: var(--text);
}

.sftp-conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.sftp-conn-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.sftp-conn-pill[data-state="connected"] .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent);
}
.sftp-conn-pill[data-state="error"] {
  color: var(--red);
}
.sftp-conn-pill[data-state="error"] .dot {
  background: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent);
}

.sftp-password-dialog {
  display: grid;
  gap: 12px;
}
.sftp-password-dialog p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.sftp-password-dialog-error {
  color: var(--red) !important;
}
.sftp-ftp-notice-dialog {
  display: grid;
  gap: 12px;
}
.sftp-ftp-notice-dialog p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ============================== panes row ============================== */
.sftp-panes {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
}

.sftp-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.sftp-pane-head {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--hairline);
  flex: 0 0 auto;
}
.sftp-pane-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* breadcrumb */
.sftp-crumbs {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  overflow: hidden;
}
.sftp-crumb-seg {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.sftp-crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 180px;
  height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.sftp-crumb .sftp-crumb-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.sftp-crumb:hover {
  background: var(--hover);
  color: var(--text);
}
.sftp-crumb.current {
  color: var(--text);
  font-weight: 640;
  pointer-events: none;
}
.sftp-crumb .gl {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--accent);
}
.sftp-crumb-sep {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--text-faint);
}

/* editable path */
.sftp-path-edit {
  flex: 1 1 auto;
  min-width: 0;
}
.sftp-path-input {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 0.5px solid var(--accent);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  outline: none;
  box-shadow: var(--ring);
  font: inherit;
  font-size: 12.5px;
}

.sftp-pane-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
}
.sftp-recent-wrap {
  position: relative;
  display: inline-flex;
}
.sftp-recent-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  width: min(340px, 80vw);
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.sftp-recent-menu button {
  min-width: 0;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  /* Truncate from the start so the trailing folder — the part that tells you
     where the path leads — stays visible instead of being clipped. */
  direction: rtl;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.sftp-recent-menu button:hover {
  background: var(--hover);
}

/* view options (hamburger) menu — zoom + content-view background */
.sftp-viewopts-wrap {
  position: relative;
  display: inline-flex;
}
.sftp-viewopts-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: 232px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.sftp-viewopts-zoom {
  display: grid;
  gap: 6px;
}
.sftp-viewopts-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sftp-viewopts-zoom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.sftp-viewopts-zoom-row input[type="range"] {
  flex: 1 1 auto;
  margin: 0;
  accent-color: var(--accent);
}
.sftp-viewopts-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.sftp-viewopts-item:hover {
  background: var(--hover);
}
.sftp-bg-popover {
  z-index: 260;
}

/* icon button */
.sftp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.12s, color 0.12s;
}
.sftp-icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.sftp-icon-btn:active {
  background: var(--press);
}
.sftp-icon-btn[disabled] {
  color: var(--text-faint);
  background: transparent;
  opacity: 0.55;
  cursor: default;
}

/* segmented view switch */
.sftp-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
}
.sftp-segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.sftp-segmented button:hover {
  color: var(--text);
}
.sftp-segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

/* list column header */
.sftp-col-head {
  display: grid;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  flex: 0 0 auto;
  user-select: none;
}
.sftp-col-head button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.sftp-col-head button:hover {
  color: var(--text);
}
.sftp-col-head .num {
  justify-content: flex-end;
  text-align: right;
}
.sftp-col-head .sftp-sort-ind {
  display: inline-flex;
  color: var(--accent);
}

/* file body */
.sftp-file-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  overscroll-behavior: contain;
}
.sftp-file-body.sftp-view-gallery {
  padding: 14px;
}
.sftp-file-body::-webkit-scrollbar {
  width: 9px;
}
.sftp-file-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-faint) 50%, transparent);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.sftp-file-body.drop-target {
  background: var(--sel-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
  border-radius: 10px;
}

/* list rows — `--sftp-zoom` (set on .sftp-file-body) scales item sizing. */
.sftp-row {
  display: grid;
  align-items: center;
  gap: 10px;
  height: calc(30px * var(--sftp-zoom, 1));
  padding: 0 8px;
  border-radius: 6px;
  color: var(--text);
  user-select: none;
  cursor: default;
  font-size: calc(13px * var(--sftp-zoom, 1));
}
.sftp-row-glyph img {
  width: calc(20px * var(--sftp-zoom, 1));
  height: calc(20px * var(--sftp-zoom, 1));
}
.sftp-row .nm {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.sftp-row-glyph {
  display: inline-flex;
  flex: 0 0 auto;
}
.sftp-row .nm > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.sftp-row .num {
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: calc(12.5px * var(--sftp-zoom, 1));
}
.sftp-row:hover {
  background: var(--hover);
}
.sftp-row.sel {
  background: var(--sel);
  color: #fff;
}
.sftp-row.sel .num {
  color: rgba(255, 255, 255, 0.82);
}

/* gallery */
.sftp-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(96px * var(--sftp-zoom, 1)), 1fr));
  gap: 6px;
}
.sftp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 10px;
  border-radius: 10px;
  user-select: none;
  cursor: default;
}
.sftp-tile:hover {
  background: var(--hover);
}
.sftp-tile.sel {
  background: var(--sel-soft);
}
.sftp-tile-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(52px * var(--sftp-zoom, 1));
}
.sftp-tile-ico img {
  width: calc(52px * var(--sftp-zoom, 1));
  height: calc(52px * var(--sftp-zoom, 1));
}
.sftp-tile-cap {
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: calc(12px * var(--sftp-zoom, 1));
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sftp-tile.sel .sftp-tile-cap {
  background: var(--sel);
  color: #fff;
}

/* inline rename */
.sftp-rename-input {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0 5px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 13px;
}

.sftp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: var(--text-faint);
  font-size: 13px;
}

/* ===================== local explorer sidebar ======================== */
/* Pane body splits into [sidebar | content]; the col header + file body live
   inside .sftp-pane-content so the sidebar spans their combined height. */
.sftp-pane-body {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
}
.sftp-pane-content {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
}
/* Content-view background sits behind the column header + file list. */
.sftp-pane-content > .sftp-col-head,
.sftp-pane-content > .sftp-file-body {
  position: relative;
  z-index: 1;
}

/* ===================== content-view background ======================= */
.sftp-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.sftp-bg-fill,
.sftp-bg-fill video,
.sftp-bg-layer .dw-dynamic-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sftp-bg-media::after {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--sftp-bg-dim-color, transparent);
  content: "";
}

.sftp-sidebar {
  flex: 0 0 var(--sftp-sb-w, 214px);
  width: var(--sftp-sb-w, 214px);
  background: var(--surface-muted);
  border-right: 1px solid var(--hairline);
  padding: 8px 0 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  user-select: none;
  --sftp-sb-row-h: 30px;
  --sftp-sb-pad: 11px;
  transition: flex-basis 0.22s ease, width 0.22s ease, padding 0.22s ease, opacity 0.16s ease;
}
.sftp-sidebar.collapsed {
  flex-basis: 0;
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.sftp-sidebar::-webkit-scrollbar {
  width: 9px;
}
.sftp-sidebar::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-faint) 45%, transparent);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sftp-sb-section + .sftp-sb-section {
  margin-top: 10px;
}
.sftp-sb-header {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px 0 var(--sftp-sb-pad);
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
  color: var(--text-faint);
  text-align: left;
}
.sftp-sb-header .tw {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-faint);
  transition: transform 0.16s ease;
  transform: rotate(90deg);
}
.sftp-sb-section.collapsed .sftp-sb-header .tw {
  transform: rotate(0deg);
}
.sftp-sb-header .lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sftp-sb-header:hover .lbl {
  color: var(--text-muted);
}

.sftp-sb-list {
  display: grid;
  gap: 1px;
  padding: 2px 8px 0;
  overflow: hidden;
}
.sftp-sb-section.collapsed .sftp-sb-list {
  display: none;
}

.sftp-sb-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: var(--sftp-sb-row-h);
  padding: 0 8px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.sftp-sb-row:hover {
  background: var(--hover);
}
.sftp-sb-row.active {
  background: var(--sel);
  color: #fff;
}
.sftp-sb-row .ico {
  flex: 0 0 auto;
  display: inline-flex;
  width: 19px;
  justify-content: center;
  color: var(--sftp-sb-tint, var(--accent));
}
.sftp-sb-row.active .ico {
  color: #fff;
}
.sftp-sb-row .nm {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* drive rows carry a capacity bar */
.sftp-sb-row.has-meta {
  height: calc(var(--sftp-sb-row-h) + 16px);
}
.sftp-sb-row .stack {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.sftp-sb-row .cap {
  height: 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text-faint) 38%, transparent);
  overflow: hidden;
}
.sftp-sb-row.active .cap {
  background: rgba(255, 255, 255, 0.28);
}
.sftp-sb-row .cap > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: color-mix(in srgb, var(--sftp-sb-tint, var(--accent)) 85%, transparent);
}
.sftp-sb-row.active .cap > i {
  background: #fff;
}
.sftp-sb-row .cap-txt {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sftp-sb-row.active .cap-txt {
  color: rgba(255, 255, 255, 0.82);
}

/* trailing action (pin / unpin) */
.sftp-sb-row .act {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  margin-right: -3px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.sftp-sb-row:hover .act {
  opacity: 1;
}
.sftp-sb-row .act:hover {
  background: var(--press);
  color: var(--text);
}
.sftp-sb-row .act.pinned {
  color: var(--accent);
  opacity: 0;
}
.sftp-sb-row:hover .act.pinned {
  opacity: 1;
}
.sftp-sb-row.active .act {
  color: rgba(255, 255, 255, 0.85);
}
.sftp-sb-row.active .act:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* favorites drag-to-reorder */
.sftp-sb-row.dragging {
  opacity: 0.4;
}
.sftp-sb-drop-line {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  pointer-events: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 26%, transparent);
}
.sftp-sb-empty {
  margin: 2px 10px;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px dashed var(--border);
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
}

/* drag a file/folder from the pane onto Favorites */
.sftp-sb-list.reorder.drop-ok {
  border-radius: 8px;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: var(--sel-soft);
}
.sftp-sb-empty.drop-ok {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--sel-soft);
}

/* pane status bar (items / folders + free space) */
.sftp-pane-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 12px;
  border-top: 1px solid var(--hairline);
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 500;
  user-select: none;
}
.sftp-pane-foot .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}
.sftp-pane-foot-spacer {
  flex: 1 1 auto;
}

/* search box (right of the view switcher) */
.sftp-search {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 132px;
  min-width: 112px;
  max-width: 170px;
  height: 24px;
  margin-left: 2px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
  color: var(--text-faint);
  overflow: hidden;
  transition: box-shadow 0.12s, background 0.12s;
}
.sftp-search:focus-within {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.sftp-search input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 12.5px;
}
.sftp-search input::placeholder {
  color: var(--text-faint);
}
.sftp-search .sftp-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--text-faint);
  color: var(--surface);
  cursor: pointer;
  flex: 0 0 auto;
}

/* ============================ center gutter ============================ */
.sftp-gutter {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 58px;
}
.sftp-xfer-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0.5px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.05s;
}
.sftp-xfer-arrow:hover:not([disabled]) {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.sftp-xfer-arrow:active:not([disabled]) {
  transform: scale(0.94);
}
.sftp-xfer-arrow[disabled] {
  opacity: 0.4;
  cursor: default;
}

/* ============================ transfer area ============================ */
.sftp-xfer {
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.sftp-xfer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px 0 14px;
  cursor: pointer;
  user-select: none;
}
.sftp-xfer-bar:hover {
  background: var(--hover);
}
.sftp-xfer-bar .lead {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-muted);
}
.sftp-xfer-bar .status {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sftp-xfer.has-error .sftp-xfer-bar .lead {
  color: var(--red);
}
.sftp-xfer.has-error .sftp-xfer-bar .status {
  color: var(--red);
  font-weight: 600;
}
.sftp-xfer-bar .mini-track {
  flex: 0 0 120px;
  height: 5px;
  border-radius: 3px;
  background: var(--hover);
  overflow: hidden;
}
.sftp-xfer-bar .mini-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.sftp-xfer-bar .right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--text-faint);
}
.sftp-xfer-chev {
  display: inline-flex;
  transition: transform 0.18s;
}
.sftp-xfer.open .sftp-xfer-chev {
  transform: rotate(180deg);
}
.sftp-xfer-panel {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  background: var(--surface);
  transition: max-height 0.22s ease;
}
.sftp-xfer.open .sftp-xfer-panel {
  max-height: 220px;
  overflow-y: auto;
  border-top-color: var(--hairline);
}
.sftp-xfer-panel-inner {
  padding: 6px;
}
.sftp-xfer-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 78px 28px;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 10px;
  border-radius: 8px;
}
.sftp-xfer-row:hover {
  background: var(--hover);
}
.sftp-xfer-row .dir {
  display: inline-flex;
  color: var(--text-muted);
}
.sftp-xfer-row .meta {
  min-width: 0;
}
.sftp-xfer-row .meta .nm {
  font-size: 12.5px;
  font-weight: 590;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sftp-xfer-row .meta .track {
  margin-top: 4px;
  height: 4px;
  border-radius: 3px;
  background: var(--hover);
  overflow: hidden;
}
.sftp-xfer-row .meta .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.sftp-xfer-row .meta .fill.done {
  background: var(--green);
}
.sftp-xfer-row .meta .fill.failed,
.sftp-xfer-row .meta .fill.canceled {
  background: var(--red);
}
.sftp-xfer-row .st {
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}
.sftp-xfer-row .st.active {
  color: var(--accent);
}
.sftp-xfer-row .st.done {
  color: var(--green);
}
.sftp-xfer-row .st.queued {
  color: var(--text-faint);
}
.sftp-xfer-row .st.failed,
.sftp-xfer-row .st.canceled {
  color: var(--red);
}
.sftp-xfer-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
}

/* ============================ context menu ============================= */
.sftp-ctx-menu {
  position: fixed;
  z-index: 51;
  min-width: 196px;
  padding: 5px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}
.sftp-ctx-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 13px;
  cursor: default;
}
.sftp-ctx-menu button:hover:not([disabled]) {
  background: var(--accent);
  color: #fff;
}
.sftp-ctx-menu button[disabled] {
  color: var(--text-faint);
}
.sftp-ctx-sep {
  height: 1px;
  margin: 5px 8px;
  background: var(--hairline);
}

/* ============================ properties ============================== */
.sftp-props {
  width: 320px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow);
}
.sftp-props-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--hairline);
}
.sftp-props-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sftp-props-head .nm {
  font-size: 15px;
  font-weight: 640;
  text-align: center;
  word-break: break-word;
}
.sftp-props-head .sub {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: capitalize;
}
.sftp-props-body {
  padding: 6px 18px 14px;
}
.sftp-props-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 4px 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
}
.sftp-props-row:last-child {
  border-bottom: 0;
}
.sftp-props-row .k {
  color: var(--text-muted);
}
.sftp-props-row .v {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
  text-transform: capitalize;
}
.sftp-perm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 18px 18px;
}
.sftp-props-error {
  margin: 0 18px;
  color: var(--red);
  font-size: 12px;
}
.sftp-props-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 18px 18px;
}

/* transfer-conflict path + z */
.sftp-conflict-z {
  z-index: 136;
}
.sftp-conflict-path {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 12px;
}
