/* xp.css — the 2009 client's controls (Windows XP, Luna Silver), drawn from the reference screenshot. */
:root {
  --face: #E6E5EB;
  --face-hi: #F1F0F4;
  --face-lo: #D7D6DE;
  --frame: #B9B8C8;
  --frame-dark: #7A8296;
  --field-border: #A5ACB5;
  --edge: #919B9C;
  --ink: #000;
  --ink-soft: #55555F;
  --hi: #B2B4BF;
  --hot: #F7B74C;
  --hot-dark: #E5970F;
  --tab-hot: #FFC83C;
  --tab-line: #E68B2C;
  --focus-ring: #9EB8E8;
  --link: #0000BB;
  --link-hot: #C8340E;
  --link-press: #7A0E00;
  --ok: #3BD23B;
  --ui: 13px/1.38 Tahoma, Verdana, "DejaVu Sans", "Segoe UI", sans-serif;
  --caption: 700 15px/1 "Trebuchet MS", "Lucida Grande", Tahoma, sans-serif;
  --mono: 13px/1.45 "Lucida Console", "Courier New", monospace;
  --ease-zoom: cubic-bezier(.2, .75, .25, 1);
  --taskbar-h: 34px;
}

/* ---------- window frame ---------- */
.win {
  position: relative;
  background: var(--face);
  border: 1px solid var(--frame-dark);
  border-top: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 0 0 3px #DCDCE6 inset, 0 12px 40px rgba(10, 12, 30, .35), 0 2px 6px rgba(10, 12, 30, .25);
  padding: 0 4px;
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  margin: 0 -4px;
  padding: 0 6px 0 9px;
  border: 1px solid var(--frame-dark);
  border-bottom: 1px solid #A4A3B5;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(#FFFFFF 0, #F7F7FA 12%, #E9E9EF 45%, #DEDEE6 72%, #D2D2DC 100%);
  box-shadow: inset 0 1px 0 #fff, inset 1px 0 0 #fff;
  user-select: none;
}
.titlebar .ico { width: 18px; height: 18px; flex: none; }
.titlebar .title {
  font: var(--caption);
  margin: 0;
  color: #111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.titlebar .title small { font: inherit; font-weight: 400; color: #3A3A48; }
.is-inactive .titlebar { background: linear-gradient(#FBFBFD, #EEEEF2 50%, #E4E4EA); }
.is-inactive .titlebar .title { color: #7A7A88; }

.capbtns { display: flex; gap: 2px; margin-left: auto; flex: none; }
.capbtn {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 4px;
  background: linear-gradient(#FDFDFF, #E9EBF2 45%, #D3D7E3 80%, #C3C8D8);
  box-shadow: 0 0 0 1px #8E93A8, inset 0 -2px 3px rgba(120, 128, 160, .35);
  color: #33334A;
  padding: 0;
  cursor: default;
  transition: filter .08s linear, background .08s linear;
}
.capbtn svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.capbtn:hover { background: linear-gradient(#FFFFFF, #F4F6FB 45%, #E2E6F1 80%, #D6DBEA); box-shadow: 0 0 0 1px #6E7594, inset 0 0 0 1px #FFE7B0, inset 0 -2px 3px rgba(229, 151, 15, .35); }
.capbtn:active { background: linear-gradient(#B8BDCD, #CDD1DD 50%, #E5E7EE); box-shadow: 0 0 0 1px #6E7594, inset 0 2px 3px rgba(40, 44, 70, .45); }
.capbtn.close {
  background: linear-gradient(#F4A58B, #E66A47 35%, #D24B26 70%, #C5401F);
  box-shadow: 0 0 0 1px #8E3A22, inset 0 -2px 3px rgba(120, 20, 0, .35);
  color: #fff;
}
.capbtn.close svg { stroke-width: 2.4; }
.capbtn.close:hover { background: linear-gradient(#FFC2AA, #F2825D 35%, #E05E35 70%, #D24E28); box-shadow: 0 0 0 1px #8E3A22, inset 0 0 0 1px #FFE0C8; }
.capbtn.close:active { background: linear-gradient(#A8361A, #C24624 50%, #DA5D38); box-shadow: 0 0 0 1px #6E2812, inset 0 2px 3px rgba(60, 0, 0, .5); }

/* ---------- menu bar ---------- */
.menubar {
  display: flex;
  gap: 0;
  margin: 0 -3px;
  padding: 2px 4px;
  background: var(--face-hi);
  border-bottom: 1px solid #D8D7DF;
  position: relative;
}
.menubar > li { list-style: none; position: relative; }
.menu-title {
  font: var(--ui);
  color: var(--ink);
  background: none;
  border: 1px solid transparent;
  padding: 2px 8px;
  cursor: default;
  border-radius: 0;
}
.menu-title:hover { background: #fff; border-color: var(--hi); box-shadow: inset 0 -2px 0 var(--hi); }
.menu-title:active,
.menu-title[aria-expanded="true"] { background: var(--hi); border-color: #8E90A0; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18); }
u.ak { text-decoration: underline; text-underline-offset: 2px; }

.menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  z-index: 60;
  min-width: 228px;
  margin: 0;
  padding: 2px;
  list-style: none;
  background: #fff;
  border: 1px solid #8E8E9E;
  box-shadow: 2px 2px 3px rgba(0, 0, 0, .32);
  animation: menu-in .16s linear;
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; } }
.menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: var(--ui);
  color: var(--ink);
  text-align: left;
  background: none;
  border: 0;
  padding: 4px 24px 4px 8px;
  cursor: default;
}
.menu button .chk { width: 14px; text-align: center; flex: none; }
.menu button .kbd { margin-left: auto; color: #555; padding-left: 18px; }
.menu button:hover,
.menu button:focus-visible { background: var(--hi); outline: 0; box-shadow: inset 3px 0 0 #8E90A0; }
.menu button:active { background: #9C9FAE; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.menu hr { border: 0; border-top: 1px solid #C5C5CF; margin: 3px 2px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px 4px 4px; }
.tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: var(--ui);
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 4px 9px 4px 6px;
  cursor: default;
  transition: background .06s linear;
}
.tool svg { width: 26px; height: 26px; flex: none; }
.tool:hover { background: linear-gradient(#FFFFFF, #F5F5F8 50%, #E8E8EE); border-color: #A9A9BA; box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(255, 255, 255, .8); }
.tool:active,
.tool[aria-pressed="true"] { background: linear-gradient(#CFCFDA, #DEDEE6 50%, #E9E9EF); border-color: #8A8A9E; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .25); }
.tool:active > *,
.tool[aria-pressed="true"] > * { transform: translate(1px, 1px); }

/* ---------- push button ---------- */
.btn {
  font: var(--ui);
  color: var(--ink);
  min-height: 27px;
  padding: 3px 14px;
  border: 1px solid #4D5470;
  border-radius: 3px;
  background: linear-gradient(#FFFFFF, #F6F6F8 40%, #E9E9EF 80%, #D8D8E2);
  box-shadow: inset 0 0 0 1px #fff;
  cursor: default;
  white-space: nowrap;
  transition: box-shadow .08s linear;
}
.btn.default,
.btn:focus-visible { box-shadow: inset 0 0 0 1px #CEE1FB, inset 0 0 0 2px var(--focus-ring); outline: 0; }
.btn:hover { box-shadow: inset 0 0 0 1px #FFF0CF, inset 0 -2px 0 1px var(--hot-dark), inset 0 0 0 3px var(--hot); }
.btn:active { background: linear-gradient(#D2D2DC, #E0E0E8 45%, #EEEEF2); box-shadow: inset 0 2px 3px rgba(40, 40, 70, .35); }
.btn:active > * { position: relative; top: 1px; left: 1px; }
.btn:disabled { color: #A3A3AE; border-color: #C6C6D0; background: #F2F2F5; box-shadow: none; }
.btn.big { min-height: 32px; padding: 5px 18px; font-weight: 700; }

/* ---------- fields ---------- */
.field {
  font: var(--ui);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-border);
  min-height: 26px;
  padding: 3px 6px;
  border-radius: 0;
}
input.field:hover, select.field:hover { border-color: var(--hot-dark); box-shadow: inset 0 0 0 1px #FFE7B0, 0 0 0 1px #FFE7B0; }
input.field:focus, select.field:focus { outline: 0; border-color: #2155B8; box-shadow: inset 0 0 0 2px #CFE0F7; background: #FBFDFF; }
output.field, .field.ro { display: inline-flex; align-items: center; }
.field.num { justify-content: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
select.field { padding-right: 24px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 22'%3E%3Cdefs%3E%3ClinearGradient id='a' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FDFDFF'/%3E%3Cstop offset='1' stop-color='%23C9CDDA'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='.5' y='.5' width='16' height='21' rx='2' fill='url(%23a)' stroke='%238E93A8'/%3E%3Cpath d='M5 9l3.5 4L12 9' fill='none' stroke='%2333334A' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 1px center / 17px calc(100% - 2px); }
select.field:hover { border-color: var(--hot-dark); }

/* ---------- checkbox ---------- */
.chk-box { display: inline-flex; align-items: center; gap: 7px; cursor: default; }
.chk-box input {
  appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1px solid #4D5470;
  background: linear-gradient(135deg, #DCDCE4, #fff);
  display: grid;
  place-items: center;
  flex: none;
}
.chk-box input:hover { box-shadow: inset 0 0 0 2px var(--hot); }
.chk-box input:active { background: linear-gradient(135deg, #B9B9C6, #E6E6EC); }
.chk-box input:checked::after { content: ""; width: 8px; height: 4px; border: solid #21A121; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.chk-box input:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }

/* ---------- trackbar ---------- */
input[type="range"].track { appearance: none; width: 100%; height: 26px; background: transparent; cursor: default; }
input[type="range"].track::-webkit-slider-runnable-track { height: 4px; background: #F4F4F8; border: 1px solid #9C9CAE; border-bottom-color: #fff; border-right-color: #fff; box-shadow: inset 1px 1px 0 #808090; }
input[type="range"].track::-webkit-slider-thumb { appearance: none; width: 11px; height: 21px; margin-top: -10px; border: 1px solid #4D5470; border-radius: 2px 2px 5px 5px; background: linear-gradient(#FFFFFF, #E3E3EC 60%, #C9C9D6); box-shadow: inset 0 -2px 0 #21A121; }
input[type="range"].track:hover::-webkit-slider-runnable-track { background: #FFF0CF; border-color: var(--hot-dark); box-shadow: inset 1px 1px 0 #E5970F, 0 0 0 2px #FFE7B0; }
input[type="range"].track:hover::-webkit-slider-thumb { box-shadow: inset 0 -2px 0 var(--hot-dark), 0 0 0 1px var(--hot); }
input[type="range"].track:active::-webkit-slider-thumb { background: linear-gradient(#C9C9D6, #E3E3EC); }
input[type="range"].track::-moz-range-track { height: 4px; background: #F4F4F8; border: 1px solid #9C9CAE; }
input[type="range"].track::-moz-range-thumb { width: 10px; height: 20px; border: 1px solid #4D5470; border-radius: 2px; background: linear-gradient(#FFFFFF, #C9C9D6); }
input[type="range"].track:focus-visible { outline: 1px dotted #000; }

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 6px 6px 0;
  background: var(--face);
  border-bottom: 1px solid var(--edge);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  top: 1px;
  flex: none;
  font: var(--ui);
  color: var(--ink);
  text-decoration: none;
  padding: 3px 11px 3px;
  margin-right: -1px;
  border: 1px solid var(--edge);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#FFFFFF, #F5F4F8 55%, #E8E7EF);
  cursor: default;
  transition: padding .08s linear, margin .08s linear;
}
.tab:hover { border-top-color: var(--tab-line); box-shadow: inset 0 2px 0 var(--tab-hot), inset 1px 0 0 #fff; padding-top: 5px; margin-top: -2px; }
.tab:active { background: #E2E1EA; }
.tab[aria-current="true"] {
  z-index: 1;
  padding: 5px 13px 4px;
  margin: -3px 1px 0 -2px;
  background: #FCFCFE;
  border-top-color: var(--tab-line);
  box-shadow: inset 0 2px 0 var(--tab-hot);
}
.tab:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ---------- list view ---------- */
.lv-wrap { background: #fff; border: 1px solid #828790; overflow: auto; }
.lv { width: 100%; border-collapse: separate; border-spacing: 0; font: var(--ui); font-variant-numeric: tabular-nums; }
.lv th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  padding: 4px 8px 4px;
  background: linear-gradient(#FFFFFF, #F6F6F9 55%, #ECECF1);
  border-bottom: 1px solid #D5D5DD;
  box-shadow: inset 0 -2px 0 #E4E4EA, inset -1px 0 0 #D5D5DD, inset -2px 0 0 #fff;
}
.lv td { padding: 3px 8px; vertical-align: top; }
.lv .r { text-align: right; }
.lv .c { text-align: center; }
.lv tbody tr:hover td { background: #EFF0F5; }
.lv tbody tr:active td,
.lv tbody tr[aria-selected="true"] td { background: var(--hi); }
.lv .muted td { color: #7C7C88; }
.lv b { font-weight: 700; }
.lv tfoot td { font-weight: 700; border-top: 1px solid #D5D5DD; }

/* ---------- group box, progress, status bar ---------- */
fieldset.group { border: 1px solid #C9C8D3; border-radius: 4px; padding: 10px 12px 12px; margin: 0; min-width: 0; }
fieldset.group > legend { color: #0046D5; padding: 0 4px; }
.pb { height: 18px; border: 1px solid #6E6E80; border-radius: 3px; background: #fff; padding: 2px; box-shadow: inset 0 0 0 1px #fff; overflow: hidden; }
.pb > i {
  display: block;
  height: 100%;
  width: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, #fff 8px 10px),
    linear-gradient(#ACEDAD, #7BE47D 20%, #4AD94D 45%, #36D33A 55%, #53DA56 75%, #8BE58D 90%, #ACEDAD);
  transition: width 1.1s steps(14, end);
}
.pb.is-in > i { width: var(--v); }
.pb.gold > i { background: repeating-linear-gradient(90deg, transparent 0 8px, #fff 8px 10px), linear-gradient(#FFE9A6, #F8CF4E 30%, #E9AE12 55%, #F2C23C 80%, #FFE19A); }
.pb.gray > i { background: repeating-linear-gradient(90deg, transparent 0 8px, #fff 8px 10px), linear-gradient(#E9E9EF, #C3C4D0 45%, #A9AABB 55%, #CACBD6); }

.statusbar {
  position: sticky;
  bottom: var(--taskbar-h);
  z-index: 30;
  display: flex;
  align-items: stretch;
  height: 27px;
  margin: 0 -4px;
  padding-top: 2px;
  background: var(--face);
  border-top: 1px solid #fff;
  box-shadow: 0 -1px 0 #C4C3CC;
}
.statusbar > span { display: flex; align-items: center; gap: 6px; padding: 0 12px; white-space: nowrap; border-left: 1px solid #C4C3CC; box-shadow: inset 1px 0 0 #fff; font-variant-numeric: tabular-nums; }
.statusbar > span:first-child { flex: 1 1 auto; border-left: 0; box-shadow: none; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.statusbar .grip { width: 16px; padding: 0; border: 0; box-shadow: none; background: radial-gradient(circle at 1.5px 1.5px, #9C9CAE 1px, transparent 1.4px) right 2px bottom 2px / 4px 4px no-repeat; }

/* ---------- dialogs, balloons ---------- */
.dlg { position: fixed; z-index: 70; width: min(440px, calc(100vw - 24px)); padding-bottom: 4px; border-radius: 8px; }
.dlg[hidden] { display: none; }
.dlg .titlebar { cursor: move; }
.dlg-body { padding: 14px 12px 8px; display: grid; gap: 10px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 12px 10px; }
.dlg.is-opening { animation: win-open .22s var(--ease-zoom); }
@keyframes win-open { from { opacity: 0; transform: scale(.94); } }

.balloon {
  position: fixed;
  z-index: 80;
  right: 12px;
  bottom: calc(var(--taskbar-h) + 14px);
  width: min(340px, calc(100vw - 24px));
  padding: 9px 30px 11px 12px;
  background: #FFFFE1;
  border: 1px solid #000;
  border-radius: 9px;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, .3);
  animation: balloon-in .32s var(--ease-zoom);
}
.balloon::after { content: ""; position: absolute; right: 34px; bottom: -13px; width: 18px; height: 13px; background: #FFFFE1; clip-path: polygon(0 0, 100% 0, 100% 100%); border-right: 1px solid #000; }
.balloon b { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.balloon b svg { width: 16px; height: 16px; }
.balloon .x { position: absolute; top: 6px; right: 6px; width: 17px; height: 17px; border: 1px solid transparent; border-radius: 3px; background: none; font: 700 11px/1 Tahoma, sans-serif; color: #555; padding: 0; cursor: default; }
.balloon .x:hover { border-color: #ACA899; background: #fff; color: #000; }
.balloon .x:active { background: #E2E0D2; }
.balloon.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .25s linear, transform .25s var(--ease-zoom); }
@keyframes balloon-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* ---------- links ---------- */
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hot); text-decoration-thickness: 2px; background: #FFF3D6; box-shadow: 0 0 0 2px #FFF3D6; }
a:active { color: var(--link-press); background: #FFE2A6; box-shadow: 0 0 0 2px #FFE2A6; }
a:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
button:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ---------- XP scrollbars (Blink/WebKit) ---------- */
::-webkit-scrollbar { width: 17px; height: 17px; }
::-webkit-scrollbar-track { background: linear-gradient(90deg, #EEEDE5, #F7F7F4 30%, #F3F3EE); }
::-webkit-scrollbar-thumb { border: 1px solid #9A9AAE; border-radius: 3px; background: linear-gradient(90deg, #F4F4F8, #DCDCE6 50%, #CBCBD8) padding-box, repeating-linear-gradient(transparent 0 2px, #8C8CA0 2px 3px) center / 7px 9px no-repeat; background-blend-mode: normal; box-shadow: inset 1px 1px 0 #fff; }
::-webkit-scrollbar-thumb:hover { border-color: var(--hot-dark); }
::-webkit-scrollbar-button:single-button { display: block; height: 17px; width: 17px; border: 1px solid #9A9AAE; border-radius: 3px; background: linear-gradient(90deg, #F8F8FB, #D9D9E3); }
::-webkit-scrollbar-corner { background: var(--face); }
html { scrollbar-color: #C9C9D6 #F0F0EB; }
