/* Taskbar, Start menu, tray, menus and dialogs. Measurements follow the XP reference
   (the XP reference file in docs/research/); the CSS is our own. */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
  display: flex; align-items: stretch; gap: 10px;
  height: var(--taskbar-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(180deg, #1f2f86 0, #3165c4 3%, #3682e5 6%, #4490e6 10%, #3883e5 12%, #2b71e0 15%,
    #2663da 18%, #235bd6 20%, #2258d5 23%, #2157d6 38%, #245ddb 54%, #2562df 86%, #245fdc 89%, #2158d4 92%,
    #1d4ec0 95%, #1941a5 98%);
  font-family: var(--ui-font);
}

/* Start: a green pill, square on the left and round on the right, with a glossy top. */
.start-button {
  position: relative;
  display: flex; align-items: center;
  min-width: 100px; justify-content: center; padding: 0 20px 2px 16px;
  border: 0; border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #5eac56 0%, #3c9b3c 12%, #3a9a3a 40%, #2f8a2f 70%, #2a7a2a 88%, #3b8f3b 100%);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.45), inset -2px 0 3px rgb(0 0 0 / 0.25), 2px 0 3px rgb(0 0 0 / 0.25);
  color: var(--white);
  font: italic 700 19px/1 "Trebuchet MS", "Franklin Gothic Medium", "Libre Franklin", sans-serif;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 2px rgb(0 0 0 / 0.55);
  cursor: pointer;
}
.start-button:hover { filter: brightness(1.05); }
.start-button[aria-expanded="true"] { filter: brightness(0.85); }

.task-buttons { flex: 1; display: flex; gap: 3px; align-items: center; min-width: 0; overflow: hidden; }
.task-button {
  flex: 0 1 150px; display: flex; align-items: center; gap: 6px;
  min-width: 40px; height: 22px; margin-top: 2px; padding: 0 8px;
  border: 0; border-radius: 2px;
  background: #2f6fe0; color: var(--white);
  box-shadow: inset -1px 0 rgb(0 0 0 / 0.3), inset 1px 1px 1px rgb(255 255 255 / 0.2);
  font-size: 11px; text-align: left; cursor: pointer;
}
.task-button:hover { background: #2f71cd; }
.task-button.is-active { background: #1e52b7; box-shadow: inset 0 0 1px 1px rgb(0 0 0 / 0.2), inset 1px 0 1px rgb(0 0 0 / 0.7); }
.task-button.is-active:hover { background: #2a68d8; }
.task-button img { width: 15px; height: 15px; }
.task-button__label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.tray {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: linear-gradient(180deg, #0c59b9 1%, #139ee9 6%, #18b5f2 10%, #139beb 14%, #1290e8 19%, #0d8dea 63%,
    #0d9ff1 81%, #0f9eed 88%, #119be9 91%, #1392e2 94%, #137ed7 97%, #095bc9 100%);
  border-left: 1px solid #1042af; box-shadow: inset 1px 0 1px #18bbff;
  color: var(--white);
}
.tray button { background: none; border: 0; color: var(--white); cursor: pointer; padding: 3px; font-size: 11px; }
.tray__volume::before { content: ""; display: block; width: 14px; height: 14px; background: var(--white);
  clip-path: polygon(0 35%, 30% 35%, 70% 0, 70% 100%, 30% 65%, 0 65%); }
.tray__volume { position: relative; }
.tray__volume.is-muted::after { content: ""; position: absolute; left: 3px; top: 9px; width: 16px; height: 2px;
  background: #ff5a4a; transform: rotate(-45deg); }
.tray__volume-panel label { display: flex; flex-direction: column; gap: 6px; }
.tray__volume-panel input { width: 140px; accent-color: #2f71cd; }
.tray__panel {
  position: absolute; right: 4px; bottom: calc(var(--taskbar-h) + 4px);
  padding: 8px; background: var(--face); color: var(--ink);
  border: 1px solid #0831d9; border-radius: 4px; box-shadow: 2px 4px 8px rgb(0 0 0 / 0.4);
}
.calendar__month { margin: 0 0 6px; font-weight: 700; text-align: center; }
.calendar { border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--white); border: 1px solid #7f9db9; }
.calendar th { background: #d6dff7; color: #215dc6; }
.calendar th, .calendar td { width: 24px; height: 20px; text-align: center; }
.calendar .is-today { background: var(--select); color: var(--white); }

/* Start menu */
.start-menu {
  position: fixed; left: 0; bottom: var(--taskbar-h); z-index: 9001;
  width: min(382px, 100vw); display: flex; flex-direction: column;
  background: #4282d6; border-radius: 6px 6px 0 0; overflow: hidden;
  box-shadow: 2px 4px 4px rgb(0 0 0 / 0.5);
  font: 11px/14px var(--ui-font);
}
.start-menu__header {
  position: relative;
  display: flex; align-items: center; gap: 8px; height: 54px; padding: 6px 5px 5px;
  background: linear-gradient(180deg, #1868ce, #0e60cb 12%, #0e60cb 20%, #1164cf 32%, #1b6cd3 47%, #1e70d9 54%,
    #2476dc 60%, #297ae0 65%, #3482e3 77%, #428ee9 90%, #4791eb);
  color: var(--white); font-size: 14px; font-weight: 700; text-shadow: 1px 1px rgb(0 0 0 / 0.7);
}
.start-menu__header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, transparent, #da884a 50%, transparent);
}
.start-menu__header img { width: 42px; height: 42px; border: 2px solid rgb(222 222 222 / 0.8); border-radius: 3px; background: #d6e3fb; }
.start-menu__columns { display: grid; grid-template-columns: 1fr 1fr; margin: 0 2px; }
.start-menu__left { background: var(--white); padding: 6px 5px 6px; }
.start-menu__right { background: #cbe3ff; padding: 6px 5px; border-left: 1px solid rgb(58 58 255 / 0.37); color: #00136b; }
.start-menu__left .menu__item { min-height: 34px; }
.start-menu__left .menu__item img { width: 30px; height: 30px; }
.start-menu__right .menu__item { min-height: 26px; }
.start-menu__right .menu__item img { width: 22px; height: 22px; }
.start-menu__right .menu__item strong { font-weight: 700; }
.start-menu__left hr { border: 0; height: 1px; margin: 4px 0; background: linear-gradient(90deg, transparent, rgb(0 0 0 / 0.1) 50%, transparent); }
.start-menu__right hr { border: 0; height: 1px; margin: 4px 0; background: linear-gradient(90deg, transparent, #87b3e2b5 50%, transparent); }
.start-menu__footer {
  display: flex; justify-content: flex-end; gap: 6px; height: 36px; padding: 0 6px;
  background: linear-gradient(180deg, #4282d6, #3b78e0 3%, #2f6fe0 30%, #2a68d8 60%, #0f61cb);
}
.start-menu__footer .menu__item { width: auto; color: var(--white); }
.start-menu__footer .menu__item:hover { background: rgb(60 80 210 / 0.5); }
.start-menu__footer .menu__icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 3px; border: 1px solid rgb(255 255 255 / 0.6); }
.start-menu__footer .menu__icon--logoff { background: linear-gradient(135deg, #f8c25a, #d98a1a); }
.start-menu__footer .menu__icon--off { background: linear-gradient(135deg, #f08a6c, #c13b1e); }

.menu__item {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 2px 6px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
}
.menu__item:hover, .menu__item:focus-visible { background: #2f71cd; color: var(--white); outline: none; }
.menu__item:hover small, .menu__item:focus-visible small { color: var(--white); }
.menu__text { display: flex; flex-direction: column; min-width: 0; }
.menu__text small { font-size: 11px; color: #6b6b6b; }

/* Right-click menu */
.context-menu {
  position: fixed; z-index: 9002; min-width: 170px; padding: 2px;
  background: var(--white); border: 1px solid #aca899; box-shadow: 2px 2px 2px rgb(0 0 0 / 0.3);
  font: 11px/14px var(--ui-font);
}
.context-menu .menu__item { padding: 3px 20px; }
.context-menu .menu__item strong { font-weight: 400; }
.context-menu .menu__item:hover, .context-menu .menu__item:focus-visible { background: var(--select); }
.context-menu hr { border: 0; border-top: 1px solid #aca899; margin: 3px 1px; }

/* Turn Off dialog: dark blue strips, a lighter middle, three square buttons. */
/* Layers: taskbar 9000, menus 9001-9002, dialogs 9500, session screens 9600, black screen 9700, boot 10000. */
.turnoff, .standby { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; }
.turnoff { background: rgb(0 0 0 / 0.35); backdrop-filter: grayscale(1); font-family: var(--ui-font); }
.turnoff__box { width: 300px; border: 1px solid #000; color: var(--white); box-shadow: 3px 3px 10px rgb(0 0 0 / 0.5); }
.turnoff__box h2 { display: flex; align-items: center; justify-content: space-between; margin: 0; height: 42px; padding: 0 6px 0 12px; background: #092178; font: 400 17px/42px "Franklin Gothic Medium", "Trebuchet MS", sans-serif; }
.turnoff__choices {
  position: relative; display: flex; justify-content: space-around; height: 106px; align-items: center;
  background: linear-gradient(90deg, #3349e0, #4a6fd6 47%, #4a6fd6 53%, #3349e0);
}
.turnoff__choices::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #fff 50%, transparent); opacity: 0.6; }
.turnoff__choices button { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: var(--white); font-size: 11px; font-weight: 700; cursor: pointer; text-shadow: 1px 1px 1px rgb(0 0 0 / 0.4); }
.turnoff__choices button:hover .turnoff__dot { filter: brightness(1.15); }
.turnoff__dot { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 3px; border: 1px solid var(--white); box-shadow: 1px 1px 2px rgb(0 0 0 / 0.4); }
.turnoff__dot svg, .menu__icon svg { width: 70%; height: 70%; }
.turnoff__dot--yellow { background: linear-gradient(135deg, #f9d65b, #d99a0b); }
.turnoff__dot--red { background: linear-gradient(135deg, #f08a6c, #c13b1e); }
.turnoff__dot--green { background: linear-gradient(135deg, #7bd36a, #2f8a2f); }
.turnoff__dot--blue { background: linear-gradient(135deg, #8fc0ff, #2a62d0); }
.turnoff__dot--orange { background: linear-gradient(135deg, #ffc46b, #e07b12); }
.turnoff__foot { display: flex; justify-content: flex-end; align-items: center; height: 42px; padding: 0 10px; background: #092178; }
.turnoff__cancel { min-width: 75px; height: 23px; }
.standby { background: rgb(0 0 0 / 0.85); cursor: pointer; }
.standby__wake { padding: 8px 12px; border: 0; background: none; color: #9a9a9a; font: 13px var(--ui-font); cursor: pointer; }

@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
  .task-button { flex: 0 0 40px; justify-content: center; height: 32px; margin-top: 4px; }
  .task-button__label { display: none; }
  .start-menu { width: 100vw; font-size: 13px; }
  .menu__item { min-height: 44px; }
}
.task-button__letter { display: none; font-weight: 700; }
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) { .task-button__letter { display: inline; } }

/* Start menu: bold top items on the right, All Programs and its flyout. */
.start-menu { overflow: visible; }
.start-menu__header { border-radius: 6px 6px 0 0; }
.menu__item--strong strong { font-weight: 700; }
.start-menu__right .menu__item:not(.menu__item--strong) strong { font-weight: 400; }
.start-menu__left .menu__item strong { font-weight: 400; }
.start-menu__left .menu__item:has(small) strong { font-weight: 700; }
.start-menu__all { position: relative; }
.start-menu__all-button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 30px;
  border: 0; background: none; color: inherit; font: 700 11px var(--ui-font); cursor: pointer;
}
.start-menu__all-button:hover, .start-menu__all-button:focus-visible, .start-menu__all-button[aria-expanded="true"] {
  background: #2f71cd; color: var(--white); outline: none;
}
.start-menu__arrow {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, #6cd06c, #2f8a2f); box-shadow: inset 0 1px rgb(255 255 255 / 0.5);
}
.start-menu__arrow::after { content: ""; border-left: 6px solid #fff; border-top: 4px solid transparent; border-bottom: 4px solid transparent; margin-left: 2px; }
.start-menu__fly {
  position: absolute; left: calc(100% - 4px); bottom: 0; z-index: 2;
  width: 220px; max-height: 70vh; overflow-y: auto; padding: 2px;
  background: var(--white); border: 1px solid #7f9db9; box-shadow: 2px 2px 4px rgb(0 0 0 / 0.4);
  color: var(--ink);
}
.start-menu__fly-label { padding: 4px 8px 2px; color: #555; font-size: 11px; font-weight: 700; }
.start-menu__fly .menu__item { min-height: 22px; }
.start-menu__fly .menu__item img { width: 16px; height: 16px; }
.start-menu__fly .menu__item strong { font-weight: 400; }
.start-menu__fly hr { border: 0; border-top: 1px solid #d6d3ce; margin: 3px 4px; }
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
  .start-menu__fly { position: static; width: auto; max-height: none; box-shadow: none; border: 0; border-top: 1px solid #d6d3ce; }
  .start-menu { max-height: calc(100dvh - var(--taskbar-h)); overflow-y: auto; }
}
