/* ===== Windows 11 — phần hệ thống: màu, desktop, cửa sổ, taskbar, Start, menu ===== */

:root {
  --font: 'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Segoe UI Variable Display', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --tb-h: 48px;

  --accent: #005fb8;
  --accent-hover: #196ebf;
  --accent-text: #003e92;
  --on-accent: #fff;
  --text: #1a1a1a;
  --text-2: #5d5d5d;
  --text-3: #8b8b8b;
  --text-dis: rgba(0, 0, 0, 0.36);
  --win-bg: #f3f3f3;
  --chrome: #eaeef3;
  --layer: #f9f9f9;
  --layer-2: #ffffff;
  --card: #fbfbfb;
  --stroke: rgba(0, 0, 0, 0.06);
  --stroke-2: rgba(0, 0, 0, 0.1);
  --divider: rgba(0, 0, 0, 0.08);
  --hover: rgba(0, 0, 0, 0.037);
  --hover-strong: rgba(0, 0, 0, 0.06);
  --subtle-sel: rgba(0, 0, 0, 0.06);
  --sel-bg: #cce8ff;
  --sel-hover: #e5f3ff;
  --sel-border: #99d1ff;
  --control: #ffffff;
  --control-hover: #f9f9f9;
  --menu-bg: rgba(249, 249, 249, 0.86);
  --flyout-bg: rgba(243, 243, 243, 0.88);
  --taskbar: rgba(238, 241, 245, 0.8);
  --tb-hover: rgba(255, 255, 255, 0.6);
  --tb-active: rgba(255, 255, 255, 0.75);
  --shadow-win: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 32px 64px rgba(0, 0, 0, 0.18), 0 2px 21px rgba(0, 0, 0, 0.12);
  --shadow-win-inactive: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 16px 32px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-flyout: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.16);
  color-scheme: light;
}

[data-theme='dark'] {
  --accent: #60cdff;
  --accent-hover: #5ab9e6;
  --accent-text: #99ebff;
  --on-accent: #000;
  --text: #ffffff;
  --text-2: #c8c8c8;
  --text-3: #9d9d9d;
  --text-dis: rgba(255, 255, 255, 0.36);
  --win-bg: #202020;
  --chrome: #1c1c1c;
  --layer: #272727;
  --layer-2: #1c1c1c;
  --card: #2b2b2b;
  --stroke: rgba(255, 255, 255, 0.06);
  --stroke-2: rgba(255, 255, 255, 0.1);
  --divider: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.05);
  --hover-strong: rgba(255, 255, 255, 0.08);
  --subtle-sel: rgba(255, 255, 255, 0.08);
  --sel-bg: #31465a;
  --sel-hover: #2a2f35;
  --sel-border: #4a7aa3;
  --control: rgba(255, 255, 255, 0.06);
  --control-hover: rgba(255, 255, 255, 0.08);
  --menu-bg: rgba(44, 44, 44, 0.9);
  --flyout-bg: rgba(36, 36, 36, 0.9);
  --taskbar: rgba(28, 28, 28, 0.82);
  --tb-hover: rgba(255, 255, 255, 0.07);
  --tb-active: rgba(255, 255, 255, 0.1);
  --shadow-win: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 32px 64px rgba(0, 0, 0, 0.5), 0 2px 21px rgba(0, 0, 0, 0.4);
  --shadow-win-inactive: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 16px 32px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-flyout: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: default;
}
input,
textarea,
.dp-desc,
.ph-info-proj p,
.pp-v {
  user-select: text;
  -webkit-user-select: text;
}
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
  border-radius: 4px;
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.55) transparent;
}
[hidden] {
  display: none !important;
}
.ci,
.ic {
  display: block;
  flex: none;
}

/* ---------- Nút chung ---------- */
.btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid var(--stroke-2);
  border-bottom-color: rgba(0, 0, 0, 0.16);
  background: var(--control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}
[data-theme='dark'] .btn {
  border-color: rgba(255, 255, 255, 0.08);
  border-top-color: rgba(255, 255, 255, 0.1);
}
.btn:hover {
  background: var(--control-hover);
}
.btn:active {
  opacity: 0.8;
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}
.btn.primary:hover {
  background: var(--accent-hover);
}
.btn:disabled {
  color: var(--text-dis);
  background: var(--control);
}
.tb-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  flex: none;
  text-decoration: none;
}
.tb-btn:hover:not(:disabled) {
  background: var(--hover-strong);
}
.tb-btn:disabled {
  color: var(--text-dis);
}
.tb-btn.on {
  background: var(--subtle-sel);
}

