/* Bucket explorer — layout on top of XP.css. RTL-first, responsive. */
[x-cloak] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Tahoma, "Segoe UI", "Noto Sans Arabic", Arial, sans-serif;
  font-size: 13px;
  color: #000;
  background: #ece9d8;
  overflow: hidden;
}
/* The Explorer window IS the page: full viewport, no desktop around it */
.desk { height: 100vh; height: 100dvh; }
.window.explorer {
  width: 100%; height: 100%; margin: 0; min-width: 0;
  font-family: inherit; font-size: 13px;
  display: flex; flex-direction: column;
  border-radius: 0;
}
.window.explorer > * { min-width: 0; }
.window.explorer .title-bar { border-radius: 0; flex-shrink: 0; }
.window.explorer .window-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.window.explorer .status-bar { flex-shrink: 0; }

.title-bar-text { display: flex; align-items: center; gap: 4px; min-width: 0; font-family: Tahoma, "Segoe UI", Arial, sans-serif; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb-icon { font-size: 14px; flex-shrink: 0; }
.title-bar-text .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.window-body { margin: 6px; }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid #d6d2c2; margin-bottom: 6px; }
.toolbar button { min-width: 0; padding: 0 10px; font-family: inherit; font-size: 12px; }
.toolbar .search { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.toolbar .search input { width: 200px; font-family: inherit; }

/* address bar */
.address { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.address label { flex-shrink: 0; color: #444; }
.crumbs {
  flex: 1; min-width: 0; background: #fff; border: 1px solid #7f9db9; padding: 3px 6px;
  overflow: hidden; white-space: nowrap; text-align: start;
  font: 13px Tahoma, "Segoe UI", Arial, sans-serif; /* must match ADDR_FONT in app.js (Pretext measurement) */
}
.crumbs { display: flex; align-items: center; }
.crumbs .crumb-wrap { display: flex; align-items: center; white-space: nowrap; flex-shrink: 0; min-width: 0; }
.crumbs .crumb-wrap:last-child { flex: 0 1 auto; }         /* the deepest crumb shrinks with an ellipsis */
.crumbs .crumb { color: #000; text-decoration: none; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.crumbs .crumb:hover { text-decoration: underline; color: #0b61c4; }
.crumbs .crumb.ell { color: #0b61c4; font-weight: bold; }
.crumbs .sep { color: #888; margin: 0 6px; }

/* list pane */
.toolbar, .address { flex-shrink: 0; min-width: 0; }
.pane { flex: 1; min-height: 0; background: #fff; border: 1px solid #7f9db9; box-shadow: inset 1px 1px #c3c3c3; overflow: auto; }
.lv-head, .row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 130px 110px 34px; align-items: center; }
.lv-head { position: sticky; top: 0; z-index: 1; background: linear-gradient(#fff, #f1efe2); border-bottom: 1px solid #d5d2c5; }
.lv-head button {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 4px 8px; font-size: 12px; text-align: start;
  border-inline-end: 1px solid #d5d2c5; white-space: nowrap; overflow: hidden;
}
.lv-head button:hover { background: #fafafa; box-shadow: inset 0 -3px #f9b13a; }
.lv-head button span { font-size: 9px; color: #666; }

.row { min-height: 26px; padding: 0 2px; border-bottom: 1px solid #f2f2f2; }
.row:hover { background: #e8f0fd; }
.row .c-name { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 6px; color: #000; text-decoration: none; }
.row .c-name:hover .nm { color: #0b61c4; text-decoration: underline; }
.row .c-name:focus-visible { outline: 1px dotted #000; background: #316ac5; color: #fff; }
.row .ic { font-size: 16px; flex-shrink: 0; }
.row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-align: right; }
.pane.icons .row .nm { text-align: center; }
.row .nm small { color: #777; }
.row .c-size, .row .c-type, .row .c-date { padding: 0 8px; color: #555; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .c-size, .row .c-date { direction: ltr; text-align: end; unicode-bidi: plaintext; }
.row.link .c-date { direction: ltr; }
.row .copy { min-width: 0; min-height: 0; width: 26px; height: 20px; padding: 0; font-size: 11px; justify-self: center; opacity: 0; }
.row:hover .copy, .row .copy:focus { opacity: 1; }
.empty { padding: 16px; color: #666; text-align: center; }

/* icons view */
.pane.icons .lv-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; padding: 8px; }
.pane.icons .row { display: flex; flex-direction: column; border: 1px solid transparent; padding: 6px 4px; min-height: 96px; }
.pane.icons .row:hover { background: #e8f0fd; border-color: #a9c7f5; }
.pane.icons .row .c-name { flex-direction: column; text-align: center; padding: 0; gap: 4px; }
.pane.icons .row .ic { font-size: 36px; }
.pane.icons .row .nm { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; font-size: 12px; }
.pane.icons .row .nm small, .pane.icons .row .c-type, .pane.icons .row .c-date, .pane.icons .row .copy { display: none; }
.pane.icons .row .c-size { padding: 0; font-size: 11px; text-align: center; }

/* status bar */
.status-bar { margin: 0 3px 3px; }
.status-bar-field { font-family: inherit; font-size: 12px; }
.status-bar .host { text-align: left; }

.noscript { background: #fff; margin: 16px; padding: 16px 32px; }

/* responsive */
@media (max-width: 720px) {
  .lv-head, .row { grid-template-columns: minmax(0, 1fr) 80px 34px; }
  .c-type, .c-date { display: none !important; }
  .row .copy { opacity: 1; }
}
@media (max-width: 520px) {
  .window-body { margin: 4px; }
  .toolbar .search { margin-inline-start: 0; flex: 1 1 100%; min-width: 0; }
  .toolbar .search input { flex: 1; width: auto; min-width: 0; }
  .address label { display: none; }
  .status-bar .host { display: none; }
}
