/* ===== Ứng dụng: File Explorer, Ảnh, Notepad, PDF, Thuộc tính, Cài đặt ===== */

/* ---------- Tab (Explorer, Notepad) ---------- */
.ex-tabs {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  margin-left: -4px;
}
.ex-tablist {
  display: flex;
  align-items: flex-end;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.ex-tab {
  flex: 0 1 240px;
  min-width: 56px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 0 12px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  color: var(--text);
  position: relative;
}
.win:not(.active) .ex-tab {
  color: var(--text-2);
}
.ex-tab.active {
  background: var(--layer);
}
.ex-tab:not(.active):hover {
  background: var(--hover);
}
.ex-tab:not(.active) + .ex-tab:not(.active)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  height: 16px;
  width: 1px;
  background: var(--divider);
}
.ex-tab-ic {
  display: flex;
  flex: none;
}
.ex-tab-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-tab-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: grid;
  place-items: center;
  flex: none;
  color: inherit;
}
.ex-tab-close:hover {
  background: var(--hover-strong);
}
.ex-newtab {
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: grid;
  place-items: center;
  margin: 0 4px 3px;
  flex: none;
  align-self: flex-end;
}
.ex-newtab:hover {
  background: var(--hover-strong);
}
.np-appic {
  align-self: center;
  margin: 0 8px 0 8px;
  display: flex;
}
.np-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-2);
  margin-right: 8px;
}
.ex-tab.dirty .np-dot {
  display: block;
}
.ex-tab.dirty:not(:hover) .ex-tab-close {
  display: none;
}

/* ---------- Explorer ---------- */
.ex {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--layer);
  container-type: inline-size;
}
.ex-addr {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px 6px 6px;
  flex: none;
}
.ex-hamb {
  display: none;
}
.ex-crumbs-wrap {
  flex: 1;
  min-width: 0;
  height: 32px;
  margin: 0 4px;
  display: flex;
  align-items: center;
  background: var(--control);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: 0 4px;
  cursor: text;
}
.ex-crumbs-wrap.editing {
  border-bottom: 2px solid var(--accent);
}
.ex-crumbs {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.cr-ic {
  display: flex;
  margin: 0 2px 0 4px;
  flex: none;
}
.cr,
.cr-chev {
  height: 24px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 0 6px;
  white-space: nowrap;
  flex: none;
  color: var(--text);
}
.cr-chev {
  padding: 0 3px;
  color: var(--text-2);
}
.cr-chev svg {
  transition: transform 0.15s;
}
.cr-chev.open svg {
  transform: rotate(90deg);
}
.cr:hover,
.cr-chev:hover,
.cr-chev.open {
  background: var(--hover-strong);
}
.cr:last-of-type {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}
.cr-search {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  white-space: nowrap;
  padding-left: 4px;
}
.ex-addr-input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  height: 100%;
  padding: 0 6px;
}
.ex-search {
  width: clamp(150px, 28%, 300px);
  height: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--control);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: 0 8px 0 10px;
  color: var(--text-2);
  flex: none;
}
.ex-search:focus-within {
  border-bottom: 2px solid var(--accent);
  background: var(--layer-2);
}
.ex-search-clear {
  border: 0;
  background: transparent;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.ex-search-clear:hover {
  background: var(--hover-strong);
}
.ex-cmd {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 48px;
  padding: 0 8px;
  border-bottom: 1px solid var(--divider);
  flex: none;
  overflow: hidden;
}
.cmd {
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: none;
  color: var(--text);
}
.cmd.icon-only {
  width: 40px;
  padding: 0;
  justify-content: center;
}
.cmd:hover:not(:disabled) {
  background: var(--hover-strong);
}
.cmd:disabled {
  color: var(--text-dis);
}
.cmd.on {
  background: var(--subtle-sel);
}
.cmd-view-ic {
  display: flex;
}
.cmd-sep {
  width: 1px;
  height: 24px;
  background: var(--divider);
  margin: 0 6px;
  flex: none;
}
.cmd-spacer {
  flex: 1;
}
@container (max-width: 820px) {
  .cmd > span:not([class]) {
    display: none;
  }
  .cmd {
    padding: 0 8px;
    gap: 4px;
  }
}
@container (max-width: 560px) {
  .ex-cmd [data-act='cut'],
  .ex-cmd [data-act='paste'],
  .ex-cmd [data-act='rename'],
  .ex-cmd [data-act='delete'],
  .ex-cmd [data-act='new'],
  .ex-cmd .cmd-sep:first-of-type {
    display: none;
  }
  .ex-search {
    width: 36%;
  }
}

.ex-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--nav-w, 210px) 1px minmax(0, 1fr) auto;
  background: var(--layer-2);
  position: relative;
}
.ex-nav {
  overflow: auto;
  padding: 6px 4px 12px;
  background: var(--layer-2);
}
.nv {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 calc(4px + var(--lvl) * 16px);
  border-radius: 4px;
  position: relative;
  white-space: nowrap;
  outline: none;
}
.nv:hover {
  background: var(--hover-strong);
}
.nv.active {
  background: var(--subtle-sel);
}
.nv.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.nv-chev {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  color: var(--text-2);
  flex: none;
}
.nv-chev:not(.none):hover {
  background: var(--hover-strong);
}
.nv-chev.none {
  visibility: hidden;
}
.nv-ic {
  display: flex;
  flex: none;
}
.nv-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nv-sep {
  height: 1px;
  background: var(--divider);
  margin: 6px 8px;
}
.ex-split {
  background: var(--divider);
  cursor: col-resize;
  position: relative;
}
.ex-split::after {
  content: '';
  position: absolute;
  inset: 0 -3px;
}
.ex-content {
  overflow: auto;
  position: relative;
  outline: none;
  min-width: 0;
}
.ex-items {
  position: relative;
  padding: 4px 10px 24px;
  min-height: 100%;
}
.ex-details {
  width: 0;
  overflow: hidden;
}
.pane-on .ex-details {
  width: clamp(240px, 28cqw, 320px);
  overflow: auto;
  border-left: 1px solid var(--divider);
  padding: 16px 16px 24px;
}
.ex-nav-backdrop {
  display: none;
}
.ex-status {
  height: 26px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 8px 0 14px;
  font-size: 12px;
  background: var(--layer);
}
.st-spacer {
  flex: 1;
}
.st-view {
  width: 26px;
  height: 22px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  display: grid;
  place-items: center;
  margin-left: -14px;
}
.st-view:hover {
  background: var(--hover-strong);
}
.st-view.on {
  background: var(--subtle-sel);
}