/* ---------- Desktop ---------- */
#wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  transition: background 0.4s;
}
.desktop {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: var(--tb-h);
  z-index: 1;
}
#windows {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#windows > * {
  pointer-events: auto;
}
.desk-icons {
  position: absolute;
  inset: 0;
  padding: 6px 4px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, var(--cell-h));
  grid-auto-columns: var(--cell-w);
  gap: 4px 2px;
  align-content: start;
  --cell-w: 80px;
  --cell-h: 92px;
  --ics: 48px;
}
.desk-icons.size-l {
  --cell-w: 116px;
  --cell-h: 140px;
  --ics: 96px;
}
.desk-icons.size-s {
  --cell-w: 76px;
  --cell-h: 74px;
  --ics: 32px;
}
.desk-icons.hidden-icons .dk {
  visibility: hidden;
}
.dk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 6px rgba(0, 0, 0, 0.35);
  min-height: 0;
  overflow: hidden;
  outline: none;
}
.dk:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}
.dk.sel {
  background: rgba(150, 200, 255, 0.36);
  border-color: rgba(170, 215, 255, 0.6);
  overflow: visible;
  z-index: 2;
}
.dk.focus {
  border-color: rgba(255, 255, 255, 0.8);
}
.dk-ic {
  width: var(--ics);
  height: var(--ics);
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
}
.dk-ic .ci,
.dk-ic .peek {
  width: var(--ics);
  height: var(--ics);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
.dk-ic img.thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.dk-arrow {
  position: absolute;
  left: 2px;
  bottom: 2px;
}
.dk-name {
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}
.dk.sel .dk-name {
  -webkit-line-clamp: 6;
}
.rubber {
  position: absolute;
  border: 1px solid #0078d4;
  background: rgba(0, 120, 212, 0.22);
  pointer-events: none;
  z-index: 50;
}
.desk-rubber {
  z-index: 0;
}

/* ---------- Cửa sổ ---------- */
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--win-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-win-inactive);
  overflow: hidden;
  min-width: 0;
  color: var(--text);
  contain: layout;
}
.win.active {
  box-shadow: var(--shadow-win);
}
.win.max {
  border-radius: 0;
  box-shadow: none;
}
.win.snapped {
  border-radius: 0;
}
.win.min {
  display: none;
}
.win.flash {
  animation: flash 0.12s 3 alternate;
}
@keyframes flash {
  to {
    box-shadow: 0 0 0 1px var(--accent), 0 32px 64px rgba(0, 0, 0, 0.25);
  }
}
.win:fullscreen {
  border-radius: 0;
}
.win:fullscreen .win-tb {
  display: none;
}
.win-tb {
  height: 32px;
  flex: none;
  display: flex;
  align-items: stretch;
  background: var(--chrome);
  touch-action: none;
}
.win[data-app='explorer'] .win-tb,
.win[data-app='notepad'] .win-tb {
  height: 42px;
}
.win:not(.active) .win-tb {
  color: var(--text-3);
}
.win-tb-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
}
.win-title {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-ctl {
  display: flex;
  flex: none;
}
.wc {
  width: 46px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  color: inherit;
}
.win.active .wc {
  color: var(--text);
}
.wc:hover {
  background: var(--hover-strong);
}
.wc-close:hover {
  background: #c42b1c;
  color: #fff !important;
}
.win-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--layer);
}
.win-body > * {
  flex: 1;
  min-height: 0;
}
.rz {
  position: absolute;
  z-index: 5;
}
.win.max .rz {
  display: none;
}
.rz-n,
.rz-s {
  left: 8px;
  right: 8px;
  height: 6px;
  cursor: ns-resize;
}
.rz-n {
  top: -2px;
}
.rz-s {
  bottom: -2px;
}
.rz-e,
.rz-w {
  top: 8px;
  bottom: 8px;
  width: 6px;
  cursor: ew-resize;
}
.rz-e {
  right: -2px;
}
.rz-w {
  left: -2px;
}
.rz-ne,
.rz-nw,
.rz-se,
.rz-sw {
  width: 12px;
  height: 12px;
}
.rz-ne {
  top: -2px;
  right: -2px;
  cursor: nesw-resize;
}
.rz-sw {
  bottom: -2px;
  left: -2px;
  cursor: nesw-resize;
}
.rz-nw {
  top: -2px;
  left: -2px;
  cursor: nwse-resize;
}
.rz-se {
  bottom: -2px;
  right: -2px;
  cursor: nwse-resize;
}
.modal-shield {
  position: absolute;
  inset: 0;
}
body.dragging,
body.dragging * {
  user-select: none !important;
}
body.dragging iframe {
  pointer-events: none;
}
#snap-preview {
  position: absolute;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, left 0.15s, top 0.15s, width 0.15s, height 0.15s;
  z-index: 99999;
}
#snap-preview.show {
  opacity: 1;
}

