.os-sim,
.os-window {
  color: #182230;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.os-sim {
  width: min(100%, 1040px);
  min-height: 390px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #cbd3dd;
  border-radius: 8px;
  background: #e9edf2;
  box-shadow: 0 10px 30px rgb(21 37 58 / 12%);
}

.os-window {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-radius: 7px;
  background: #fff;
}

.os-titlebar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px 6px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #dce2e9;
  font-size: 0.92rem;
}

.os-titlebar__title {
  font-weight: 700;
}

.os-window-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #475467;
}

.os-window-controls span {
  display: grid;
  width: 34px;
  height: 30px;
  place-items: center;
}

.os-explorer-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid #e1e6ed;
}

.os-control-button,
.os-tray-button,
.os-item-menu-button,
.os-quick-access button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #263445;
  font: inherit;
  cursor: pointer;
}

.os-control-button {
  padding: 7px 12px;
  border-color: #d0d8e2;
  background: #fff;
}

.os-control-button:hover,
.os-tray-button:hover,
.os-quick-access button:hover {
  border-color: #a9c5e0;
  background: #edf5fc;
}

.os-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #586779;
  font-size: 0.88rem;
}

.os-breadcrumb strong {
  overflow-wrap: anywhere;
  color: #25364a;
}

.os-explorer-layout {
  display: grid;
  min-height: 285px;
  grid-template-columns: minmax(145px, 220px) minmax(0, 1fr);
}

.os-quick-access {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 10px;
  border-right: 1px solid #e1e6ed;
  background: #fbfcfd;
}

.os-quick-access strong {
  padding: 6px 10px;
  color: #536273;
  font-size: 0.79rem;
  text-transform: uppercase;
}

.os-quick-access button {
  justify-content: flex-start;
  padding-inline: 10px;
  text-align: left;
}

.os-file-grid {
  display: grid;
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  padding: 18px;
}

.os-file-item {
  position: relative;
  display: grid;
  min-height: 112px;
  align-content: start;
  justify-items: center;
  gap: 6px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}

.os-file-item:hover,
.os-file-item:focus-within,
.os-file-item[aria-grabbed="true"] {
  border-color: #b9d3ec;
  background: #f1f7fd;
}

.os-file-item[data-kind="folder"] {
  cursor: pointer;
}

.os-file-item__top {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.os-file-icon {
  display: grid;
  min-height: 54px;
  place-items: center;
  font-size: 2.5rem;
}

.os-item-menu-button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  padding: 0;
  font-size: 1.25rem;
}

.os-file-name {
  display: block;
  width: 100%;
  min-height: 24px;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.os-file-name[contenteditable="true"]:focus {
  outline: 2px solid #0067b8;
  background: #fff;
}

.os-item-menu,
.os-move-targets {
  position: absolute;
  z-index: 4;
  right: 4px;
  bottom: 4px;
  display: grid;
  min-width: 145px;
  gap: 3px;
  padding: 5px;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(20 32 48 / 18%);
}

.os-item-menu[hidden],
.os-move-targets[hidden],
.os-flyout[hidden] {
  display: none;
}

.os-item-menu button,
.os-move-targets button {
  min-height: 40px;
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #25364a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.os-item-menu button:hover,
.os-move-targets button:hover {
  background: #edf5fc;
}

.os-desktop {
  position: relative;
  display: flex;
  min-height: 390px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 65% 35%, rgb(122 185 235 / 70%), transparent 46%),
    linear-gradient(140deg, #0e477e, #0b2c54 62%, #061d39);
}

.os-desktop-icons {
  display: grid;
  width: max-content;
  gap: 10px;
  padding: 16px;
}

.os-desktop-icon {
  display: grid;
  width: 84px;
  min-height: 80px;
  justify-items: center;
  align-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.76rem;
  text-shadow: 0 1px 3px #00172d;
}

.os-desktop-icon span {
  font-size: 2rem;
}

.os-desktop-icon:hover {
  border-color: rgb(255 255 255 / 35%);
  background: rgb(255 255 255 / 13%);
}

.os-taskbar {
  position: relative;
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgb(245 248 251 / 94%);
  backdrop-filter: blur(16px);
}

.os-start-button {
  color: #0067b8;
  font-size: 1.45rem;
}

.os-clock {
  margin-left: auto;
  color: #29384a;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

.os-system-tray {
  display: flex;
  gap: 2px;
}

.os-tray-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 9px;
}

.os-flyout {
  position: absolute;
  right: 12px;
  bottom: 48px;
  z-index: 5;
  width: min(340px, calc(100vw - 40px));
  max-height: min(65vh, 420px);
  overflow: auto;
  padding: 16px;
  border: 1px solid #ccd5df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(15 31 50 / 25%);
}

.os-flyout h2 {
  margin: 0 0 12px;
  font-size: 0.98rem;
}

.os-flyout label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 4px;
  font-size: 0.86rem;
}

.os-flyout input[type="range"] {
  width: 100%;
  accent-color: #0067b8;
}

.os-network-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 7px;
  border-top: 1px solid #e7ebf0;
}

