/* 1zoku OS components. Built only from tokens.css values and XP.css primitives.
   Section order: shell, window, explorer, lists, dialogs, wizard, player, messenger, content art. */

/* Button-based items that are not XP.css buttons (list rows, icons, tiles) start from nothing. */
:where(.dicon, .task, .tray-btn, #start-btn, .sm-item, .sm-power, .tbtn, .tp-link, .tile, .thumb, .pl-row, .buddy, .film, .bin-item, .menubar > button, .menu button, .addr-combo, .bar-x, .lo-btn) {
  all: unset; box-sizing: border-box; cursor: default; -webkit-tap-highlight-color: transparent;
}
:where(.dicon, .task, .tray-btn, #start-btn, .sm-item, .sm-power, .tbtn, .tp-link, .tile, .thumb, .pl-row, .buddy, .film, .bin-item, .menubar > button, .addr-combo, .bar-x, .lo-btn):focus-visible {
  outline: 1px dotted currentColor; outline-offset: -2px;
}

/* XP.css sizes every :start/:end scrollbar button, so Chrome draws two arrows at each end.
   XP shows one: keep start:decrement and end:increment only. */
::-webkit-scrollbar-button:vertical:start:increment, ::-webkit-scrollbar-button:vertical:end:decrement,
::-webkit-scrollbar-button:horizontal:start:increment, ::-webkit-scrollbar-button:horizontal:end:decrement { display: none; }

/* XP edit box for every text-like input, including the types XP.css leaves unthemed:
   1px #7F9DB9, square corners, 23px tall, no browser-added glyphs. */
input:is([type=text], [type=email], [type=number], [type=date], [type=search], [type=url]) {
  box-sizing: border-box; height: 23px; padding: 2px 4px; border: 1px solid var(--edge-input); border-radius: 0;
  background-color: var(--pane); color: var(--text); font: var(--fs) var(--font-ui); line-height: normal; -webkit-appearance: none; appearance: none;
}
input:is([type=text], [type=email], [type=number], [type=date], [type=search], [type=url]):disabled { background-color: var(--face); color: var(--text-disabled); }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
input[type=date]::-webkit-calendar-picker-indicator { display: none; }

/* ================= Shell ================= */