/* ---------- Hộp thoại thông báo ---------- */
.msgbox {
  display: flex;
  flex-direction: column;
  background: var(--layer);
}
.msgbox-main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 24px 24px;
}
.msgbox-text {
  font-size: 13px;
  line-height: 1.5;
  padding-top: 6px;
  user-select: text;
}
.msgbox-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  background: var(--win-bg);
  border-top: 1px solid var(--divider);
}
.msgbox-btns .btn {
  min-width: 96px;
}

/* ---------- Taskbar ---------- */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tb-h);
  z-index: 2;
  background: var(--taskbar);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border-top: 1px solid var(--stroke-2);
  display: flex;
  align-items: center;
}
.tb-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}
.tb-apps {
  display: flex;
  gap: 4px;
}
.tb-app {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--text);
  transition: background 0.1s;
}
.tb-app:hover {
  background: var(--tb-hover);
}
.tb-app.active,
.tb-app.open {
  background: var(--tb-active);
}
.tb-app:active .ci,
.tb-app:active .tb-start-logo {
  transform: scale(0.88);
}
.tb-app .ci,
.tb-start-logo {
  transition: transform 0.1s;
}
.tb-ind {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--text-3);
  transform: translateX(-50%);
  opacity: 0;
  transition: width 0.2s, background 0.2s;
}
.tb-app.running .tb-ind {
  opacity: 1;
}
.tb-app.active .tb-ind {
  width: 16px;
  background: var(--accent);
}
.tb-start-logo {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}
.tb-tray {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 8px;
}
.tb-tray-ic {
  display: flex;
  gap: 10px;
  padding: 0 10px;
  height: 40px;
  align-items: center;
  border-radius: 4px;
}
.tb-clock {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  height: 40px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.35;
}
.tb-bell {
  border: 0;
  background: transparent;
  height: 40px;
  width: 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.tb-clock:hover,
.tb-bell:hover,
.tb-tray-ic:hover {
  background: var(--tb-hover);
}
.tb-showdesk {
  width: 10px;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--stroke-2);
  background: transparent;
  margin-left: 6px;
}
.tb-showdesk:hover {
  background: var(--tb-hover);
}