.os-hardware {
  width: min(100%, 1040px);
  margin-inline: auto;
}

.os-hardware__canvas {
  overflow-x: auto;
  padding: clamp(10px, 3vw, 24px);
  background: #e8edf3;
  -webkit-overflow-scrolling: touch;
}

.os-port-board {
  display: block;
  width: 100%;
  min-width: 570px;
  margin-inline: auto;
}

.os-port-plate {
  fill: #263342;
  stroke: #8a99a9;
  stroke-width: 10;
}

.os-port-target {
  cursor: pointer;
}

.os-port-shape {
  fill: #121923;
  stroke: #d4dbe3;
  stroke-width: 3;
  transition: stroke 140ms ease, filter 140ms ease, fill 140ms ease;
}

.os-port-shape--vga {
  fill: #1767ad;
}

.os-port-shape--hdmi {
  fill: #c79228;
}

.os-port-shape--rj45 {
  fill: #121923;
}

.os-port-shape--usb3 {
  fill: #1264a3;
}

.os-port-shape--audio {
  fill: #276d48;
}

.os-port-detail {
  fill: #d6dee7;
  stroke: #182230;
  stroke-width: 1;
  pointer-events: none;
}

.os-port-detail--slot {
  fill: #111923;
  stroke: #f1c865;
}

.os-port-detail--green {
  fill: #57ad62;
}

.os-port-detail--purple {
  fill: #8d64a8;
}

.os-port-target:hover .os-port-shape,
.os-port-target:focus .os-port-shape {
  stroke: #65b6ff;
  filter: drop-shadow(0 0 7px rgb(101 182 255 / 75%));
}

.os-port-target[aria-pressed="true"] .os-port-shape {
  stroke: #65d99b;
  stroke-width: 5;
  filter: drop-shadow(0 0 8px rgb(101 217 155 / 75%));
}

.os-port-label {
  fill: #fff;
  font: 700 13px "Segoe UI", system-ui, sans-serif;
  pointer-events: none;
}

.os-hardware__feedback {
  min-height: 48px;
  margin: 0;
  padding: 12px 16px;
  background: #fff;
  color: #263445;
  font-weight: 700;
}

@media (max-width: 640px) {
  .os-sim,
  .os-window {
    min-height: 340px;
    border-radius: 0;
  }

  .os-explorer-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .os-explorer-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .os-quick-access {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #e1e6ed;
    padding: 6px 10px;
  }

  .os-quick-access strong {
    display: none;
  }

  .os-quick-access button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .os-file-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
    padding: 12px;
  }

  .os-taskbar {
    padding-inline: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .os-port-shape {
    transition: none;
  }
}