/* Boot and power-off screens (content layer: white paper) */
#boot, #off {
  position: fixed; inset: 0; z-index: 10000; background: var(--paper); color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3);
}
.skip-boot #boot { display: none; }
.boot-logo { width: min(440px, 78vw); height: auto; }
.boot-line { display: flex; align-items: center; gap: var(--s1); min-height: 1.4em; margin: 0; color: var(--text-dim); }
/* XP boot loader: three Luna-blue blocks sliding through a rounded track */
.boot-bar { position: relative; width: 156px; height: 18px; margin-top: 28px; overflow: hidden; background: var(--paper); border: 1px solid var(--silver-2); border-radius: 4px; }
.boot-bar span { position: absolute; top: 3px; left: 0; display: flex; gap: 2px; animation: boot-blocks 2.2s linear infinite; }
.boot-bar i { width: 8px; height: 10px; border-radius: 2px; background: linear-gradient(180deg, #A9C4F5, #2152D9 55%, #3A6FE6); }
@keyframes boot-blocks { from { transform: translateX(-30px); } to { transform: translateX(160px); } }
.boot-hint { position: absolute; bottom: var(--s3); margin: 0; color: var(--text-dim); }
#off img { width: min(380px, 72vw); height: auto; }
#off p { margin: 0; padding: 0 var(--s3); text-align: center; font: bold 20px/1.2 var(--font-title); color: var(--text); }

/* Desktop wallpaper (content layer): white-silver sky, god-rays, flare, flower-of-life watermark */
#desktop { position: fixed; inset: 0 0 var(--tb-h) 0; overflow: hidden; background: var(--paper); }
/* Wallpaper (js/wallpaper.js): two stacked layers crossfade on opacity; cover photos drift on transform. */
.wall-art { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--desk); } /* own stacking context, so layer z-indexes stay inside */
.wall-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 2.5s ease-in-out; background: center / cover no-repeat; will-change: opacity, transform; }
.wall-layer.on { opacity: 1; }
.wall-layer.center { padding: 4vmin; background-color: var(--desk); background-size: contain; background-origin: content-box; } /* XP "Center": never stretched */
.wall-layer.drift { animation: drift 30s linear forwards; }
@keyframes drift { to { transform: scale(1.04) translate(var(--dx), -.4%); } } /* barely there: 4% over 30s */
.wall-art.paused .wall-layer { animation-play-state: paused; }
.wall-kanji { position: absolute; right: var(--s3); bottom: var(--s2); margin: 0; color: var(--sel-text); text-shadow: 1px 1px 1px #000; font: var(--fs) var(--font-ui); letter-spacing: .4em; pointer-events: none; }
#windows { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

/* Desktop icons */
#icons { position: relative; z-index: 1; display: flex; flex-flow: column wrap; align-content: flex-start; max-height: 100%; list-style: none; margin: 0; padding: var(--s2) var(--s1); } /* XP wraps into a new column */
.dicon { display: flex; flex-direction: column; align-items: center; gap: var(--s1); width: 76px; padding: 2px; color: var(--sel-text); text-align: center; line-height: 1.25; }
.dicon span { padding: 0 2px; text-shadow: 1px 1px 1px #000, 0 0 2px #000; } /* XP's icon-label drop shadow */
.dicon.sel span { text-shadow: none; background: var(--sel); color: var(--sel-text); }
.dicon.sel .ico, .tile[aria-current] .tile-ico > svg { filter: url(#sel-tint); } /* XP blends selected icons with the selection blue */
.dicon:focus-visible { outline: none; }
.dicon:focus-visible span { outline: 1px dotted var(--sel-text); }
/* Desktop gadget: the collage on a slowly spinning globe */
.gadget { position: absolute; top: var(--s3); right: var(--s3); z-index: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s1); }
.gadget figcaption { color: var(--sel-text); font: var(--fs) var(--font-cjk); text-align: center; text-shadow: 1px 1px 1px #000, 0 0 2px #000; }
.gadget small { font: var(--fs) var(--font-ui); }
.globe { width: 168px; } /* assets/globe.js renders a lit three.js sphere into this square */
@media (max-width: 640px) { .gadget { display: none; } }

/* Taskbar (Luna) */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000; height: var(--tb-h); display: flex; align-items: stretch;
  user-select: none; -webkit-user-select: none;
  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%);
}
#start-btn {
  display: flex; align-items: center; gap: 5px; padding: 0 22px 0 8px; margin-right: var(--s2);
  color: var(--sel-text); font: italic bold 18px/1 var(--font-title); text-shadow: 1px 1px 1px rgba(0, 0, 0, .6);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, #3C9A3C 0%, #5BC15B 6%, #43A843 22%, #379A37 50%, #2E8C2E 62%, #339A33 88%, #2B7B2B 100%);
}
#start-btn:hover { background: linear-gradient(180deg, #4AAE4A 0%, #6BD06B 6%, #50B850 22%, #44A944 50%, #3A9A3A 62%, #3FA83F 88%, #338A33 100%); }
#start-btn[aria-expanded=true] { background: linear-gradient(180deg, #2A7A2A 0%, #2E8A2E 40%, #379A37 100%); }
#start-btn .mark {
  display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--sel-text); border-radius: 50%;
  background: var(--paper); color: var(--ink);
}
#tasks { flex: 1 1 0; display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.task {
  display: flex; align-items: center; gap: var(--s1); flex: 0 1 160px; min-width: 28px; height: 24px; padding: 0 var(--s2);
  border-radius: 3px; color: var(--sel-text); white-space: nowrap; overflow: hidden;
  background: linear-gradient(180deg, #3C8CF8 0%, #2C77F0 20%, #2B74EC 85%, #1D5FD6 100%); border: 1px solid #1B4CB0;
}
.task span { overflow: hidden; text-overflow: ellipsis; }
.task .ico { flex: none; }
.task:hover { background: linear-gradient(180deg, #5BA0FF 0%, #3F87F5 20%, #3A82F2 85%, #2A6CE0 100%); }
.task.on { background: linear-gradient(180deg, #1A4CB3 0%, #1E56C4 50%, #2160D0 100%); border-color: #173F98; box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .35); }
#tray {
  display: flex; align-items: center; gap: var(--s1); padding: 0 var(--s2) 0 var(--s3); color: var(--sel-text); border-left: 1px solid #1042AF;
  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%);
}
.tray-btn { display: flex; align-items: center; gap: 2px; height: 22px; padding: 0 2px; color: var(--sel-text); }
.tray-count { font-weight: bold; }
#clock { padding-left: var(--s1); white-space: nowrap; }

/* Start menu (Luna) */
#start-menu {
  position: fixed; left: 0; bottom: var(--tb-h); z-index: 9500; width: min(380px, 100vw); max-height: calc(100dvh - var(--tb-h));
  display: flex; flex-direction: column; overflow: hidden; background: var(--pane);
  border: 1px solid #1C4DB5; border-radius: 7px 7px 0 0;
}
.sm-head, .sm-foot { background: linear-gradient(180deg, #1868CE 0%, #0E60CB 12%, #1164CF 32%, #1B6CD3 47%, #2476DC 60%, #3482E4 77%, #428EE9 90%, #4791EB 100%); }
.sm-head { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s2); color: var(--sel-text); font: bold 14px var(--font-title); text-shadow: 1px 1px 1px rgba(0, 0, 0, .5); }
.sm-user { border: 2px solid var(--sel-text); border-radius: 3px; }
.sm-rule { height: 2px; background: linear-gradient(90deg, transparent, var(--orange) 30%, var(--orange) 70%, transparent); }
.sm-cols { display: flex; min-height: 0; overflow: auto; }
.sm-cols ul { list-style: none; margin: 0; padding: var(--s1); }
.sm-left { flex: 1.1; display: flex; flex-direction: column; background: var(--pane); }
.sm-right { flex: 1; background: var(--luna-pale); border-left: 1px solid var(--luna-edge); }
.sm-item { display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 28px; padding: 2px var(--s1); color: var(--text); }
.sm-item b { display: block; font-weight: normal; }
.sm-item small { display: block; color: var(--text-dim); }
.sm-pin b, .sm-all .sm-item b { font-weight: bold; }
.sm-right .sm-item { color: var(--luna-dark); }
.sm-item:hover, .sm-item:focus-visible, .sm-item[aria-expanded=true] { background: var(--sel); color: var(--sel-text); }
.sm-item:hover small, .sm-item:focus-visible small { color: var(--sel-text); }
.sm-sep { height: 1px; margin: var(--s1) var(--s1); background: linear-gradient(90deg, transparent, var(--edge-line) 20%, var(--edge-line) 80%, transparent); }
.sm-right .sm-sep { background: linear-gradient(90deg, transparent, var(--luna-edge) 20%, var(--luna-edge) 80%, transparent); }
.sm-all { margin-top: auto; }
.sm-all .sm-item { justify-content: center; }
.sm-foot { display: flex; justify-content: flex-end; gap: var(--s1); padding: var(--s1) var(--s2); }
.sm-power { display: flex; align-items: center; gap: var(--s1); padding: 2px var(--s1); color: var(--sel-text); }
.sm-power:hover { text-decoration: underline; }
#all-programs {
  position: fixed; z-index: 9600; list-style: none; margin: 0; padding: 2px; min-width: 190px;
  background: var(--pane); border: 1px solid var(--edge-dk);
}

/* Balloon tips: tray notifications (#balloon, tail on the tray icon) and form tips (.tip, tail on the field) */
#balloon, .tip { padding: var(--s2) 28px var(--s2) var(--s2); background: var(--balloon); color: var(--text); border: 1px solid var(--text); border-radius: 7px; }
#balloon { position: fixed; right: var(--s2); bottom: calc(var(--tb-h) + 12px); z-index: 9600; width: min(300px, calc(100vw - 16px)); }
#balloon::before, #balloon::after, .tip::before, .tip::after { content: ""; position: absolute; border-style: solid; border-color: transparent; }
#balloon::before { right: calc(var(--tail, 60px) - 1px); bottom: -15px; border-width: 15px 0 0 15px; border-top-color: var(--text); }
#balloon::after { right: var(--tail, 60px); bottom: -13px; border-width: 13px 0 0 13px; border-top-color: var(--balloon); }
.tip { position: fixed; z-index: 9800; width: max-content; max-width: min(280px, calc(100vw - 16px)); padding-right: var(--s2); }
.tip::before { left: calc(var(--tail, 16px) - 1px); top: -15px; border-width: 0 0 15px 15px; border-bottom-color: var(--text); }
.tip::after { left: var(--tail, 16px); top: -13px; border-width: 0 0 13px 13px; border-bottom-color: var(--balloon); }
.tip.up::before { top: auto; bottom: -15px; border-width: 15px 0 0 15px; border-color: var(--text) transparent transparent; }
.tip.up::after { top: auto; bottom: -13px; border-width: 13px 0 0 13px; border-color: var(--balloon) transparent transparent; }
.b-title { display: flex; align-items: center; gap: var(--s1); font-weight: bold; }
.b-text { display: block; margin-top: var(--s1); padding-left: 20px; }
#balloon .b-main { all: unset; display: block; cursor: pointer; }
#balloon .b-main:hover .b-text { text-decoration: underline; }
#balloon .b-close { position: absolute; top: var(--s1); right: var(--s1); min-width: 16px; min-height: 16px; width: 16px; height: 16px; padding: 0; line-height: 1; }

/* ================= Window ================= */
.window { position: absolute; display: flex; flex-direction: column; min-width: 0; pointer-events: auto; }
.window:focus-visible { outline: none; } /* focus lands on the window when it opens; XP draws no ring there */
.window .title-bar { flex: none; box-sizing: content-box; touch-action: none; user-select: none; -webkit-user-select: none; } /* XP.css sizes it content-box: 21px + padding = 28px */
.modal-cover { position: absolute; inset: 0; pointer-events: auto; }
.title-bar-text { display: flex; align-items: center; gap: var(--s1); min-width: 0; white-space: nowrap; }
.title-bar-text span { overflow: hidden; text-overflow: ellipsis; }
.title-bar-text .ico { flex: none; }
/* Title-bar buttons: equal 21px squares, 2px apart, crisp centred glyphs. */
.title-bar-controls { display: flex; gap: 2px; flex: none; }
.title-bar-controls button {
  width: 21px; height: 21px; min-width: 21px; min-height: 21px; margin: 0; padding: 0; border: 1px solid var(--sel-text); border-radius: 3px; box-shadow: none;
  background: var(--glyph) center / 21px 21px no-repeat border-box,
    radial-gradient(circle at 90% 90%, #0054E9 0%, #2263D5 55%, #4479E4 70%, #A3BBEC 90%, #FFFFFF 100%) border-box;
}
.title-bar-controls button[aria-label=Close] {
  background: var(--glyph) center / 21px 21px no-repeat border-box,
    radial-gradient(circle at 90% 90%, #CC4600 0%, #DC6527 55%, #CD7546 70%, #FFCCB2 90%, #FFFFFF 100%) border-box;
}
.title-bar-controls button:hover { filter: brightness(1.15); }
.title-bar-controls button:active { filter: brightness(.85); }
.title-bar-controls button[aria-label=Minimize] { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21' shape-rendering='crispEdges'%3E%3Crect x='6' y='13' width='9' height='3' fill='%23fff'/%3E%3C/svg%3E"); }
.title-bar-controls button[aria-label=Maximize] { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='M5 5h11v11H5zM6 8h9v7H6z'/%3E%3C/svg%3E"); }
.title-bar-controls button[aria-label=Restore] { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='M5 8h8v8H5zM6 10h6v5H6zM8 4h8v8h-3v-1h2V6H9v2H8z'/%3E%3C/svg%3E"); }
.title-bar-controls button[aria-label=Close] { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21'%3E%3Cpath d='M6.5 6.5l8 8m0-8-8 8' stroke='%23fff' stroke-width='2.2' stroke-linecap='square'/%3E%3C/svg%3E"); }
/* Inactive window (Luna) */
.window:not(.active) {
  box-shadow: inset -1px -1px #6F83CF, inset 1px 1px #8EA3EA, inset -2px -2px #7F95E0, inset 2px 2px #A3B5F1, inset -3px -3px #90A5EA, inset 3px 3px #9DB0EE;
}
.window:not(.active) .title-bar { background: linear-gradient(180deg, #A7BCF4, #7D9BEA 9%, #7A97E6 45%, #87A3EC 90%, #7D96E2); border-color: #8EA3EA; }
.window:not(.active) .title-bar-text { color: #D8E4F8; text-shadow: none; }
.window:not(.active) .title-bar-controls button { opacity: .75; }
.window .window-body { flex: 1; min-height: 0; margin: 0 3px 3px; padding: var(--s2); display: flex; flex-direction: column; overflow: auto; background: var(--face); container-type: inline-size; }
.window .window-body.flush { padding: 0; }
.window.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.window.max .title-bar { border-radius: 0; }
@media (max-width: 640px) {
  .window:not(.dlg) { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
  .window:not(.dlg) .title-bar { border-radius: 0; }
  .window.dlg { left: var(--s2) !important; width: calc(100% - 16px) !important; }
  .title-bar-controls .max-btn { display: none; }
}

/* ================= Explorer anatomy ================= */
.menubar { display: flex; flex: none; align-items: center; padding: 0 0 0 var(--s1); background: var(--face); border-bottom: 1px solid var(--edge-hi); box-shadow: 0 1px 0 var(--edge-lo); }
.menubar > button { padding: 3px 6px; }
.menubar > button:hover, .menubar > button[aria-expanded=true] { background: var(--sel); color: var(--sel-text); }
/* Throbber box at the right end of the menu bar (the peace mark stands in for the OS logo) */
.throbber { display: grid; place-items: center; width: 38px; height: 24px; margin-left: auto; background: var(--pane); border-left: 1px solid var(--edge-lo); }
/* Popup menus: menu bar, Views dropdown, address list, desktop right-click */
.menu { position: fixed; z-index: 9700; min-width: 150px; margin: 0; padding: 2px; list-style: none; background: var(--pane); border: 1px solid var(--edge-dk); box-shadow: 2px 2px 3px rgba(0, 0, 0, .35); }
.menu:focus { outline: none; }
.menu button { display: flex; align-items: center; gap: var(--s1); width: 100%; min-height: 20px; padding: 0 20px 0 0; white-space: nowrap; color: var(--text); }
.menu button:hover, .menu button:focus-visible, .menu button[aria-expanded=true] { background: var(--sel); color: var(--sel-text); }
.menu button[aria-disabled=true] { color: var(--text-disabled); }
.menu button[aria-disabled=true]:hover { background: none; color: var(--text-disabled); }
.menu-gut { display: grid; place-items: center; flex: none; width: 22px; }
.menu [aria-checked=true] .menu-gut::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; } /* radio bullet */
.menu [role=option] { padding-right: var(--s2); }
.menu:not(:hover, :has(button:focus)) [aria-selected=true] { background: var(--sel); color: var(--sel-text); } /* current place, until the pointer moves */
.menu-sub { width: 0; height: 0; margin-left: auto; margin-right: -12px; border: 4px solid transparent; border-left-color: currentColor; border-right: 0; }
.menu-sep { height: 1px; margin: 3px 1px; background: var(--edge-line); }
.toolbar { display: flex; flex: none; align-items: center; gap: 2px; padding: 2px var(--s1); overflow: hidden; background: var(--face); border-bottom: 1px solid var(--edge-lo); }
.toolbar > .dim { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Narrow windows: XP-style icon-only toolbar instead of wrapping */
@container (max-width: 520px) { .tb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.tbtn { display: inline-flex; align-items: center; gap: var(--s1); min-height: 32px; padding: 2px 6px; border: 1px solid transparent; border-radius: 3px; color: var(--text); }
.tbtn:not([aria-disabled=true]):hover { border-color: var(--edge-lo); background: var(--pane); }
.tbtn[aria-pressed=true] { border-color: var(--edge-lo); background: var(--pane); }
.tbtn[aria-disabled=true] { color: var(--text-disabled); }
.tbtn[aria-disabled=true] .ico { filter: grayscale(1); opacity: .45; }
.tb-sep { width: 1px; height: 26px; margin: 0 2px; background: var(--edge-lo); border-right: 1px solid var(--edge-hi); }
.tb-arrow { width: 0; height: 0; margin-left: 1px; border: 3px solid transparent; border-top: 4px solid var(--text); border-bottom: 0; }
.tbtn[aria-disabled=true] .tb-arrow { border-top-color: var(--text-disabled); }
.addressbar { display: flex; flex: none; align-items: center; gap: var(--s1); padding: 2px var(--s1); background: var(--face); border-bottom: 1px solid var(--edge-lo); }
.ab-label { color: var(--text-dim); }
.addr { flex: 1; min-width: 0; }
/* Address combo: XP edit box with the blue drop button; opens a small listbox of places */
.addr-combo {
  display: flex; align-items: center; gap: var(--s1); width: 100%; height: 23px; padding: 0 22px 0 3px; color: var(--text);
  background: var(--pane) no-repeat right 1px center / 17px 19px; border: 1px solid var(--edge-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 19'%3E%3ClinearGradient id='g' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23E6EEFC'/%3E%3Cstop offset='1' stop-color='%23B3C9F8'/%3E%3C/linearGradient%3E%3Crect x='.5' y='.5' width='16' height='18' rx='2' fill='url(%23g)' stroke='%23BACCF4'/%3E%3Cpath d='M5 8l3.5 3.5L12 8' fill='none' stroke='%234D6185' stroke-width='2'/%3E%3C/svg%3E");
}
.addr-combo:hover, .addr-combo[aria-expanded=true] { filter: brightness(1.04); }
.addr-combo:focus-visible .addr-v { background: var(--sel); color: var(--sel-text); }
.addr-ico { display: grid; flex: none; }
.addr-v { min-width: 0; padding: 0 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.addressbar .tbtn { min-height: 21px; padding: 0 var(--s1); }

/* Task pane (Luna blue, collapsible white-header groups) */
.taskpane { padding: var(--s3); background: linear-gradient(180deg, var(--tp-top), var(--tp-bottom)); overflow: auto; }
.tp-group { margin-bottom: var(--s3); }
.tp-group > summary {
  display: flex; align-items: center; justify-content: space-between; height: 23px; padding: 0 var(--s1) 0 var(--s3); list-style: none; cursor: pointer;
  color: var(--tp-head); font-weight: bold; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, #FFFFFF, #C6D3F7);
}
.tp-group > summary::-webkit-details-marker { display: none; }
.tp-group > summary::after {
  content: ""; flex: none; width: 17px; height: 17px; border: 1px solid #B2C2E6; border-radius: 50%; background: var(--pane) no-repeat center / 9px 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9'%3E%3Cpath d='M1 4.5l3.5-3.5L8 4.5M1 8l3.5-3.5L8 8' fill='none' stroke='%23215DC6' stroke-width='1.4'/%3E%3C/svg%3E");
}
/* "Special" group: dark Luna header, white title (first group on XP task panes) */
.tp-group.special > summary { color: var(--sel-text); background: linear-gradient(90deg, #0C49C1, #2A6BE3); }
.tp-group.special > summary:hover { color: #C6D3F7; }
.tp-group.special > .tp-body { background: #EEF3FF; }
.tp-group:not([open]) > summary::after { transform: rotate(180deg); }
.tp-group > summary:hover { color: #428EFF; }
.tp-body { padding: var(--s2) var(--s3); background: var(--tp-body); border: 1px solid var(--pane); border-top: 0; }
.tp-body p { margin: 0 0 var(--s1); }
.tp-link { display: flex; align-items: center; gap: var(--s1); width: 100%; padding: 2px 0; color: var(--tp-head); cursor: pointer; }
.tp-link:hover { color: #428EFF; text-decoration: underline; }
.tp-link[aria-disabled=true] { color: var(--text-disabled); cursor: default; text-decoration: none; }
.tp-link[aria-disabled=true] .ico { filter: grayscale(1); opacity: .45; }

/* Explorer bar (Search, Folders): a full-height white pane with a caption and a close box */
.taskpane.bar { padding: 0; background: var(--pane); border-right: 1px solid var(--edge-lo); }
.bar-head { display: flex; align-items: center; justify-content: space-between; height: 22px; padding: 0 2px 0 var(--s1); background: var(--face); border-bottom: 1px solid var(--edge-lo); }
.bar-x { display: grid; place-items: center; width: 16px; height: 16px; font: bold 13px/1 var(--font-ui); border: 1px solid transparent; }
.bar-x:hover { border-color: var(--edge-lo); background: var(--pane); }
.bar-body { padding: var(--s2); }
.bar-body .tree-view { margin: 0; padding: 0; border: 0; box-shadow: none; }
@container (max-width: 600px) { .taskpane.bar { border-right: 0; border-bottom: 1px solid var(--edge-lo); } } /* stacked above the files */
.tree-view .tp-link { padding: 1px 2px; color: var(--text); }
.tree-view .tp-link:hover { color: var(--text); text-decoration: none; }
.tree-view .tp-link[aria-current] { background: var(--sel); color: var(--sel-text); }

/* Preview pane beside a file list (Explorer, Merch) */
.preview { min-height: 0; overflow: auto; padding: var(--s3); background: var(--pane); border-left: 1px solid var(--edge-line); }
@container (max-width: 820px) { .ex-pane .preview { border-left: 0; border-top: 1px solid var(--edge-line); } }
@container (max-width: 600px) { .m-main .preview { border-left: 0; border-top: 1px solid var(--edge-line); } }
/* White content pane; section headings get XP's blue fade rule */
.ex-section { margin: 0 0 var(--s2); padding-bottom: 2px; font: bold var(--fs) var(--font-ui); background: linear-gradient(90deg, #70BFFF, var(--pane)) left bottom / 100% 1px no-repeat; }
.pane { background: var(--pane); border: 1px solid var(--edge-input); overflow: auto; }
.pane.flat { border: 0; }
.h { margin: 0 0 var(--s2); font: bold var(--fs-head)/1.2 var(--font-title); color: var(--text); }
.h3 { margin: var(--s3) 0 var(--s1); padding-bottom: 2px; font: bold var(--fs) var(--font-ui); border-bottom: 1px solid var(--edge-line); }
.dim { color: var(--text-dim); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s2); margin: 0 0 var(--s2); }
.facts dt { color: var(--text-dim); }
.facts dd { margin: 0; }
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .35); vertical-align: 0; }
.dot.live, .dot.sold { background: var(--red); }
.dot.online { background: #3DBE4F; }
.dot.away { background: #F0A81E; }
.dot.busy { background: #E8502E; }
.dot.offline { background: var(--edge-lo); }
.stat { display: inline-flex; align-items: center; gap: var(--s1); }
.stat.low { font-weight: bold; }

/* ================= Lists ================= */
/* Tiles view */
.tile { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: var(--s2); width: 100%; padding: var(--s1); color: var(--text); }
.tile-ico { display: grid; place-items: center; width: 48px; height: 48px; }
.tile-ico > svg { max-width: 100%; max-height: 100%; }
.tile-text { justify-self: start; width: fit-content; max-width: 100%; min-width: 0; padding: 0 2px; }
.tile-text b { display: block; font-weight: normal; }
.tile-text small { display: block; color: var(--text-dim); }
/* Tiles selection: one rectangle around the whole label, plus the tinted icon */
.tile[aria-current] .tile-text, .tile[aria-current] .tile-text small { background: var(--sel); color: var(--sel-text); }
/* Thumbnails view */
.thumb { display: flex; flex-direction: column; align-items: center; gap: var(--s1); width: 100%; padding: var(--s1); color: var(--text); text-align: center; }
.thumb-frame { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--edge-line); background: var(--paper); }
.thumb-frame > svg { display: block; width: 100%; height: 100%; }
.thumb:hover .thumb-frame { border-color: var(--edge-input); }
.thumb[aria-current] .thumb-frame { border: 2px solid var(--sel); }
.thumb[aria-current] .thumb-label { background: var(--sel); color: var(--sel-text); }
/* Details (list view) table */
table.listview { width: 100%; border-collapse: collapse; background: var(--pane); }
.listview th {
  padding: 2px var(--s1); text-align: left; font-weight: normal; white-space: nowrap;
  background: linear-gradient(180deg, #FFFFFF, #EBEADB); border-bottom: 2px solid #D6D2C2; border-right: 1px solid var(--edge-line);
}
.listview td { padding: 2px var(--s1); }
.listview tr.sel td { background: var(--sel); color: var(--sel-text); }
.listview tr[data-id], .listview tr[data-n] { cursor: default; }
.listview tr[data-id]:focus-visible { outline: 1px dotted var(--text); outline-offset: -1px; }
.listview .bin-item[aria-current], .listview tr.sel .bin-item { background: none; color: inherit; }
.bin-item { display: inline-flex; align-items: center; gap: var(--s1); padding: 1px 2px; }
.bin-item[aria-current] { background: var(--sel); color: var(--sel-text); }
/* Filmstrip (picture viewer) */
.film { display: block; padding: 2px; border: 2px solid transparent; }
.film > svg, .film > img { display: block; width: 80px; height: 54px; object-fit: cover; }
.v-img > img, .v-img > svg { background: var(--paper); border: 1px solid var(--edge-lo); }
.film[aria-current] { border-color: var(--sel); }

/* ================= Dialogs ================= */
.msgbox { display: flex; gap: var(--s3); align-items: flex-start; }
.msgbox p { margin: 0; }
.mb-actions { display: flex; justify-content: center; gap: var(--s2); margin-top: var(--s3); }
.msgbox p + p { margin-top: var(--s2); }
/* Display Properties: a little monitor showing the picked background */
.dp-monitor { width: 168px; margin: var(--s1) auto var(--s3); padding: 8px 8px 14px; background: linear-gradient(180deg, var(--silver-1), var(--silver-3)); border: 1px solid var(--edge-dk); border-radius: 4px; }
.dp-screen { height: 112px; background: var(--desk) center / cover no-repeat; border: 1px solid var(--edge-dk); }
.dp-screen.center { background-size: auto 86%; }
.tb-note { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s2); background: var(--balloon); border: 1px solid var(--edge-lo); }

/* ================= Wizard ================= */
.wizard { display: flex; flex-direction: column; background: var(--face); }
.wz-page { display: flex; flex-direction: column; }
.wz-hero { display: grid; grid-template-columns: 164px 1fr; background: var(--pane); }
.wz-banner { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--silver-1), var(--silver-3) 55%, var(--silver-2)); }
.wz-banner .sym { position: absolute; left: 50%; top: 22%; width: 220px; height: 220px; transform: translateX(-50%); opacity: .14; }
.wz-banner img { position: absolute; left: 50%; top: 50%; width: 250px; max-width: none; transform: translate(-50%, -50%) rotate(-90deg); }
.wz-hero-body { padding: var(--s3) var(--s3) var(--s3) 20px; }
.wz-hero-body .h { font-family: Verdana, var(--font-ui); }
.wz-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3) var(--s2) 20px; background: var(--pane); border-bottom: 1px solid var(--edge-lo); box-shadow: 0 1px 0 var(--edge-hi); }
.wz-head h2 { margin: 0; font-size: var(--fs); font-weight: bold; }
.wz-head p { margin: 2px 0 0 var(--s3); }
.wz-body { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) var(--s3) var(--s3) 36px; }
.wz-foot { display: flex; justify-content: flex-end; gap: 6px; padding: var(--s2) var(--s3); border-top: 1px solid var(--edge-lo); box-shadow: inset 0 1px 0 var(--edge-hi); }
.wz-foot [data-nav=cancel] { margin-left: var(--s2); }
.wz-review { display: grid; grid-template-columns: 80px 1fr; gap: var(--s1) var(--s3); margin: 0; padding: var(--s2); }
.wz-review dt { color: var(--text-dim); }
.wz-review dd { margin: 0; }

/* ================= Media player (WMP9 silver-blue skin, dark LCD readout) ================= */
.wmp { gap: var(--s2); padding: var(--s2); background: linear-gradient(180deg, #F3F6FB, #D5DEEC 45%, #B9C6DB); }
.wmp-display {
  padding: 6px var(--s2); background: var(--lcd); color: var(--lcd-text); font-family: var(--font-lcd);
  border: 2px solid; border-color: var(--edge-dk) var(--edge-hi) var(--edge-hi) var(--edge-dk);
}
.wmp-row { display: flex; align-items: center; gap: var(--s2); }
.wmp-state { width: 14px; font-size: 18px; line-height: 1; }
.wmp-time { font-size: 38px; line-height: .9; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.wmp-time small { font-size: 20px; color: var(--lcd-dim); }
.wmp-viz { flex: 1; min-width: 0; height: 40px; }
.wmp-title { margin: var(--s1) 0 2px; padding-top: var(--s1); overflow: hidden; white-space: nowrap; font-size: 20px; line-height: 1; border-top: 1px solid var(--lcd-dim); }
.wmp-deck {
  display: flex; flex-direction: column; gap: 6px; padding: 6px var(--s3) var(--s2); border: 1px solid #7A8BA8; border-radius: 6px 6px 18px 18px;
  background: linear-gradient(180deg, #FFFFFF, #E2E9F4 40%, #C3CFE2 75%, #D5DDEA); box-shadow: inset 0 1px #fff, 0 1px 1px rgba(0, 0, 0, .2);
}
/* Seek bar: thin rounded track, green progress (--p), small round thumb. Live streams fill it and hide the thumb. */
.wmp .seek { width: 100%; height: 12px; margin: 0; background: none; -webkit-appearance: none; appearance: none; }
.wmp .seek::-webkit-slider-runnable-track {
  height: 6px; border: 1px solid #6C7FA3; border-radius: 3px; box-shadow: none;
  background: linear-gradient(180deg, #8FE88F, #2FA82F) 0 0 / var(--p, 0%) 100% no-repeat, linear-gradient(180deg, #E9EEF6, #FFFFFF);
}
.wmp .seek::-webkit-slider-thumb {
  width: 12px; height: 12px; margin-top: -4px; border: 1px solid #50628A; border-radius: 50%; transform: none; /* XP.css lifts its own thumb 8px */
  background: radial-gradient(circle at 35% 30%, #FFFFFF, #C9D4E8 60%, #8C9DBF); -webkit-appearance: none; appearance: none;
}
.wmp .seek:disabled::-webkit-slider-thumb { visibility: hidden; }
.wmp-controls { display: flex; align-items: center; gap: 5px; }
/* Round transport buttons: one big Play, smaller Stop / Previous / Next */
.wmp-controls > button {
  display: grid; place-items: center; width: 26px; height: 26px; min-width: 0; min-height: 0; padding: 0; color: #233C6B;
  border: 1px solid #6C7FA3; border-radius: 50%; box-shadow: inset 0 1px #fff, 0 1px 1px rgba(0, 0, 0, .25);
  background: radial-gradient(circle at 50% 25%, #FFFFFF, #DCE4F1 45%, #A9B9D5 85%, #C7D3E6);
}
.wmp-controls > button:not(:disabled):hover { background: radial-gradient(circle at 50% 25%, #FFFFFF, #E8EFFA 45%, #B6C7E4 85%, #D3DEF0); }
.wmp-controls > button:not(:disabled):active { background: radial-gradient(circle at 50% 70%, #FFFFFF, #C9D5E9 50%, #93A6C8); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); }
.wmp-controls > button:disabled { color: var(--text-disabled); }
.wmp-controls > button.wmp-play { width: 40px; height: 40px; margin-right: 3px; border-color: #3E5585; }
.wmp-play svg { width: 16px; height: 16px; }
.wmp-vol { display: flex; align-items: center; gap: var(--s1); margin-left: auto; width: 120px; }
/* Under the LCD: Mixcloud's 60px strip in a sunken frame (never covered, clipped or shrunk),
   the SoundCloud credit, or a "listen on" link */
.wmp-src { flex: none; background: var(--pane); border: 2px solid; border-color: var(--edge-dk) var(--edge-hi) var(--edge-hi) var(--edge-dk); }
.wmp-src p { margin: 0; padding: 2px var(--s1); overflow-wrap: anywhere; }
.mq { display: inline-flex; animation: mq 16s linear infinite; }
.mq span { padding-right: 48px; }
@keyframes mq { to { transform: translateX(-50%); } }
/* Playlist: Winamp-2 density (18px rows), XP list-view colours */
.playlist { display: flex; flex-direction: column; min-height: 0; background: var(--pane); color: var(--text); border: 1px solid var(--edge-input); font-variant-numeric: tabular-nums; }
.pl-head, .pl-row, .pl-foot { display: grid; grid-template-columns: 26px 1fr auto; gap: var(--s1); align-items: center; padding: 0 var(--s1); }
.pl-head { height: 18px; background: linear-gradient(180deg, #FFFFFF, #EBEADB); border-bottom: 2px solid #D6D2C2; }
.pl-rows { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 0; list-style: none; }
.pl-row { width: 100%; height: 18px; color: var(--text); white-space: nowrap; }
.pl-row .pl-t { overflow: hidden; text-overflow: ellipsis; }
.pl-n, .pl-d { text-align: right; }
.pl-row.playing { font-weight: bold; }
.pl-row.sel { background: var(--sel); color: var(--sel-text); }
.pl-row .dot.live { margin-right: 2px; }
.pl-foot { height: 18px; color: var(--text-dim); background: var(--face); border-top: 1px solid var(--edge-line); grid-template-columns: 1fr; text-align: right; }
.wmp-panel > .pane { flex: 1; min-height: 0; }

/* ================= Messenger ================= */
.buddy-me { display: flex; align-items: center; gap: var(--s2); }
.buddy-me b { display: block; }
ul.tree-view.buddies { flex: 1; overflow: auto; }
/* XP trees use only the +/- box: hide the native disclosure triangle. */
ul.tree-view summary { list-style: none; }
/* XP TreeView expander: 9x9 box, 1px grey border, light gradient, 5px glyph drawn to the pixel (not a font +/-). */
ul.tree-view details > summary::before {
  content: ""; box-sizing: border-box; width: 9px; height: 9px; margin-top: 3px; padding: 0; border: 1px solid #919B9C;
  background: linear-gradient(#000, #000) center / 5px 1px no-repeat, linear-gradient(#000, #000) center / 1px 5px no-repeat, linear-gradient(135deg, #fff 30%, #C4C1B5);
}
ul.tree-view details[open] > summary::before { content: ""; background: linear-gradient(#000, #000) center / 5px 1px no-repeat, linear-gradient(135deg, #fff 30%, #C4C1B5); }
ul.tree-view summary::-webkit-details-marker { display: none; }
.buddies summary { font-weight: bold; }
.buddy { display: flex; align-items: center; gap: var(--s1); width: 100%; padding: 1px 2px; white-space: nowrap; overflow: hidden; }
.buddy .mood { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }
.buddy.sel { background: var(--sel); color: var(--sel-text); }
.buddy.sel .mood { color: var(--sel-text); }
.avatar-frame { flex: none; width: 52px; height: 52px; padding: 1px; background: var(--pane); border: 1px solid var(--edge-lo); }
.avatar-frame svg { display: block; width: 100%; height: 100%; }
.chat-log .msg { margin-bottom: var(--s2); }
.msg-who { color: var(--text-dim); }
.msg.me .msg-who { color: var(--luna-dark); }
.msg p { margin: 0 0 0 var(--s2); }
.chat-typing { margin: 0; color: var(--text-dim); }

/* Outlook Express: grey folder banner, blue unread count, bold unread rows, preview header */
.oe-banner { display: flex; align-items: center; gap: var(--s1); height: 24px; padding: 0 var(--s2); background: #808080; color: var(--sel-text); font: bold var(--fs-title) var(--font-ui); }
.oe-unread { color: var(--link); font-weight: normal; }
.oe-side section + section { border-top: 1px solid var(--edge-lo); }
span.tp-link { cursor: default; }
.oe-list tr.unread td { font-weight: bold; }
/* Markdown fields (util.js markdown()): XP body-size headings, long URLs wrap */
.md { overflow-wrap: anywhere; }
.md :is(h1, h2, h3, h4, h5, h6) { margin: 0 0 var(--s1); font: bold 12px var(--font-ui); }
.md img { max-width: 100%; }
.oe-head { margin: 0; padding: var(--s1) var(--s2); background: var(--face); border-bottom: 1px solid var(--edge-lo); }
.oe-head dt { color: var(--text); font-weight: bold; }

/* Log Off dialog: XP's dark-blue bands around a lighter blue body; the desktop greys out behind it. */
.lo { width: 314px; padding: 0; border: 1px solid #00309C; background: #5A7EDC; color: var(--sel-text); }
.lo::backdrop { background: transparent; }
body:has(.lo[open]) :is(#desktop, #taskbar) { filter: grayscale(1); transition: filter 1s; }
.lo-head { margin: 0; padding: 14px var(--s3); background: #00309C; border-bottom: 2px solid #6D8FE8; font: bold 16px var(--font-title); }
.lo-body { display: flex; justify-content: center; gap: 48px; padding: 28px 0 24px; }
.lo-btn { display: flex; flex-direction: column; align-items: center; gap: var(--s1); }
.lo-btn:hover .ico { filter: brightness(1.15); }
.lo-foot { display: flex; justify-content: flex-end; padding: var(--s2) var(--s3); background: #00309C; }

/* Sample content tag (util.js ph()): a small sunken label in list rows and detail headings. */
.ph { display: inline-block; margin-left: 2px; padding: 0 3px; border: 1px solid var(--edge-lo); background: var(--face); color: var(--text-dim); font: normal var(--fs)/13px var(--font-ui); vertical-align: 1px; white-space: nowrap; }

/* ================= Compose, Notepad ================= */
.compose-fields { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s1) var(--s2); }
.compose-fields label { justify-content: flex-end; }
.notepad { padding: 2px var(--s1); font: 13px/1.5 var(--font-mono); white-space: pre-wrap; }
.notepad :is(h1, h2, h3, h4, h5, h6, p) { display: inline; margin: 0; font: inherit; }
.notepad :is(h1, h2, h3, h4, h5, h6) { font-weight: bold; }
.notepad .md { display: contents; }
.notepad.nowrap { white-space: pre; }
.notepad :is(ul, ol) { margin: 0; white-space: normal; } /* Markdown lists in site.about */

/* ================= Content art (flyers, renders, photos) ================= */
.art { display: block; background: var(--paper); border: 1px solid var(--edge-lo); }
.art > svg, .art > img { display: block; width: 100%; height: auto; }
img.pic { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; } /* CMS photo in the art's square */
.fl-x { font-family: "Syncopate", "Arial Black", sans-serif; font-weight: 700; }
.fl-t { font-family: Tahoma, Verdana, sans-serif; font-weight: bold; }
.fl-j { font-family: var(--font-cjk); font-weight: bold; }
.marker { font-family: "Marker Felt", "Comic Sans MS", cursive; }

/* ================= Symbols ================= */
.sym { flex: none; color: var(--ink); vertical-align: middle; }
.spin { animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.sym-list { margin: 0; padding: 0; list-style: none; }
.sym-list li { display: flex; align-items: baseline; gap: var(--s1); }
.sym-list .sym { position: relative; top: 2px; }

/* Touch: 32px rows and tray buttons, 28px caption buttons */
@media (pointer: coarse) {
  .pl-row, .menu button, .sm-item, .buddy, .tp-link, .bin-item { min-height: 32px; }
  .pl-row { height: 32px; }
  .listview td { height: 32px; }
  .window .title-bar { height: 28px; }
  .title-bar-controls button { width: 28px; height: 28px; min-width: 28px; min-height: 28px; background-size: 28px 28px, auto; }
  .tray-btn { justify-content: center; min-width: 32px; height: 100%; }
  .menubar > button { padding: 7px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .mq span + span { display: none; }
}
