/* ---------- Browser chrome ---------- */
.winbody.br { display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.br-bar { flex: none; display: flex; gap: 4px; align-items: center; padding: 5px; background: var(--face); border-bottom: 1px solid #aca899; }
.br-b { padding: 3px 8px; border: 1px solid #8a8870; border-radius: 3px; background: linear-gradient(#fff, #e3dfcf); }
.br-b:disabled { color: #999; }
.br-b[aria-pressed=true] { background: linear-gradient(#cfd9f5, #aebbe6); }
.br-addr { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid #7f9db9; background: #fff; font: 12px Tahoma, sans-serif; user-select: text; }
.br-main { flex: 1; min-height: 0; display: flex; }
.br-frame { position: relative; flex: 1; min-width: 0; background: #fff; }
.br-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.br-side { flex: none; width: 210px; overflow: auto; padding: 6px 8px; background: #f4f6fc; border-left: 1px solid #aca899; }
.br.noside .br-side { display: none; }
.br-side h4 { margin: 8px 0 4px; font-size: 12px; color: #2b4fa6; } .br-side h4:first-child { margin-top: 0; }
.br-side ul { list-style: none; margin: 0; padding: 0; }
.br-link { display: block; width: 100%; text-align: left; padding: 3px 4px; background: none; border: 0; color: #1a3fb0; text-decoration: underline; font: 11.5px Tahoma, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-link:hover { background: #e2ecff; }
.br-h { padding: 1px 0; color: #333; font-size: 11.5px; } .br-hi { opacity: .75; }
.br-status { flex: none; padding: 2px 8px; border-top: 1px solid #aca899; background: var(--face); font-size: 11px; line-height: 1.35; }

/* ---------- Control Panel: XP "category view" ---------- */
.winbody.cp { display: flex; flex-direction: column; overflow: hidden; background: #6375d6; }
/* Menu bar and toolbar (scenery) */
.cp-menu, .cp-tools { flex: none; display: flex; align-items: center; overflow: hidden; white-space: nowrap; background: var(--face); cursor: default; user-select: none; }
.cp-menu { height: 23px; padding-left: 3px; border-bottom: 1px solid #d8d2bd; font-size: 11px; }
.cp-menu span { padding: 0 7px; }
.cp-flag { margin-left: auto; align-self: stretch; display: grid; place-items: center; width: 36px; background: #fff; border-left: 1px solid #d8d2bd; }
.cp-flag svg { width: 20px; height: 20px; }
.cp-tools { height: 36px; gap: 2px; padding: 0 5px; border-bottom: 1px solid #aca899; box-shadow: inset 0 1px 0 #fff; font-size: 11px; }
.cp-tool { display: flex; align-items: center; gap: 4px; padding: 0 4px; }
.cp-tool svg { flex: none; width: 24px; height: 24px; }
.cp-tool.drop::after { content: ''; border: 3px solid transparent; border-top-color: #000; border-bottom: 0; }
.cp-tool.off::after { border-top-color: #999; }
.cp-sep { align-self: stretch; margin: 5px 3px; border-left: 1px solid #c5c2b0; border-right: 1px solid #fff; }
.cp-body { flex: 1; min-height: 0; display: flex; }
/* Left task pane */
.cp-pane { flex: none; width: 176px; padding: 12px; background: linear-gradient(#7ba2e7, #6375d6); display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.cp-box { flex: none; }
.cp-bh { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px 0 11px; border-radius: 5px 5px 0 0; font-weight: bold; font-size: 11px; color: #215dc6; background: linear-gradient(90deg, #fff 45%, #c6d3f7); }
.cp-bb { padding: 9px 11px; display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: #215dc6; background: #d6dff7; border: 1px solid #fff; border-top: 0; }
.cp-chev { flex: none; margin-left: auto; width: 17px; height: 17px; border-radius: 50%; border: 1px solid #b4c1e8; box-shadow: 0 1px 2px rgba(0,30,110,.35);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 17'%3E%3Cpath d='M5 8l3.5-3.5L12 8M5 12.500l3.5-3.5 3.5 3.5' fill='none' stroke='%2300309c' stroke-width='1.6'/%3E%3C/svg%3E") center / 15px no-repeat, #fff; }
.cp-first { margin-top: 8px; }
.cp-first .cp-bh { position: relative; padding-left: 40px; color: #fff; background: linear-gradient(90deg, #0a4bbd, #2a67cf); }
.cp-bico { position: absolute; left: 4px; bottom: 2px; width: 32px; height: 32px; filter: drop-shadow(1px 1px 1px rgba(0,0,0,.35)); }
.cp-guess.ok .cp-bh { color: #fff; background: linear-gradient(90deg, #17661f, #35a64a); }
.cp-guess.bad .cp-bh { color: #fff; background: linear-gradient(90deg, #8c1d16, #d8433a); }
.pips { display: flex; gap: 6px; }
.pip { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #1c3fa8; background: #fff; }
.pip.bad { background: #d8433a; border-color: #8c1d16; } .pip.ok { background: #35a64a; border-color: #17661f; }
/* Category area, with the faded clipboard watermark in its corner */
.cp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: #fff; background: url('../images/control_panel_watermark.svg') right bottom / 270px no-repeat, #6375d6; border-left: 1px solid #8ea6ee; }
.cp-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px 12px 8px; }
.cp-main h2 { margin: 0 0 10px 5px; font: bold 22px 'Franklin Gothic Medium', 'Trebuchet MS', Tahoma, sans-serif; color: #d6dff5; text-shadow: 1px 1px 2px rgba(20,35,110,.45); }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 6px; }
.cp-tile { position: relative; display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 6px 5px; background: none; border: 1px solid transparent; border-radius: 3px; color: #fff; }
.cp-tile:hover:not(:disabled) .cp-txt b { text-decoration: underline; }
.cp-tile:hover:not(:disabled) .cp-ico { filter: brightness(1.12); }
.cp-tile.sel { background: #316ac5; border-color: #cfe0ff; box-shadow: 0 1px 4px rgba(10,25,90,.45); }
.cp-tile:focus-visible { outline: 1px dotted #fff; outline-offset: -3px; }
.cp-tile.rejected { opacity: .55; text-decoration: line-through; }
.cp-tile.rejected .cp-ico { filter: grayscale(1); }
.cp-tile.rejected .cp-mark { text-decoration: none; }
.cp-tile.correct { background: #1f7a34; border-color: #b8f0c2; opacity: 1; }
.cp-tile:disabled { cursor: not-allowed; }
.cp-tile.correct:disabled { cursor: default; }
.cp-ico { flex: none; width: 44px; height: 44px; object-fit: contain; }
.cp-txt { display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 1px rgba(20,35,110,.35); }
.cp-txt b { font-size: 12px; }
.cp-tile.rejected .cp-txt b, .cp-tile.correct .cp-txt b { padding-right: 52px; } /* room for the badge */
.cp-txt span { font-size: 11px; line-height: 1.3; color: #eef2ff; }
.cp-mark { position: absolute; top: 3px; right: 3px; padding: 0 4px; border: 1px solid #000; border-radius: 3px; background: #ffffe1; font-size: 10px; font-weight: bold; color: #7a1b16; text-shadow: none; }
.cp-tile.correct .cp-mark { color: #17661f; }
.cp-fb { margin-top: 12px; padding: 8px 10px; border-radius: 6px; border: 1px solid #000; line-height: 1.4; box-shadow: 2px 2px 4px rgba(0,0,0,.3); }
.cp-fb.bad { background: #ffffe1; color: #7a1b16; }
.cp-rate { flex: none; position: relative; padding: 9px 14px 10px; background: #5265c4; }
.cp-rate::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, #fff, rgba(255,255,255,.15)); }
.cp-rate .muted { color: #e1e7ff; }
.cp-rr { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.cp-rr .xp-btn { flex: none; min-width: 118px; }
/* Rating slider with the current number inside its knob */
.cp-slider { --knob: 24px; position: relative; flex: 1; min-width: 0; height: var(--knob); }
.cp-slider input { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 100%; margin: 0; background: none; cursor: pointer; }
.cp-slider input::-webkit-slider-runnable-track { height: 6px; border: 1px solid #9a9a8c; border-radius: 3px; background: #ecebe2; box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.cp-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: var(--knob); height: var(--knob); margin-top: -10px; border: 1px solid #0a3f8c; border-radius: 50%; background: radial-gradient(circle at 50% 25%, #6fc0ff, #1668d8 55%, #0a46a8); box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.cp-slider input::-moz-range-track { height: 4px; border: 1px solid #9a9a8c; border-radius: 3px; background: #ecebe2; }
.cp-slider input::-moz-range-thumb { box-sizing: border-box; width: var(--knob); height: var(--knob); border: 1px solid #0a3f8c; border-radius: 50%; background: radial-gradient(circle at 50% 25%, #6fc0ff, #1668d8 55%, #0a46a8); }
.cp-slider input:focus-visible { outline: 1px dotted #fff; outline-offset: 2px; }
.cp-slider input:disabled { cursor: default; filter: grayscale(.8); }
.cp-knob { position: absolute; top: 0; left: calc((100% - var(--knob)) * var(--p, .5)); width: var(--knob); line-height: var(--knob); text-align: center; font-weight: bold; color: #fff; text-shadow: 0 1px 1px #052a66; pointer-events: none; }

/* ---------- Task Manager ---------- */
.winbody.tm { background: var(--face); padding: 0 8px 8px; }
.tm-menu { display: flex; gap: 14px; margin: 0 -8px 7px; padding: 3px 12px; border-bottom: 1px solid #d5d2c0; cursor: default; user-select: none; }
.tm-menu span::first-letter { text-decoration: underline; }
.tm-menu span { display: inline-block; }
.tm-tabs { display: flex; gap: 0; padding-left: 4px; }
.tm-tab { padding: 4px 14px; border: 1px solid #919b9c; border-bottom: 0; border-radius: 3px 3px 0 0; background: #f2f0e4; margin-right: -1px; }
.tm-tab.on { background: #fcfcfe; font-weight: bold; position: relative; top: 1px; }
.tm-body { background: #fcfcfe; border: 1px solid #919b9c; padding: 12px; min-height: 280px; display: flex; flex-direction: column; gap: 10px; }
.tm-big { font-size: 19px; font-weight: bold; }
.tm-box p { margin: 4px 0 0; line-height: 1.5; }
.tm-lock { text-align: center; padding: 30px 12px; }

/* Result tab: XP Task Manager "Performance" page, with gauges, comparison graphs and group boxes */
.tm-tab.on[data-tab=result] { box-shadow: inset 0 2px 0 #e68b2c, inset 0 4px 0 #ffc73c; }
.tm-body.xp { background: #fbfaf6; }
.tm-body.xp .tm-box { position: relative; min-width: 0; margin-top: 4px; padding: 12px 10px 9px; border: 1px solid #c3c2ae; border-radius: 4px; box-shadow: 0 1px 0 #fff, inset 0 1px 0 #fff; }
.tm-body.xp .tm-lbl { position: absolute; top: -8px; left: 7px; padding: 0 3px; background: #fbfaf6; color: #0046d5; font-size: 11px; line-height: 15px; white-space: nowrap; }
.tm-perf { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }
.tm-body.xp .tm-perf .tm-box { margin-top: 0; padding: 11px 8px 8px; }
.tm-screen { position: relative; height: 104px; overflow: hidden; border: 2px solid; border-color: #716f64 #fff #fff #716f64; background: #000; color: #00ff40; font: 11px Tahoma, sans-serif; }
.tm-gauge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 3px; }
.tm-bar { position: relative; flex: 1; width: 34px; background: repeating-linear-gradient(to top, #00641e 0 2px, #000 2px 3px); }
.tm-bar i { position: absolute; left: 0; right: 0; bottom: 0; background: repeating-linear-gradient(to top, #00ff40 0 2px, #000 2px 3px); }
.tm-bar::after { content: ''; position: absolute; left: 16px; width: 2px; top: 0; bottom: 0; background: #000; }
.tm-plot { background: linear-gradient(#006b36 1px, transparent 1px) 0 -1px / 100% 13px, linear-gradient(90deg, #006b36 1px, transparent 1px) -1px 0 / 13px 100%, #000; }
.tm-plot svg { display: block; width: 100%; height: 100%; }
.tm-plot polyline { fill: none; stroke: #00ff40; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tm-plot .area { fill: rgba(0,255,64,.2); }
.tm-plot line { stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tm-plot .avg { stroke: #c8ffd4; stroke-dasharray: 3 3; }
.tm-plot .you { stroke: #ffe23a; stroke-width: 2; }
.tm-plot span { position: absolute; transform: translateX(-50%); padding: 0 4px; background: rgba(0,0,0,.75); font-size: 10px; line-height: 15px; white-space: nowrap; }
.tm-avg { top: 2px; color: #c8ffd4; }
.tm-you { bottom: 2px; color: #ffe23a; font-weight: bold; }
.tm-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #ffe23a; box-shadow: 0 0 5px #ffe23a; }
.tm-none { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; }
.tm-verdict { margin-top: 5px; text-align: center; font-weight: bold; }
.tm-perf .tm-box { display: flex; flex-direction: column; }
.tm-perf .tm-screen { flex: 1 0 auto; }
.tm-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tm-score table { width: 100%; border-collapse: collapse; }
.tm-score th { padding: 2px 0; text-align: left; font-weight: normal; }
.tm-score td { padding: 2px 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-score tfoot th, .tm-score tfoot td { padding-top: 5px; border-top: 1px solid #c3c2ae; font-weight: bold; font-size: 14px; }
.tm-share { margin: 0 0 8px; font: 13px 'Segoe UI Emoji', 'Lucida Console', monospace; white-space: pre-wrap; background: #fff; padding: 6px; border: 1px solid #7f9db9; }
.tm-meter { display: inline-flex; gap: 2px; margin-left: 6px; padding: 2px; vertical-align: -3px; border: 1px solid #686868; border-radius: 3px; background: #fff; box-shadow: inset 0 0 2px rgba(0,0,0,.25); }
.tm-meter i { width: 9px; height: 10px; }
.tm-meter i.on { background: linear-gradient(#c4f5c2 0%, #53dc4c 40%, #2ec428 75%, #8fe58a 100%); }

/* Explanation tab: Frutiger Aero sky, bubbles and glass */
.tm-tab.on[data-tab=explanation] { background: #f2fbff; }
.tm-body.aero {
  color: #06365c; font-family: Frutiger, 'Segoe UI', 'Trebuchet MS', Tahoma, sans-serif; box-shadow: inset 0 1px 0 #fff;
  background:
    radial-gradient(circle at 91% 28px, rgba(255,255,255,.95) 0 3px, rgba(255,255,255,.15) 14px, rgba(255,255,255,.8) 22px, transparent 23px),
    radial-gradient(circle at 80% 48px, rgba(255,255,255,.9) 0 1px, rgba(255,255,255,.15) 6px, rgba(255,255,255,.8) 9px, transparent 10px),
    radial-gradient(130% 70px at 15% calc(100% + 14px), #8fd63f 0 55%, transparent 57%),
    radial-gradient(120% 60px at 90% calc(100% + 12px), #b9ea6a 0 60%, transparent 62%),
    linear-gradient(#f2fbff 0%, #bfe6fb 30%, #84c8f2 55%, #b5e4f8 80%, #e0f8d8 100%);
}
.tm-body.aero .tm-box {
  flex: none; padding: 0 10px 9px; border: 1px solid #4c93c4; border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 3px 8px rgba(0,50,90,.28);
}
.tm-body.aero .tm-lbl {
  position: relative; margin: 0 -10px 6px; padding: 4px 10px; font-size: 12.5px; font-weight: bold; color: #fff; text-shadow: 1px 1px 1px #0a1c6b;
  background: linear-gradient(#3fa9ff 0%, #0a68ee 45%, #0054d6 60%, #1b86f5 100%);
}
.tm-src { margin-top: 6px; padding: 5px 9px; border: 1px solid #a9d3ee; border-radius: 12px; background: linear-gradient(#fff, #e4f4ff 55%, #f2faff); box-shadow: inset 0 1px 0 #fff; }
.tm-src:hover { border-color: #5aa52c; background: linear-gradient(#f6ffe9, #d8f5b4 55%, #e8fbd2); }
.tm-src a { color: #0a55b5; font-weight: bold; overflow-wrap: anywhere; }
.tm-body.aero .tm-lbl::after { /* gloss */
  content: ''; position: absolute; left: 3px; right: 3px; top: 2px; height: 42%; border-radius: 8px 8px 40% 40% / 8px 8px 8px 8px;
  background: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.08)); pointer-events: none;
}

/* ---------- Widgets ---------- */
/* Shared glossy Frutiger Aero body and glass screen */
.winbody.clk, .winbody.mp {
  padding: 6px; color: #06365c;
  background: linear-gradient(#f2fbff 0%, #bfe6fb 46%, #84c8f2 50%, #a6dcf6 80%, #c9f3d9 100%);
  box-shadow: inset 0 1px 0 #fff;
}
.clk-face, .mp-screen {
  position: relative; border: 1px solid #0b4f86; border-radius: 6px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 110%, #0d6f8f 0%, #06294a 55%, #020b1c 100%);
  box-shadow: inset 0 0 8px rgba(0,0,0,.8), 0 1px 0 #fff;
}
.clk-face::after, .mp-screen::after { /* glass shine */
  content: ''; position: absolute; left: 1px; right: 1px; top: 1px; height: 42%; border-radius: 5px 5px 60% 60% / 5px 5px 14px 14px;
  background: linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,.05)); pointer-events: none;
}

/* Alarm Clock */
.clk-face { padding: 5px 6px 4px; text-align: center; }
.clk-led { font: bold 32px/36px 'Lucida Console', monospace; letter-spacing: 2px; color: #e6fdff; text-shadow: 0 0 4px #38d6ff, 0 0 12px #1c93e0; }
.clk-cap { font: bold 11px 'Trebuchet MS', Tahoma, sans-serif; color: #9dff8a; text-shadow: 0 0 6px #3fbf2a; }

/* Media Player */
.winbody.mp { display: flex; flex-direction: column; gap: 5px; }
.mp-screen { padding: 3px 6px 2px; }
.mp-title { font: bold 11px 'Trebuchet MS', Tahoma, sans-serif; color: #fff; text-shadow: 0 0 6px #38d6ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-title span { font-weight: normal; color: #9fe8ff; }
.mp-viz { display: block; width: 100%; height: 46px; }
.mp-ctl { display: flex; align-items: center; gap: 6px; }
.mp-btn {
  position: relative; flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  color: #fff; border: 1px solid #0a4f8c;
  background: radial-gradient(circle at 50% 100%, #8ff0ff 0%, #1c93e0 45%, #0b4fa8 100%);
  box-shadow: 0 0 0 2px rgba(255,255,255,.75), 0 2px 4px rgba(0,50,90,.45);
}
.mp-btn::after { content: ''; position: absolute; left: 15%; right: 15%; top: 4%; height: 44%; border-radius: 50%; background: linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.1)); pointer-events: none; }
.mp-btn svg { width: 13px; height: 13px; fill: currentColor; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.mp-btn svg .ln { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.mp-btn.mp-play { width: 32px; height: 32px; margin-left: 2px; border-color: #2c6b12; background: radial-gradient(circle at 50% 100%, #e4ff8a 0%, #5cc21f 45%, #23780f 100%); }
.mp-play svg { width: 15px; height: 15px; }
.mp-btn:hover { filter: brightness(1.12); }
.mp-btn:active { transform: translateY(1px); }
.mp-btn:focus-visible { outline: 2px solid #f8b636; outline-offset: 3px; }
.mp-vol { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; margin: 0 4px 0 4px; font-size: 11px; font-weight: bold; text-shadow: 0 1px 0 #fff; }
.mp-vol input { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 16px; margin: 0; background: none; cursor: pointer; }
.mp-vol input::-webkit-slider-runnable-track {
  height: 7px; border: 1px solid #1d6aa3; border-radius: 4px; box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
  background: linear-gradient(rgba(255,255,255,.55), transparent 55%), linear-gradient(90deg, #36c1f0, #7be03a) 0 0 / var(--fill, 60%) 100% no-repeat, #e9f6ff;
}
.mp-vol input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4px; border: 1px solid #0a4f8c; border-radius: 50%;
  background: radial-gradient(circle at 50% 25%, #fff 0%, #cdeeff 35%, #3a9fe0 100%); box-shadow: 0 1px 3px rgba(0,40,80,.5);
}
.mp-vol input::-moz-range-track { height: 5px; border: 1px solid #1d6aa3; border-radius: 4px; background: #e9f6ff; }
.mp-vol input::-moz-range-progress { height: 5px; border-radius: 4px; background: linear-gradient(90deg, #36c1f0, #7be03a); }
.mp-vol input::-moz-range-thumb { width: 11px; height: 11px; border: 1px solid #0a4f8c; border-radius: 50%; background: radial-gradient(circle at 50% 25%, #fff, #3a9fe0); }
.mp-vol input:focus-visible { outline: 1px dotted #06365c; }

/* ---------- Info windows ---------- */
.winbody.doc { padding: 12px 16px; background: #fffff2; line-height: 1.5; }
.doc h2 { margin: 0 0 6px; color: #2b4fa6; font-size: 17px; } .doc h3 { margin: 12px 0 4px; font-size: 13px; }
.doc .note { background: #fff0b8; border: 1px solid #d9b630; padding: 6px 8px; border-radius: 4px; }
.doc code { background: #eee; padding: 0 3px; }
.doc li { margin-bottom: 4px; }