/* Mục trong thư mục */
.it {
  position: relative;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  min-width: 0;
}
.it:hover {
  background: var(--sel-hover);
}
.it.sel {
  background: var(--sel-bg);
}
.it.focus {
  border-color: var(--sel-border);
}
.nm {
  font-size: 12px;
  line-height: 16px;
  word-break: break-word;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.it.sel .nm {
  -webkit-line-clamp: 5;
}
.ex-list.layout-xl,
.ex-list.layout-l,
.ex-list.layout-m {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--cell));
  gap: 2px;
  justify-content: start;
}
.layout-xl {
  --cell: 228px;
}
.layout-l {
  --cell: 120px;
}
.layout-m {
  --cell: 84px;
}
.it-xl,
.it-l,
.it-m {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 4px;
}
.it-ic {
  width: var(--s, 48px);
  height: var(--s, 48px);
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
}
.it-ic > .ci,
.it-ic > .peek {
  width: 100%;
  height: 100%;
}
.it-ic img.thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.2);
  background: #fff;
}
.peek {
  position: relative;
  display: block;
  flex: none;
}
.peek > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.peek > img {
  position: absolute;
  left: 17%;
  top: 20%;
  width: 66%;
  height: 50%;
  object-fit: cover;
  border-radius: 2px;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.ex-list.layout-s,
.ex-list.layout-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0 6px;
}
.it-s,
.it-list {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 6px;
}
.ic16 {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: none;
}
.ic16 > .ci,
.ic16 > .peek {
  width: 16px;
  height: 16px;
}
.it-s .nm,
.it-list .nm,
.c-name .nm,
.tl-text .nm {
  display: block;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-list.layout-details {
  display: block;
}
.dt-head,
.it-details {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
}
.dt-head {
  height: 32px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--layer-2);
  margin-bottom: 2px;
}
.dt-head button {
  height: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-2);
  border-right: 1px solid transparent;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.dt-head:hover button {
  border-right-color: var(--divider);
}
.dt-head button[data-sort]:hover {
  background: var(--hover);
}
.dt-head .c-size {
  justify-content: flex-end;
}
.it-details {
  height: 30px;
}
.c {
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.c-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.c-size {
  text-align: right;
}
.ex-list.layout-tiles,
.ex-list.layout-qa {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2px 4px;
}
.layout-qa {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  margin-bottom: 8px;
}
.it-tiles,
.it-qa {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}
.it-tiles .it-ic,
.it-qa .it-ic {
  --s: 48px;
}
.tl-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.sub {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-list.layout-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
}
.layout-gallery::after {
  content: '';
  flex-grow: 1000000;
}
.it-gallery {
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: var(--card);
  max-height: 260px;
}
.it-gallery i {
  display: block;
}
.it-gallery img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}
.it-gallery:hover img {
  transform: scale(1.03);
}
.it-gallery.sel {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.ex-sec {
  margin-bottom: 4px;
}
.ex-sec-h {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 4px;
}
.ex-sec-h:hover {
  background: var(--hover);
}
.ex-sec-count {
  font-weight: 400;
  color: var(--text-3);
  font-size: 12px;
}
.ex-empty {
  text-align: center;
  color: var(--text-2);
  padding: 32px 16px;
  font-size: 12px;
}
.ex-proj-card {
  display: none;
}

/* Ngăn chi tiết */
.dp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  min-width: 0;
}
.dp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-preview {
  display: grid;
  place-items: center;
  min-height: 140px;
  margin-bottom: 10px;
}
.dp-preview.img img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--stroke-2), 0 2px 8px rgba(0, 0, 0, 0.12);
}
.dp-text {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  margin: 0;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--stroke-2);
  border-radius: 6px;
  font: 11px/1.45 Consolas, 'Cascadia Mono', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.dp-type {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.ex-details h4,
.ph-info h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 18px 0 8px;
}
.dp-props {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 14px;
  margin: 0;
  font-size: 12px;
}
.dp-props dt {
  color: var(--text-2);
}
.dp-props dd {
  margin: 0;
  word-break: break-word;
}
.dp-dl {
  margin-top: 18px;
  width: 100%;
}
.dp-profile {
  text-align: center;
  padding-top: 12px;
}
.dp-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b9af3, #5b5fe8 55%, #a35ee8);
  color: #fff;
  display: grid;
  place-items: center;
  font: 600 32px var(--font-display);
}
.dp-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 12px 0 4px;
  word-break: break-word;
}
.dp-sub {
  color: var(--text-2);
}
.dp-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
}
.dp-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-text);
  text-decoration: none;
}
[data-theme='dark'] .dp-links a {
  color: var(--accent);
}
.dp-links a:hover {
  text-decoration: underline;
}
.dp-cover img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--stroke-2);
}
.dp-project .dp-title {
  text-align: left;
}
.dp-project.compact .dp-title {
  font-size: 16px;
  margin-top: 0;
}
.dp-desc {
  font-size: 13px;
  line-height: 1.55;
  margin: 6px 0 12px;
}
.dp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}
.tag {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--subtle-sel);
}
.dp-none,
.dp-multi {
  text-align: center;
  color: var(--text-2);
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.dp-stack {
  display: flex;
}
.dp-stack span + span {
  margin-left: -36px;
}
.dp-multi .dp-title {
  color: var(--text);
}

/* Explorer trên điện thoại */
@media (max-width: 699px) {
  .ex-hamb {
    display: inline-grid;
  }
  .ex-addr [data-act='forward'],
  .ex-addr [data-act='refresh'],
  .ex-cmd,
  .ex-split,
  .ex-details,
  .ex-newtab,
  .ex-status .st-view {
    display: none !important;
  }
  .ex-main {
    display: flex;
  }
  .ex-content {
    flex: 1;
  }
  .ex-nav {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    z-index: 6;
    transform: translateX(-102%);
    transition: transform 0.2s;
    background: var(--layer);
  }
  .ex.nav-open .ex-nav {
    transform: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }
  .ex.nav-open .ex-nav-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(0, 0, 0, 0.3);
  }
  .nv {
    height: 40px;
  }
  .ex-search {
    width: 38%;
  }
  .ex-proj-card {
    display: block;
    margin: 8px 0 14px;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 8px;
  }
  .ex-proj-card .dp-profile {
    padding-top: 4px;
  }
  .ex-proj-card .dp-avatar {
    width: 64px;
    height: 64px;
    font-size: 22px;
  }
  .ex-proj-card .dp-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
  }
  .ex-proj-card .dp-props {
    grid-template-columns: auto 1fr;
  }
  .layout-l {
    --cell: calc((100% - 6px) / 3);
  }
  .layout-xl {
    --cell: calc((100% - 2px) / 2);
  }
  .layout-xl .it-ic,
  .layout-l .it-ic {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
  .ex-list.layout-tiles,
  .ex-list.layout-qa {
    grid-template-columns: 1fr !important;
  }
  .c-modified,
  .c-type,
  .c-dims,
  .c-location {
    display: none;
  }
  .ex-list.layout-details {
    --cols: minmax(0, 1fr) 80px !important;
  }
  .ex-list.layout-details .dt-head button.c-modified,
  .ex-list.layout-details .dt-head button.c-type,
  .ex-list.layout-details .dt-head button.c-dims,
  .ex-list.layout-details .dt-head button.c-location {
    display: none;
  }
  .ex-tab {
    flex-basis: 100%;
  }
}

