/* MintHome — Explorer (Windows 11 File Explorer replica) */
:root {
  --fx-bg: #f3f7fc;
  --fx-bg-elev: rgba(255,255,255,.72);
  --fx-border: rgba(15,30,50,.09);
  --fx-text: #17222f;
  --fx-text-muted: #5c6b7c;
  --fx-accent: #2f6fd6;
  --fx-accent-soft: rgba(47,111,214,.12);
  --fx-hover: rgba(15,30,50,.05);
  --fx-selected: rgba(47,111,214,.16);
  --fx-selected-border: rgba(47,111,214,.55);
  --fx-danger: #d3392c;
  --fx-radius: 8px;
}
[data-theme="dark"] .mh-fx-root, .mh-th-oled .mh-fx-root, .mh-th-dark .mh-fx-root {
  --fx-bg: #1f2126;
  --fx-bg-elev: rgba(38,40,46,.82);
  --fx-border: rgba(255,255,255,.09);
  --fx-text: #eef2f7;
  --fx-text-muted: #9aa5b3;
  --fx-accent: #6fa8ff;
  --fx-accent-soft: rgba(111,168,255,.16);
  --fx-hover: rgba(255,255,255,.06);
  --fx-selected: rgba(111,168,255,.20);
  --fx-selected-border: rgba(111,168,255,.55);
}

.mh-fx-root {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--fx-bg);
  color: var(--fx-text);
  font-family: "Segoe UI", "Yu Gothic UI", "Hiragino Sans", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
}

/* ---------------------------------------------------------------- header */
.mh-fx-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 8px;
  flex: 0 0 auto;
}
.mh-fx-navgroup { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.mh-fx-navbtn {
  width: 32px; height: 32px; border-radius: 6px;
  display: grid; place-items: center;
  border: none; background: transparent; color: var(--fx-text);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .14s ease, transform .12s ease, opacity .14s ease;
}
.mh-fx-navbtn:hover { background: var(--fx-hover); }
.mh-fx-navbtn:active { transform: scale(.9); }
.mh-fx-navbtn:disabled { opacity: .32; pointer-events: none; }

.mh-fx-address {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none;
  height: 34px; padding: 0 10px;
  background: var(--fx-bg-elev);
  border: 1px solid var(--fx-border);
  border-radius: 999px;
}
.mh-fx-address::-webkit-scrollbar { display: none; }
.mh-fx-crumb {
  flex: 0 0 auto; border: none; background: transparent; color: var(--fx-text);
  font-size: 12.5px; padding: 4px 8px; border-radius: 5px; cursor: pointer; white-space: nowrap;
  transition: background .14s ease;
}
.mh-fx-crumb:hover { background: var(--fx-hover); }
.mh-fx-crumb:last-of-type { font-weight: 600; }
.mh-fx-crumb-sep { display: inline-flex; color: var(--fx-text-muted); opacity: .6; flex: 0 0 auto; }

.mh-fx-search {
  flex: 0 0 200px;
  height: 34px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--fx-border);
  background: var(--fx-bg-elev);
  color: var(--fx-text);
  font-size: 12.5px;
  outline: none;
  transition: box-shadow .16s ease, border-color .16s ease;
}
.mh-fx-search:focus { border-color: var(--fx-accent); box-shadow: 0 0 0 3px var(--fx-accent-soft); }
.mh-fx-search::-webkit-search-cancel-button { cursor: pointer; }

/* --------------------------------------------------------------- cmdbar */
.mh-fx-cmdbar {
  display: flex; align-items: center; gap: 2px;
  padding: 2px 12px 8px;
  flex: 0 0 auto;
}
.mh-fx-cmdbtn {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  border: none; background: transparent; color: var(--fx-text);
  border-radius: 6px; cursor: pointer; font-size: 12.5px;
  transition: background .14s ease, opacity .14s ease, transform .1s ease;
}
.mh-fx-cmdbtn:hover:not(:disabled) { background: var(--fx-hover); }
.mh-fx-cmdbtn:active:not(:disabled) { transform: scale(.96); }
.mh-fx-cmdbtn:disabled { opacity: .34; pointer-events: none; }
.mh-fx-cmdicon { display: inline-flex; width: 16px; height: 16px; }
.mh-fx-cmdicon svg { width: 100%; height: 100%; }
.mh-fx-cmdlabel { white-space: nowrap; }
.mh-fx-cmddivider { width: 1px; height: 20px; background: var(--fx-border); margin: 0 6px; flex: 0 0 auto; }
.mh-fx-cmdspacer { flex: 1 1 auto; }