/* ---------- Flyout: Start, lịch ---------- */
.flyout {
  position: fixed;
  bottom: calc(var(--tb-h) + 12px);
  background: var(--flyout-bg);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  box-shadow: var(--shadow-flyout);
  z-index: 50;
  color: var(--text);
}
.start {
  --sw: min(640px, calc(100vw - 16px));
  width: var(--sw);
  left: calc(50% - var(--sw) / 2);
  height: min(720px, calc(100vh - var(--tb-h) - 24px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sm-search {
  margin: 28px 32px 8px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--control);
  border: 1px solid var(--stroke-2);
  border-bottom: 2px solid var(--accent);
  color: var(--text-2);
}
.sm-search input,
.ex-search input,
.np-find input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  height: 100%;
  color: var(--text);
}
input[type='search']::-webkit-search-cancel-button {
  display: none;
}
.sm-body,
.sm-results {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 32px 16px;
}
.sm-sec-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 36px;
  font-size: 14px;
  padding: 0 4px;
}
.sm-pinned {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.sm-pin {
  border: 0;
  background: transparent;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 4px 10px;
  min-width: 0;
}
.sm-pin:hover,
.sm-rec:hover,
.sm-res:hover,
.sm-res.on,
.sm-user:hover {
  background: var(--hover-strong);
}
.sm-pin-name {
  font-size: 12px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-recent {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.sm-rec,
.sm-res {
  border: 0;
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  text-align: left;
  min-width: 0;
  width: 100%;
}
.sm-rec span:last-child,
.sm-res span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sm-rec b,
.sm-res b {
  font-weight: 400;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-rec small,
.sm-res small {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-empty {
  color: var(--text-2);
  padding: 8px 4px;
}
.sm-results:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.sm-res-h {
  font-weight: 600;
  font-size: 13px;
  padding: 12px 12px 6px;
}
.sm-best {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  align-self: start;
}
.sm-best b {
  font-size: 16px;
  font-weight: 600;
  word-break: break-word;
}
.sm-best small {
  color: var(--text-2);
  margin-bottom: 12px;
  word-break: break-word;
}
.sm-best-ic {
  min-height: 96px;
  display: grid;
  place-items: center;
}
.sm-best-ic img.thumb {
  max-width: 200px;
  max-height: 140px;
  border-radius: 4px;
}
.sm-foot {
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(0, 0, 0, 0.03);
  border-top: 1px solid var(--divider);
}
[data-theme='dark'] .sm-foot {
  background: rgba(0, 0, 0, 0.15);
}
.sm-user {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 4px;
}
.sm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b9af3, #a35ee8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.calendar {
  right: 12px;
  width: 334px;
  padding: 0 0 12px;
}
.cal-head {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--divider);
  text-transform: capitalize;
}
.cal-nav {
  display: flex;
  align-items: center;
  padding: 10px 12px 4px 18px;
  font-weight: 600;
  text-transform: capitalize;
}
.cal-nav span {
  flex: 1;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 12px;
  gap: 2px;
  text-align: center;
}
.cal-grid b {
  font-weight: 600;
  font-size: 12px;
  padding: 8px 0;
}
.cal-grid span {
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
}
.cal-grid span.today {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* ---------- Menu ngữ cảnh ---------- */
.menu {
  position: fixed;
  z-index: 100;
  min-width: 220px;
  max-width: 340px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  padding: 4px;
  background: var(--menu-bg);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  box-shadow: var(--shadow-flyout);
  color: var(--text);
  outline: none;
  font-size: 13px;
}
.menu.from-top {
  animation: menu-in-top 0.18s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.menu.from-bottom {
  animation: menu-in-bottom 0.18s cubic-bezier(0.1, 0.9, 0.2, 1);
}
@keyframes menu-in-top {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes menu-in-bottom {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.menu-item {
  width: 100%;
  min-height: 32px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 0 12px;
  text-align: left;
  outline: none;
}
.menu-item:hover:not(:disabled),
.menu-item:focus-visible,
.menu-item:focus:not(:disabled) {
  background: var(--hover-strong);
}
.menu-item:disabled {
  color: var(--text-dis);
}
.mi-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: none;
}
.mi-icon .ci {
  width: 16px;
  height: 16px;
}
.mi-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mi-kbd {
  color: var(--text-3);
  font-size: 12px;
  margin-left: 16px;
  white-space: nowrap;
}
.mi-kbd:empty {
  display: none;
}
.mi-sub {
  color: var(--text-2);
  margin-left: 4px;
}
.menu-sep {
  height: 1px;
  background: var(--divider);
  margin: 4px -4px;
}
.menu-bar {
  display: flex;
  justify-content: space-between;
  padding: 2px 2px 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--divider);
}
.menu-bar-btn {
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: grid;
  place-items: center;
}
.menu-bar-btn:hover:not(:disabled),
.menu-bar-btn:focus:not(:disabled) {
  background: var(--hover-strong);
  outline: none;
}
.menu-bar-btn:disabled {
  color: var(--text-dis);
}

/* ---------- Thông báo ---------- */
.toasts {
  position: fixed;
  right: 12px;
  bottom: calc(var(--tb-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  padding: 14px 18px;
  background: var(--flyout-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  box-shadow: var(--shadow-flyout);
  animation: toast-in 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  transition: opacity 0.25s, transform 0.25s;
}
.toast .ic {
  color: var(--accent);
}
.toast.out {
  opacity: 0;
  transform: translateX(30px);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
}

/* ---------- Màn hình khóa, khởi động, tắt máy ---------- */
#layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
#layer > * {
  pointer-events: auto;
}
.lockscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  color: #fff;
  outline: none;
  transition: opacity 0.35s;
  cursor: default;
}
.lockscreen.out {
  opacity: 0;
}
.lk-bg {
  position: absolute;
  inset: -40px;
  background-size: cover !important;
  transition: filter 0.4s, transform 0.4s;
}
.lockscreen.login .lk-bg {
  filter: blur(28px) brightness(0.75);
  transform: scale(1.06);
}
.lk-clock {
  position: absolute;
  top: 12vh;
  left: 0;
  right: 0;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s, transform 0.3s;
}
.lk-time {
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 104px);
  font-weight: 600;
  line-height: 1.1;
}
.lk-date {
  font-size: clamp(18px, 2.4vw, 24px);
  text-transform: capitalize;
}
.lk-hint {
  position: absolute;
  bottom: 9vh;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  opacity: 0.85;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  animation: hint 2.4s ease-in-out infinite;
}
@keyframes hint {
  50% {
    transform: translateY(-6px);
  }
}
.lockscreen.login .lk-clock,
.lockscreen.login .lk-hint {
  opacity: 0;
  transform: translateY(-40px);
  pointer-events: none;
}
.lk-login {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s 0.1s;
}
.lockscreen.login .lk-login {
  opacity: 1;
  pointer-events: auto;
}
.lk-avatar {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b9af3, #5b5fe8 55%, #a35ee8);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.lk-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-top: 8px;
}
.lk-role {
  opacity: 0.85;
  font-size: 14px;
  margin-bottom: 16px;
}
.lk-btn {
  min-width: 180px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 14px;
  backdrop-filter: blur(10px);
}
.lk-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}
.lk-tray {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 16px;
}
.blackout,
.boot {
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 18px;
  outline: none;
}
.boot {
  z-index: 3000;
}
.power-on {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
}
.power-on:hover {
  background: rgba(255, 255, 255, 0.1);
}
.po-hint {
  font-size: 14px;
  opacity: 0.7;
}
.spinner {
  position: relative;
  width: 44px;
  height: 44px;
}
.spinner i {
  position: absolute;
  inset: 0;
  animation: orbit 5.5s infinite;
  opacity: 0;
}
.spinner i::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  left: calc(50% - 2.5px);
  top: 0;
}
.spinner i:nth-child(2) {
  animation-delay: 0.24s;
}
.spinner i:nth-child(3) {
  animation-delay: 0.48s;
}
.spinner i:nth-child(4) {
  animation-delay: 0.72s;
}
.spinner i:nth-child(5) {
  animation-delay: 0.96s;
}
@keyframes orbit {
  0% {
    transform: rotate(225deg);
    opacity: 1;
    animation-timing-function: ease-out;
  }
  7% {
    transform: rotate(345deg);
    animation-timing-function: linear;
  }
  30% {
    transform: rotate(455deg);
    animation-timing-function: ease-in-out;
  }
  39% {
    transform: rotate(690deg);
    animation-timing-function: linear;
  }
  70% {
    transform: rotate(815deg);
    opacity: 1;
    animation-timing-function: ease-out;
  }
  75% {
    transform: rotate(945deg);
    animation-timing-function: ease-out;
  }
  76%,
  100% {
    transform: rotate(945deg);
    opacity: 0;
  }
}

/* ---------- Điện thoại ---------- */
@media (max-width: 699px) {
  :root {
    --tb-h: 52px;
  }
  .tb-tray-ic,
  .tb-date,
  .tb-bell,
  .tb-showdesk {
    display: none;
  }
  .tb-center {
    left: 8px;
    transform: none;
  }
  .tb-clock {
    font-size: 13px;
  }
  .win {
    border-radius: 0;
  }
  .win-tb {
    height: 44px !important;
  }
  .wc {
    width: 44px;
  }
  .wc-max {
    display: none;
  }
  .win.dialog {
    border-radius: 8px;
    max-width: calc(100vw - 16px);
    left: 8px !important;
    width: calc(100vw - 16px) !important;
  }
  .sm-search {
    margin: 20px 16px 8px;
  }
  .sm-body,
  .sm-results {
    padding: 8px 12px 12px;
  }
  .sm-pinned {
    grid-template-columns: repeat(4, 1fr);
  }
  .sm-recent,
  .sm-results:not([hidden]) {
    grid-template-columns: 1fr;
  }
  .sm-best {
    display: none;
  }
  .sm-foot {
    padding: 0 16px;
  }
  .calendar {
    right: 8px;
    left: 8px;
    width: auto;
  }
  .desk-icons {
    --cell-w: 84px;
    --cell-h: 96px;
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, var(--cell-w));
    grid-template-rows: none;
    grid-auto-rows: var(--cell-h);
    justify-content: start;
  }
}

/* Ảnh đại diện */
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