/* ---------- Ảnh ---------- */
.ph {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win-bg);
}
.ph-bar {
  height: 48px;
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 8px;
}
.ph-left {
  min-width: 0;
}
.ph-count {
  font-size: 12px;
  color: var(--text-2);
  padding-left: 8px;
}
.ph-center,
.ph-right {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ph-right {
  justify-self: end;
}
.ph-zoom {
  min-width: 58px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 12px;
}
.ph-zoom:hover {
  background: var(--hover-strong);
}
.ph-mid {
  flex: 1;
  min-height: 0;
  display: flex;
}
.ph-stage {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  touch-action: none;
  background: var(--layer-2);
}
[data-theme='dark'] .ph-stage {
  background: #161616;
}
.ph-stage.pannable {
  cursor: grab;
}
.ph-stage.pannable:active {
  cursor: grabbing;
}
.ph-img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.12);
}
.ph-img:not([src]) {
  visibility: hidden;
}
.ph-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  color: var(--accent);
}
.ph-spin i {
  position: absolute;
  inset: 0;
  animation: orbit 5.5s infinite;
  opacity: 0;
}
.ph-spin i::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  left: calc(50% - 2.5px);
}
.ph-spin i:nth-child(2) {
  animation-delay: 0.24s;
}
.ph-spin i:nth-child(3) {
  animation-delay: 0.48s;
}
.ph-spin i:nth-child(4) {
  animation-delay: 0.72s;
}
.ph-spin i:nth-child(5) {
  animation-delay: 0.96s;
}
.ph-nav {
  position: absolute;
  top: 50%;
  width: 36px;
  height: 64px;
  margin-top: -32px;
  border-radius: 6px;
  border: 1px solid var(--stroke-2);
  background: var(--flyout-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.ph-nav.prev {
  left: 12px;
}
.ph-nav.next {
  right: 12px;
}
.ph-stage:hover .ph-nav {
  opacity: 1;
}
@media (pointer: coarse) {
  .ph-nav {
    opacity: 0.85;
  }
}
.ph.single .ph-nav,
.ph.single .ph-count {
  display: none;
}
.ph-info {
  width: 0;
  overflow: hidden;
  flex: none;
}
.ph.info-on .ph-info {
  width: 300px;
  overflow: auto;
  padding: 14px 16px;
  background: var(--layer);
  border-left: 1px solid var(--divider);
}
.ph-info-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.ph-info-name {
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 12px;
}
.ph-info-proj {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ph-info-proj span {
  color: var(--text-2);
  font-size: 12px;
}
.ph-info-proj p {
  margin: 6px 0 0;
  line-height: 1.55;
  color: var(--text-2);
}
.ph-film {
  height: 88px;
  flex: none;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--divider);
  background: var(--win-bg);
}
.ph.film-off .ph-film,
.ph.single .ph-film {
  display: none;
}
.ph-film-track {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding: 0 12px;
  max-width: 100%;
}
.ph-th {
  flex: none;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
  opacity: 0.75;
}
.ph-th:hover {
  opacity: 1;
}
.ph-th.on {
  border-color: var(--accent);
  opacity: 1;
}
.ph-th img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 699px) {
  .ph-bar {
    grid-template-columns: auto 1fr auto;
  }
  .ph-center {
    justify-content: center;
  }
  .ph-center [data-act='zoomOut'],
  .ph-center [data-act='zoomIn'],
  .ph-center .cmd-sep {
    display: none;
  }
  .ph.info-on .ph-info {
    position: absolute;
    right: 0;
    top: 48px;
    bottom: 0;
    width: 85%;
    z-index: 3;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
  }
  .ph-film {
    height: 64px;
  }
  .ph-th {
    width: 48px;
    height: 48px;
  }
}

/* ---------- Notepad ---------- */
.np {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--layer-2);
}
.np-menubar {
  display: flex;
  gap: 2px;
  padding: 4px 6px;
  background: var(--layer);
  flex: none;
}
.np-mb {
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 4px;
  background: transparent;
}
.np-mb:hover,
.np-mb.open {
  background: var(--hover-strong);
}
.np-find {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--layer);
  border-top: 1px solid var(--divider);
  flex: none;
}
.np-find input {
  flex: 0 1 280px;
  height: 30px;
  padding: 0 10px;
  background: var(--control);
  border: 1px solid var(--stroke-2);
  border-radius: 4px;
}
.np-find input:focus {
  border-bottom: 2px solid var(--accent);
}
.np-text {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 0;
  border-top: 1px solid var(--divider);
  outline: none;
  padding: 10px 14px;
  background: var(--layer-2);
  color: var(--text);
  font-family: Consolas, 'Cascadia Mono', 'Courier New', monospace;
  line-height: 1.45;
  tab-size: 4;
}
.np-status {
  height: 26px;
  flex: none;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-2);
  background: var(--layer);
  border-top: 1px solid var(--divider);
  white-space: nowrap;
  overflow: hidden;
}
.np-status span {
  padding: 0 14px;
  border-left: 1px solid var(--divider);
}
.np-status span:first-child {
  border-left: 0;
  min-width: 140px;
}
.np-count {
  margin-right: auto;
}
.np-count + span {
  border-left: 1px solid var(--divider);
}
@media (max-width: 699px) {
  .np-status span:nth-child(n + 4) {
    display: none;
  }
}