.mh-fx-viewtoggle { display: flex; align-items: center; gap: 2px; background: var(--fx-hover); border-radius: 8px; padding: 2px; }
.mh-fx-viewbtn {
  width: 28px; height: 26px; border-radius: 6px; border: none; background: transparent; color: var(--fx-text-muted);
  display: grid; place-items: center; cursor: pointer; transition: background .14s ease, color .14s ease;
}
.mh-fx-viewbtn svg { width: 15px; height: 15px; }
.mh-fx-viewbtn--active { background: var(--fx-bg-elev); color: var(--fx-accent); box-shadow: 0 1px 3px rgba(0,0,0,.14); }

/* ------------------------------------------------------------------ body */
.mh-fx-body { flex: 1 1 auto; display: flex; min-height: 0; }

.mh-fx-navpane {
  flex: 0 0 200px; max-width: 200px;
  overflow-y: auto; padding: 4px 8px 16px;
  border-right: 1px solid var(--fx-border);
}
.mh-fx-navsection-title { font-size: 11px; font-weight: 700; color: var(--fx-text-muted); padding: 10px 8px 4px; letter-spacing: .02em; }
.mh-fx-navsection-title--sp { margin-top: 4px; }
.mh-fx-navitem {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; color: var(--fx-text);
  padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left;
  font-size: 12.5px;
  transition: background .13s ease, color .13s ease;
}
.mh-fx-navitem--indent { padding-left: 26px; }
.mh-fx-navitem:hover { background: var(--fx-hover); }
.mh-fx-navitem--active { background: var(--fx-selected); color: var(--fx-accent); font-weight: 600; }
.mh-fx-navitem.mh-fx-dragover { background: var(--fx-selected); outline: 1.5px dashed var(--fx-accent); }
.mh-fx-navicon { width: 18px; height: 18px; flex: 0 0 auto; display: inline-flex; }
.mh-fx-navicon svg { width: 100%; height: 100%; }
.mh-fx-navlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mh-fx-filepane {
  flex: 1 1 auto; min-width: 0; position: relative;
  overflow-y: auto; padding: 10px 14px 24px;
  outline: none;
}
.mh-fx-filepane.mh-fx-dropzone::after {
  content: ""; position: absolute; inset: 6px; border-radius: 12px;
  border: 2px dashed var(--fx-accent); background: var(--fx-accent-soft);
  pointer-events: none; z-index: 5;
  animation: mh-fx-pulse 1.1s ease-in-out infinite;
}
@keyframes mh-fx-pulse { 0%,100% { opacity: .7; } 50% { opacity: 1; } }

.mh-fx-detailspane {
  flex: 0 0 260px; max-width: 260px;
  border-left: 1px solid var(--fx-border);
  padding: 18px 16px; overflow-y: auto;
  display: none;
}
@media (min-width: 860px) { .mh-fx-detailspane { display: block; } }
.mh-fx-detailspane--empty { display: none; }
@media (min-width: 860px) { .mh-fx-detailspane--empty { display: flex; align-items: center; justify-content: center; color: var(--fx-text-muted); font-size: 12px; } }
.mh-fx-dp-hero {
  width: 100%; aspect-ratio: 1.4; border-radius: 10px; background: var(--fx-hover);
  display: grid; place-items: center; margin-bottom: 14px;
}
.mh-fx-dp-icon { width: 56px; height: 56px; }
.mh-fx-dp-icon svg { width: 100%; height: 100%; }
.mh-fx-dp-title { font-weight: 600; font-size: 14px; margin-bottom: 12px; word-break: break-all; }
.mh-fx-dp-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 12px; }
.mh-fx-dp-k { color: var(--fx-text-muted); }
.mh-fx-dp-v { text-align: right; }

