/* ==========================================================================
   chrome.css — Windows XP + Internet Explorer 6 window chrome
   Everything here draws the *browser*, not the page inside it.
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: #3a6ea5;
  background: linear-gradient(180deg, #4a7fb5 0%, #3a6ea5 55%, #2f5c8c 100%);
  font-family: Tahoma, "Segoe UI", Geneva, Verdana, sans-serif;
  font-size: 11px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Hide the raw page until chrome.js has wrapped it in the window. */
html.chrome-pending body > * { visibility: hidden; }

/* ---------------------------------------------------------------- window -- */

.ie-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1010px, 96vw);
  height: min(742px, 94vh);
  display: flex;
  flex-direction: column;
  background: #ece9d8;
  border: 1px solid #0831d9;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  overflow: hidden;
}

.ie-window.is-max {
  top: 0; left: 0;
  transform: none;
  width: 100vw; height: 100vh;
  border-radius: 0;
  border-width: 0;
}

.ie-window.is-min {
  transform: translate(-50%, -50%) scale(.06);
  opacity: 0;
  transition: transform .22s ease-in, opacity .22s ease-in;
  pointer-events: none;
}

.ie-window.anim-restore {
  transition: transform .2s ease-out, opacity .2s ease-out;
}

/* -------------------------------------------------------------- titlebar -- */