/* ---------- PDF ---------- */
.pdf {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pdf-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--layer);
  flex: none;
}
.pdf-addr {
  flex: 1;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 15px;
  background: var(--control);
  border: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--text-2);
}
.pdf-addr span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #525659;
}
.pdf-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background: var(--layer-2);
}
.pdf-name {
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
  word-break: break-word;
}
.pdf-size {
  color: var(--text-2);
}
.pdf-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ---------- Thuộc tính ---------- */
.pp {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 6px 14px 14px;
  font-size: 12px;
  background: var(--layer);
}
.pp-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
  flex: none;
}
.pp-tab {
  height: 32px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.pp-tab.on {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.pp-page {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.pp-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0 6px;
}
.pp-ic {
  width: 40px;
  display: grid;
  place-items: center;
}
.pp-name {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--stroke-2);
  border-radius: 4px;
  background: var(--control);
  font-size: 12px;
  outline: none;
}
.pp-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 0;
  align-items: center;
}
.pp-k {
  color: var(--text-2);
}
.pp-v {
  word-break: break-word;
}
.pp-sep {
  height: 1px;
  background: var(--divider);
  margin: 8px 0;
}
.pp-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pp-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
}
.pp-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  flex: none;
}
.pp-btns .btn {
  min-width: 80px;
}