/* Windows 11 desktop shell */
.os-desktop {
  background:
    radial-gradient(ellipse 38% 60% at 52% 46%, rgb(98 193 255 / 80%), transparent 70%),
    radial-gradient(ellipse 34% 56% at 48% 48%, rgb(47 118 230 / 86%), transparent 74%),
    linear-gradient(135deg, #071a3d 5%, #152b70 48%, #05152e 100%);
}

.os-desktop-icons { z-index: 1; }
.os-desktop-icon { color: #fff; text-shadow: 0 1px 2px #07152b; }
.os-desktop-icon span { color: #f4f8ff; filter: drop-shadow(0 2px 2px rgb(0 0 0 / 25%)); }

.os-taskbar {
  position: relative;
  z-index: 5;
  min-height: 58px;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 14px;
  border: 1px solid rgb(255 255 255 / 30%);
  background: rgb(244 246 251 / 88%);
  box-shadow: 0 -2px 12px rgb(0 0 0 / 13%);
  color: #20252b;
  backdrop-filter: blur(22px) saturate(1.4);
}

.os-taskbar-widget { display: flex; min-width: 68px; align-items: center; gap: 8px; color: #333; font-size: 12px; }
.os-taskbar-center { position: absolute; left: 50%; display: flex; align-items: center; gap: 4px; transform: translateX(-50%); }
.os-tray-button.os-start-button { border-radius: 7px; background: transparent; color: #1877d2; font-size: 25px; }
.os-taskbar-search { display: flex; min-width: 98px; min-height: 40px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid #d5dbe3; border-radius: 20px; background: rgb(255 255 255 / 70%); color: #424a54; font: 12px "Segoe UI",sans-serif; cursor: pointer; }
.os-taskbar-app { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid transparent; border-radius: 7px; background: transparent; font-size: 20px; cursor: pointer; }
.os-taskbar-app:hover,.os-taskbar-search:hover,.os-tray-button:hover { background: rgb(255 255 255 / 83%); }
.os-system-tray { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.os-system-tray .os-tray-button { width: auto; min-width: 86px; padding-inline: 8px; font-size: 13px; }
.os-clock { min-width: 52px; color: #26303b; font-size: 11px; text-align: center; }

.os-start-menu {
  position: absolute;
  z-index: 8;
  bottom: 68px;
  left: 50%;
  width: min(620px, calc(100% - 24px));
  padding: 24px 28px 12px;
  border: 1px solid rgb(255 255 255 / 68%);
  border-radius: 9px;
  background: rgb(245 247 251 / 94%);
  box-shadow: 0 16px 48px rgb(0 0 0 / 28%);
  color: #262b32;
  transform: translateX(-50%);
  backdrop-filter: blur(28px) saturate(1.5);
}
.os-start-menu[hidden] { display: none; }
.os-start-search { display: flex; min-height: 40px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #aabed3; border-radius: 5px; background: #fff; color: #536477; }
.os-start-search input { width: 100%; border: 0; outline: 0; color: #252c34; font: 13px "Segoe UI",sans-serif; }
.os-start-section { max-width: 460px; margin: 22px auto 18px; }
.os-start-section > strong { display: block; margin-bottom: 12px; font-size: 13px; }
.os-start-pins { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.os-start-pins button { display: grid; min-height: 69px; justify-items: center; gap: 5px; padding: 7px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #333; font: 11px "Segoe UI",sans-serif; cursor: pointer; }
.os-start-pins button:hover { border-color: #d9e2ec; background: #fff; }
.os-start-pins button span { font-size: 22px; }
.os-start-profile { display: flex; align-items: center; gap: 9px; margin: 0 -28px; padding: 10px 28px; border-top: 1px solid #dde2e9; font-size: 12px; }
.os-profile-avatar { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #dbe8f8; color: #315b8a; font-size: 10px; font-weight: 700; }
.os-start-profile button { width: 34px; height: 32px; margin-left: auto; border: 0; border-radius: 4px; background: transparent; font-size: 17px; cursor: pointer; }

.os-flyout {
  right: 14px;
  bottom: 68px;
  width: min(360px, calc(100% - 20px));
  max-height: min(540px, calc(100% - 90px));
  overflow-y: auto;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 9px;
  background: rgb(246 248 252 / 96%);
  box-shadow: 0 14px 40px rgb(0 0 0 / 26%);
  backdrop-filter: blur(24px);
}
.os-flyout h2 { margin: 15px 16px 8px; color: #333; font-size: 13px; font-weight: 600; }
.os-quick-setting-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 14px 10px; }
.os-quick-setting-tiles button { display: flex; min-height: 56px; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 5px; background: #e5e8ee; color: #30353d; text-align: left; font: 13px "Segoe UI",sans-serif; cursor: pointer; }
.os-quick-setting-tiles button.is-active { background: #0067c0; color: #fff; }
.os-quick-setting-tiles button span { font-weight: 600; }
.os-quick-volume { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 12px 16px; color: #30353d; font-size: 12px; }
.os-quick-volume input { grid-column: 1 / 3; width: 100%; accent-color: #0067c0; }
.os-quick-volume output { font-variant-numeric: tabular-nums; }
.os-network-row { margin-inline: 12px; padding: 5px 4px; }
.os-network-row .os-control-button { min-height: 34px; border-color: #c7d0dc; border-radius: 4px; }

@media(max-width:640px) {
  .os-taskbar { padding-inline: 5px; }
  .os-taskbar-widget { display: none; }
  .os-taskbar-center { left: 5px; transform: none; }
  .os-taskbar-search { min-width: 41px; width: 41px; justify-content: center; padding: 0; font-size: 19px; }
  .os-taskbar-search span { display: none; }
  .os-taskbar-app { display: none; }
  .os-system-tray { gap: 2px; }
  .os-system-tray .os-tray-button { min-width: 66px; padding-inline: 3px; font-size: 11px; }
  .os-clock { min-width: 44px; font-size: 10px; }
  .os-start-menu { bottom: 64px; padding: 16px 16px 8px; }
  .os-start-profile { margin-inline: -16px; padding-inline: 16px; }
}