/* ----------------------------------------------------------------- grid */
.mh-fx-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 4px;
}
.mh-fx-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 8px; border-radius: 8px; border: 1.5px solid transparent;
  background: transparent; cursor: pointer; color: var(--fx-text);
  animation: mh-fx-item-in .26s cubic-bezier(.22,1,.36,1) backwards;
  animation-delay: calc(var(--i, 0) * 14ms);
  -webkit-tap-highlight-color: transparent;
}
@keyframes mh-fx-item-in { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.mh-fx-item:hover { background: var(--fx-hover); }
.mh-fx-item--selected { background: var(--fx-selected); border-color: var(--fx-selected-border); }
.mh-fx-item--cut { opacity: .45; }
.mh-fx-item--grid .mh-fx-item-icon { width: 48px; height: 48px; }
.mh-fx-item--grid .mh-fx-item-name { font-size: 11.5px; text-align: center; line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ----------------------------------------------------------------- list */
.mh-fx-list { display: flex; flex-direction: column; gap: 1px; }
.mh-fx-item--list {
  flex-direction: row; align-items: center; justify-content: flex-start;
  padding: 6px 8px; width: 100%; border-radius: 6px;
}
.mh-fx-item--list .mh-fx-item-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-fx-item-icon--sm { width: 22px; height: 22px; margin-right: 4px; }
.mh-fx-item-icon svg { width: 100%; height: 100%; display: block; }

/* -------------------------------------------------------------- details */
.mh-fx-details { display: flex; flex-direction: column; }
.mh-fx-dt-head {
  display: grid; grid-template-columns: 1fr 150px 130px 90px;
  gap: 6px; padding: 6px 10px; font-size: 11.5px; color: var(--fx-text-muted);
  border-bottom: 1px solid var(--fx-border); position: sticky; top: 0; background: var(--fx-bg); z-index: 2;
}
.mh-fx-dt-row {
  display: grid; grid-template-columns: 1fr 150px 130px 90px;
  gap: 6px; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  align-items: center;
  animation: mh-fx-item-in .22s cubic-bezier(.22,1,.36,1) backwards;
  animation-delay: calc(var(--i, 0) * 10ms);
}
.mh-fx-dt-row:hover { background: var(--fx-hover); }
.mh-fx-dt-row.mh-fx-item--selected { background: var(--fx-selected); }
.mh-fx-dt-row.mh-fx-item--cut { opacity: .45; }
.mh-fx-dt-col { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fx-text-muted); }
.mh-fx-dt-col--name { display: flex; align-items: center; gap: 8px; color: var(--fx-text); }
.mh-fx-dt-col--size { text-align: right; }

.mh-fx-rename-input {
  font: inherit; color: var(--fx-text); background: var(--fx-bg-elev);
  border: 1.5px solid var(--fx-accent); border-radius: 4px; padding: 1px 4px;
  width: 100%; outline: none;
}

/* --------------------------------------------------------------- rubber */
.mh-fx-rubber {
  position: absolute; z-index: 4; pointer-events: none;
  background: var(--fx-accent-soft); border: 1px solid var(--fx-accent);
  border-radius: 3px; opacity: 0;
}
.mh-fx-rubber[data-active="true"] { opacity: 1; }

/* ---------------------------------------------------------------- empty */
.mh-fx-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--fx-text-muted); text-align: center; }
.mh-fx-empty-icon { opacity: .5; }
.mh-fx-empty p { font-size: 13px; }

/* --------------------------------------------------------------- status */
.mh-fx-statusbar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 5px 16px calc(5px + env(safe-area-inset-bottom, 0px));
  font-size: 11.5px; color: var(--fx-text-muted);
  border-top: 1px solid var(--fx-border);
  background: var(--fx-bg-elev);
}

/* ------------------------------------------------------------ trash tint */
.mh-fx-filepane[data-trash="true"] .mh-fx-item-icon { filter: saturate(.85); }