/* ---------- Cài đặt / Cá nhân hóa ---------- */
.st {
  padding: 24px 32px 32px;
  overflow: auto;
  height: 100%;
  background: var(--win-bg);
}
.st h2 {
  font: 600 28px var(--font-display);
  margin: 0 0 20px;
}
.st-preview {
  position: relative;
  height: 190px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 0 0 1px var(--stroke-2);
}
.st-preview-bg {
  position: absolute;
  inset: 0;
  background-size: cover !important;
}
.st-preview-win {
  position: absolute;
  left: 18%;
  top: 18%;
  width: 46%;
  height: 58%;
  background: var(--layer);
  border-radius: 6px;
  box-shadow: var(--shadow-win);
}
.st-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 8px;
}
.st-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.st-row > div {
  flex: 1;
}
.st-row b {
  font-weight: 400;
  font-size: 14px;
}
.st-walls {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.st-photos:empty {
  display: none;
}
.st-wall {
  width: 76px;
  height: 52px;
  border-radius: 6px;
  border: 2px solid transparent;
  padding: 0;
  background-size: cover !important;
  outline: 1px solid var(--stroke-2);
}
.st-wall.on {
  border-color: var(--accent);
}
.st-theme {
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--stroke-2);
  background: var(--control);
  padding: 0 8px;
  min-width: 150px;
}