.ie-titlebar {
  flex: 0 0 auto;
  height: 27px;
  display: flex;
  align-items: center;
  padding: 0 3px 0 4px;
  background: linear-gradient(180deg,
    #0058ee 0%, #3f8cf3 4%, #298bfd 8%, #1173f7 20%,
    #0d6dee 45%, #0a63d8 76%, #0954c4 90%, #0b4fbb 96%, #0f4bb0 100%);
  border-bottom: 1px solid #0736a8;
  cursor: default;
  user-select: none;
}

.ie-titlebar .tb-icon {
  width: 16px; height: 16px;
  margin: 0 3px 0 1px;
  flex: 0 0 16px;
}

.ie-titlebar .tb-text {
  flex: 1 1 auto;
  color: #fff;
  font: bold 11px Tahoma, "Segoe UI", sans-serif;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .1px;
}

.ie-winbtns { display: flex; gap: 2px; flex: 0 0 auto; }

.ie-winbtns button {
  width: 21px; height: 21px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 -6px 6px -4px rgba(0, 0, 0, .3);
  background: linear-gradient(180deg, #5db1ff 0%, #338bf5 40%, #0d63d8 55%, #2d8bf0 100%);
}
.ie-winbtns button.wb-close {
  width: 33px;
  background: linear-gradient(180deg, #f2a08d 0%, #e2593b 40%, #c8341a 55%, #ef7d5f 100%);
}
.ie-winbtns button:hover { filter: brightness(1.15); }
.ie-winbtns button:active { filter: brightness(.85); }

/* glyphs drawn with pseudo-elements so no images are needed */
.ie-winbtns button::before,
.ie-winbtns button::after {
  content: "";
  position: absolute;
  background: #fff;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
}
.wb-min::before { left: 5px; bottom: 4px; width: 9px; height: 3px; }
.wb-max::before {
  left: 4px; top: 4px; width: 11px; height: 9px;
  background: none; border: 2px solid #fff; border-top-width: 4px;
}
.wb-close::before,
.wb-close::after {
  left: 14px; top: 3px; width: 3px; height: 13px;
}
.wb-close::before { transform: rotate(45deg); }
.wb-close::after  { transform: rotate(-45deg); }

/* -------------------------------------------------------------- menu bar -- */

.ie-menubar {
  flex: 0 0 auto;
  height: 21px;
  display: flex;
  align-items: stretch;
  background: #ece9d8;
  border-bottom: 1px solid #d6d2c2;
  user-select: none;
}

.ie-menu {
  padding: 0 7px;
  display: flex;
  align-items: center;
  font: 11px Tahoma, sans-serif;
  color: #000;
  cursor: default;
  position: relative;
}
.ie-menu u { text-decoration: underline; }
.ie-menu:hover,
.ie-menu.open { background: #316ac5; color: #fff; }

.ie-menubar .mb-spacer { flex: 1 1 auto; }

.ie-menubar .mb-brand {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #d6d2c2;
  background: linear-gradient(180deg, #fdfdf9, #ece9d8);
}

/* dropdown menus */
.ie-dropdown {
  position: absolute;
  z-index: 60;
  min-width: 176px;
  padding: 2px;
  background: #fff;
  border: 1px solid #aca899;
  box-shadow: 2px 2px 3px rgba(0, 0, 0, .3);
  font: 11px Tahoma, sans-serif;
  display: none;
}
.ie-dropdown.open { display: block; }
.ie-dropdown .dd-item {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 3px 18px 3px 22px;
  color: #000;
  cursor: default;
  white-space: nowrap;
}
.ie-dropdown .dd-item:hover { background: #316ac5; color: #fff; }
.ie-dropdown .dd-item.disabled { color: #aca899; }
.ie-dropdown .dd-item.disabled:hover { background: transparent; color: #aca899; }
.ie-dropdown .dd-item .dd-key { color: #808080; }
.ie-dropdown .dd-item:hover .dd-key { color: #d8e2f5; }
.ie-dropdown .dd-item.disabled .dd-key { color: #cdc9bd; }
.ie-dropdown .dd-sep {
  height: 1px;
  margin: 3px 2px 3px 22px;
  background: #d6d2c2;
  border-bottom: 1px solid #fff;
}

/* ----------------------------------------------------- information bar --
   The XP-era IE "Information Bar" — pale yellow strip under the menu.
   Used here, honestly, as the work-in-progress notice.                    */

.ie-infobar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 6px;
  background: linear-gradient(180deg, #fdfbd6 0%, #f7f3b8 100%);
  border-top: 1px solid #fffef0;
  border-bottom: 1px solid #d9d08a;
  font: 11px Tahoma, "Segoe UI", sans-serif;
  color: #3a3300;
  cursor: default;
  user-select: none;
}
.ie-infobar.hide { display: none; }
.ie-infobar .ib-icon { flex: 0 0 16px; height: 16px; }
.ie-infobar .ib-text { flex: 1 1 auto; }
.ie-infobar .ib-text b { font-weight: bold; }
.ie-infobar .ib-text a { color: #0000cc; }
.ie-infobar .ib-x {
  flex: 0 0 auto;
  width: 17px; height: 15px;
  margin-left: 4px;
  padding: 0;
  font: 11px Tahoma, sans-serif;
  line-height: 1;
  color: #333;
  background: linear-gradient(180deg, #fff, #ece9d8);
  border: 1px solid #b7b291;
  border-radius: 2px;
  cursor: pointer;
}
.ie-infobar .ib-x:hover { border-color: #e9a33a; }

/* --------------------------------------------------------- client + page -- */

.ie-client {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border-top: 1px solid #91918c;
  border-left: 1px solid #91918c;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  background: #fff;
  position: relative;
}

.ie-viewport {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  overflow-x: auto;
  background: #fff;
}

/* --- classic Windows scrollbar ------------------------------------------- */
.ie-viewport::-webkit-scrollbar { width: 16px; height: 16px; }
.ie-viewport::-webkit-scrollbar-track {
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='2' height='2'><rect width='1' height='1' fill='%23d4d0c8'/><rect x='1' y='1' width='1' height='1' fill='%23d4d0c8'/></svg>");
}
.ie-viewport::-webkit-scrollbar-thumb {
  background: #d4d0c8;
  border: 1px solid #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  box-shadow: inset -1px -1px 0 #808080;
}
.ie-viewport::-webkit-scrollbar-corner { background: #d4d0c8; }
.ie-viewport::-webkit-scrollbar-button:single-button {
  display: block;
  height: 16px; width: 16px;
  background-color: #d4d0c8;
  background-repeat: no-repeat;
  background-position: center 5px;
  border: 1px solid #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  box-shadow: inset -1px -1px 0 #808080;
}
.ie-viewport::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='4'><path d='M3.5 0 7 4H0z' fill='%23000'/></svg>");
}
.ie-viewport::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='4'><path d='M3.5 4 0 0h7z' fill='%23000'/></svg>");
}
.ie-viewport::-webkit-scrollbar-button:single-button:horizontal:decrement {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='7'><path d='M0 3.5 4 0v7z' fill='%23000'/></svg>");
}
.ie-viewport::-webkit-scrollbar-button:single-button:horizontal:increment {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='7'><path d='M4 3.5 0 7V0z' fill='%23000'/></svg>");
}

/* ------------------------------------------------------------ status bar -- */

.ie-statusbar {
  flex: 0 0 auto;
  height: 21px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 2px;
  background: #ece9d8;
  user-select: none;
}

.ie-statusbar .sb-panel {
  display: flex;
  align-items: center;
  padding: 0 4px;
  font: 11px Tahoma, sans-serif;
  color: #000;
  border-top: 1px solid #9c9c93;
  border-left: 1px solid #9c9c93;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  overflow: hidden;
  white-space: nowrap;
}
.ie-statusbar .sb-main { flex: 1 1 auto; position: relative; }
.ie-statusbar .sb-zone { flex: 0 0 108px; gap: 4px; }
.ie-statusbar .sb-grip {
  flex: 0 0 14px;
  align-self: flex-end;
  height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12'><g fill='%23fff'><rect x='8' y='2' width='2' height='2'/><rect x='5' y='5' width='2' height='2'/><rect x='8' y='5' width='2' height='2'/><rect x='2' y='8' width='2' height='2'/><rect x='5' y='8' width='2' height='2'/><rect x='8' y='8' width='2' height='2'/></g><g fill='%23a0a0a0'><rect x='9' y='3' width='1' height='1'/><rect x='6' y='6' width='1' height='1'/><rect x='9' y='6' width='1' height='1'/><rect x='3' y='9' width='1' height='1'/><rect x='6' y='9' width='1' height='1'/><rect x='9' y='9' width='1' height='1'/></g></svg>") no-repeat right bottom;
}

/* fake load progress, IE-style segmented bar */
.sb-progress {
  position: absolute;
  left: 4px; top: 3px; bottom: 3px;
  width: 0;
  background: repeating-linear-gradient(90deg, #2c62c4 0 6px, #ece9d8 6px 8px);
  transition: width .18s linear;
  opacity: 0;
}
.sb-progress.on { opacity: 1; }

/* ---------------------------------------------------------- XP dialogues -- */

.xp-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .08);
}
.xp-overlay.open { display: flex; }

.xp-dialog {
  width: min(430px, 92vw);
  background: #ece9d8;
  border: 1px solid #0831d9;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.xp-dialog .xp-tb {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 3px 0 6px;
  background: linear-gradient(180deg, #0058ee 0%, #3f8cf3 6%, #1173f7 25%, #0a63d8 78%, #0f4bb0 100%);
  color: #fff;
  font: bold 11px Tahoma, sans-serif;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
}
.xp-dialog .xp-tb span { flex: 1 1 auto; }
.xp-dialog .xp-body {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  font: 11px Tahoma, sans-serif;
  color: #000;
  line-height: 1.5;
}
.xp-dialog .xp-body a { color: #0000cc; }
.xp-dialog .xp-icon { flex: 0 0 32px; }
.xp-dialog .xp-foot {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 14px 14px;
}

/* classic Luna push button — reused by the page too */
.xp-btn {
  min-width: 75px;
  height: 23px;
  padding: 0 12px;
  font: 11px Tahoma, sans-serif;
  color: #000;
  background: linear-gradient(180deg, #fff 0%, #f4f3ee 45%, #e6e3d6 55%, #dedbcd 100%);
  border: 1px solid #7e9a6a;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #fff;
  cursor: pointer;
}
.xp-btn:hover { border-color: #e9a33a; box-shadow: inset 0 0 0 1px #fff, 0 0 3px rgba(233, 163, 58, .6); }
.xp-btn:active { background: linear-gradient(180deg, #dedbcd, #efeee7); }

/* Notepad-ish view-source window */
.xp-dialog.xp-source { width: min(780px, 94vw); }
.xp-dialog.xp-source .xp-tb {
  background: linear-gradient(180deg, #7e93b8 0%, #9aabc9 8%, #7c8fb4 40%, #63779e 100%);
}
.xp-source .src-menu {
  height: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  background: #ece9d8;
  font: 11px Tahoma, sans-serif;
  border-bottom: 1px solid #d6d2c2;
}
.xp-source pre {
  margin: 0;
  height: min(430px, 60vh);
  overflow: auto;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #808080;
  font: 12px/1.35 "Lucida Console", Consolas, Monaco, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: #000;
}

/* ---------------------------------------------------------- taskbar -- */

.xp-taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 30px;
  display: none;
  align-items: center;
  padding: 0 4px;
  z-index: 150;
  background: linear-gradient(180deg, #3f8cf3 0%, #235bd0 9%, #1c50c4 18%, #2360cf 92%, #3f8cf3 100%);
  border-top: 1px solid #63a0f5;
}
.xp-taskbar.show { display: flex; }
.xp-taskbtn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 10px;
  max-width: 190px;
  color: #fff;
  font: 11px Tahoma, sans-serif;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .4);
  background: linear-gradient(180deg, #4d95f5, #1c50c4);
  border: 1px solid #1440a8;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.xp-taskbtn:hover { background: linear-gradient(180deg, #6aa8f8, #2a63d6); }
.xp-taskbtn span { overflow: hidden; text-overflow: ellipsis; }

/* Find-on-page highlight */
mark.ie-find { background: #ffec6e; color: #000; }

/* -------------------------------------------------------------- narrow -- */

@media (max-width: 760px) {
  .ie-window {
    width: 100vw; height: 100vh;
    top: 0; left: 0;
    transform: none;
    border-radius: 0;
    border-width: 0;
  }
  .ie-menubar .ie-menu:nth-child(n+5) { display: none; }
  .ie-statusbar .sb-zone { flex: 0 0 72px; }
}