/* ------------------------------------------------------------- context menu */
.mh-fx-menu-scrim { position: fixed; inset: 0; z-index: 9500; background: transparent; }
.mh-fx-menu {
  position: fixed; z-index: 9501; min-width: 200px;
  padding: 6px; border-radius: 10px;
  background: linear-gradient(180deg, rgb(255 255 255 / .08), rgb(255 255 255 / .02) 48%, rgb(0 0 0 / .05)), var(--fx-bg-elev);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--fx-border);
  box-shadow: 0 16px 44px rgba(0,0,0,.28), 0 2px 10px rgba(0,0,0,.16);
  opacity: 0; transform: scale(.92) translateY(-4px); transform-origin: top left;
  transition: opacity .16s ease, transform .18s cubic-bezier(.34,1.4,.64,1);
}
.mh-fx-menu[data-open="true"] { opacity: 1; transform: none; }
.mh-fx-menu-item {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  color: var(--fx-text); font-size: 12.5px; padding: 8px 10px; border-radius: 6px; cursor: pointer;
  transition: background .12s ease;
}
.mh-fx-menu-item:hover { background: var(--fx-hover); }
.mh-fx-menu-item--danger { color: var(--fx-danger); }

/* ------------------------------------------------------------- preview */
.mh-fx-preview {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  background: var(--fx-bg);
  opacity: 1; transform: translateY(0);
  transition: opacity .22s cubic-bezier(.22,1,.36,1), transform .24s cubic-bezier(.22,1,.36,1);
}
.mh-fx-preview[data-enter="true"] { opacity: 0; transform: translateY(14px); }
.mh-fx-preview-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  border-bottom: 1px solid var(--fx-border);
  background: var(--fx-bg-elev);
}
.mh-fx-preview-title { flex: 1 1 auto; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-fx-preview-save {
  border: none; background: var(--fx-accent); color: #fff; font-size: 12.5px;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600;
  transition: filter .14s ease, transform .1s ease;
}
.mh-fx-preview-save:hover { filter: brightness(1.08); }
.mh-fx-preview-save:active { transform: scale(.95); }
.mh-fx-preview-close {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--fx-hover);
  color: var(--fx-text); display: grid; place-items: center; cursor: pointer;
  transition: background .14s ease, transform .1s ease;
}
.mh-fx-preview-close:hover { background: var(--fx-selected); }
.mh-fx-preview-close:active { transform: scale(.9); }
.mh-fx-preview-content { flex: 1 1 auto; overflow: auto; display: flex; }
.mh-fx-preview-text {
  flex: 1 1 auto; border: none; resize: none; outline: none;
  background: transparent; color: var(--fx-text);
  font-family: "Cascadia Code", ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13.5px; line-height: 1.7; padding: 18px 20px;
}
.mh-fx-preview-img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.mh-fx-preview-empty, .mh-fx-preview-generic { margin: auto; text-align: center; color: var(--fx-text-muted); padding: 40px; }
.mh-fx-preview-generic-icon { width: 72px; height: 72px; margin: 0 auto 14px; }
.mh-fx-preview-generic-icon svg { width: 100%; height: 100%; }
.mh-fx-preview-generic-name { font-weight: 600; color: var(--fx-text); margin-bottom: 4px; word-break: break-all; }
.mh-fx-preview-generic-meta { font-size: 12px; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 640px) {
  .mh-fx-navpane { position: absolute; left: 0; top: 0; bottom: 0; z-index: 6; background: var(--fx-bg); transform: translateX(-100%); transition: transform .24s cubic-bezier(.22,1,.36,1); box-shadow: 8px 0 24px rgba(0,0,0,.18); }
  .mh-fx-search { flex-basis: 120px; }
  .mh-fx-cmdlabel { display: none; }
  .mh-fx-cmdbtn { padding: 0 8px; }
  .mh-fx-dt-head, .mh-fx-dt-row { grid-template-columns: 1fr 100px; }
  .mh-fx-dt-col:nth-child(3), .mh-fx-dt-col:nth-child(4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mh-fx-item, .mh-fx-dt-row, .mh-fx-menu, .mh-fx-preview { animation: none !important; transition: none !important; }
}
