/* hpx classic shell: Windows-style MDI frame (maximised, as Prg_1 StartupMode=2). */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  /* Windows 10 default UI font, Segoe UI 9pt = 12px (customer screenshot DSGVO Löschkonzept.pdf p5) */
  font-family: "Segoe UI", Tahoma, "MS Sans Serif", Geneva, sans-serif;
  font-size: 12px;
  color: #000;
  background: #f0f0f0;
  user-select: none;
  -webkit-user-select: none;
}

.frame {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Windows 10 title bar (accent off): 30px, white, 16x16 app icon at x=7, text from x=41, Segoe UI 12px regular. */
.frame { box-sizing: border-box; border: 1px solid #194f6c; } /* measured: Win10 shot p5 top edge */
.caption {
  position: relative;
  flex: 0 0 auto;
  height: 30px;
  line-height: 30px;
  /* customer screenshot: '|SB:' at x=40 after the four blanks of '    |SB: ' (APPNAME empty) */
  padding: 0 6px 0 25px;
  /* title icon: the original's HP_Logo_16.ico (teal, matches the customer screenshot) */
  background: #fff url("/res?p=%25HPPROG%25HP_Logo_16.ico") no-repeat 8px 7px / 16px 16px;
  color: #000;
  font-weight: normal;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Menu bar 24px, rebar gradient, captions with ~10px padding each side, first text at x=15 (measured). */
.menubar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  background: linear-gradient(to right, #f0f0f0, #fcfcfc);
  padding: 0 0 0 4px;
}
.menubar-item {
  box-sizing: border-box;
  height: 20px; /* measured p5: open item frame y 33..52, caption cap top 5 px below the frame */
  margin-top: 2px;
  line-height: 17px;
  border: 1px solid transparent;
  padding: 0 9px 0 8px; /* measured p5: 'System' frame 748..804, text 757..794 */
  cursor: default;
  white-space: pre;
}
.menubar-item.active {
  background: linear-gradient(#fcfcfc, #f9f9f9); /* measured p5: open 'System' item, #808080 frame */
  border-color: #808080;
}
/* Windows hides mnemonic underlines until Alt is used (shell.js sets .show-accel). */
.menubar u, .menu-popup u { text-decoration: none; }
body.show-accel .menubar u, body.show-accel .menu-popup u { text-decoration: underline; }
.menubar-item.disabled { color: #6d6d6d; } /* Windows 10 GrayText (no disabled entry in the reference shots) */
/* hpx's own addition (not in the original): "Neue Oberfläche" at the right end of the menu bar, in HausPerfekt's
   new-look accent so it is not mistaken for an original menu. */
.menubar-item.hpx-new-ui { margin-left: auto; margin-right: 6px; color: #00716c; cursor: pointer; }
.menubar-item.hpx-new-ui:hover { border-color: #009d97; background: #e6f5f4; }

.menu-popup {
  position: fixed;
  z-index: 10000;
  min-width: 150px;
  max-height: calc(100vh - 4px);
  overflow-y: auto;
  /* measured p5: 1px #808080 frame, 1px #fcfcfc inner line, 28px icon gutter shading #fcfcfc -> #f1f1f1, body
     #fdfdfd, no drop shadow */
  background: linear-gradient(to right, #fcfcfc, #f1f1f1) 0 0 / 24px 100% no-repeat, #fdfdfd; /* gutter x 1..24 */
  border: 1px solid #808080;
  box-shadow: inset 0 0 0 1px #fcfcfc;
  padding: 1px; /* measured p5: highlight 1 px inside the frame's inner line */
}
.menu-item {
  display: flex;
  align-items: center;
  height: 22px; /* Windows 10 menu item pitch (customer screenshot p5/p7: 22 px) */
  padding: 0 4px 0 0;
  cursor: default;
  white-space: pre;
}
.menu-item.active {
  /* measured p5: 'Schlüssel - Tabellen 2' fill #b5d7f3, 1px #0078d7 frame */
  background: #b5d7f3;
  outline: 1px solid #0078d7;
  outline-offset: -1px;
}
.menu-item.disabled { color: #6d6d6d; }
.menu-icon {
  /* customer screenshot p5: text starts 35 px into the popup (2 px border/padding + 33 px gutter) */
  flex: 0 0 33px;
  width: 33px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.menu-icon img { width: 16px; height: 16px; image-rendering: pixelated; }
/* measured p5: text origin 36 px from the popup's outer frame ("Chef-Rechte" C ink at 37-38) */
.menu-label { flex: 1 1 auto; padding: 0 18px 0 1px; }
.menu-key { flex: 0 0 auto; padding-right: 8px; }
.menu-arrow { flex: 0 0 12px; position: relative; align-self: stretch; }
/* measured p5: solid triangle 4 x 7 px, pixel columns 7/5/3/1 high (no antialiasing), right edge 12 px left of the
   popup frame, top 8 px into the 22 px item */
.menu-arrow-sub::after { content: ""; position: absolute; right: 6px; top: calc(50% - 3px); width: 4px; height: 7px;
  background: linear-gradient(currentColor, currentColor) 0 0 / 1px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 1px 1px / 1px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 2px 2px / 1px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 3px / 1px 1px no-repeat; }
.menu-sep {
  height: 1px;
  margin: 3px 0 2px 31px; /* measured p5: 6 px block, line 3 px down, x 781..956 */
  background: #bdbdbd; /* measured p5 */
}

/* Toolbar 25px, vertical gradient, gripper dots at x=2..4, 16x16 icons on a 23px pitch from x=11,
   #a0a0a0 line then the #696969 sunken edge of the client area (measured, see NOTES.md). */
.toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 0 0 0 7px;
  background:
    radial-gradient(circle at 1px 1px, #b8b8b8 1px, transparent 1.2px) 2px 4px / 4px 4px repeat-y,
    linear-gradient(#fbfbfb, #f1f1f1); /* measured p5: #fafafa top, #f6f6f6 middle, #f1f1f1 bottom */
  background-size: 4px 4px, auto;
  background-position: 2px 4px, 0 0;
  background-repeat: no-repeat repeat, no-repeat;
  border-bottom: 1px solid #a0a0a0;
  min-height: 27px; /* measured p5: toolbar band y 53..79, icons 59..74 */
}
.tool-btn {
  width: 23px;
  height: 25px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: default;
}
.tool-btn:hover:not(:disabled) { border-color: #3c7fb1; background: #e5f1fb; }
.tool-btn:active:not(:disabled) { background: #cce4f7; }
.tool-btn:disabled img { filter: grayscale(1) contrast(0.2415) brightness(1.478); }
/* Disabled tool = the bitmap in grey, washed out (comctl32 v6), measured in the Win10 shot DSGVO p5 (Kopieren/Einfuegen/
   Brille): black -> #8f8f8f, the light-blue cell #cce2fc -> #dddddd, white -> #e9e9e9 = 0.356 x grey + 143. */
.tool-btn img { width: 16px; height: 16px; image-rendering: pixelated; }
.tool-btn.tool-builtin { font-size: 8px; color: #444; }
.tool-sep {
  box-sizing: border-box;
  width: 2px;
  height: 15px;
  margin: 0 2px;
  border-left: 1px solid #bdbdbd;
  border-right: 1px solid #fff;
}

.mdi {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background-color: #808080; /* Windows AppWorkspace, under the wallpaper */
  border-top: 1px solid #696969;
  border-left: 1px solid #696969;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.statusbar {
  flex: 0 0 auto;
  display: flex;
  height: 20px;
  line-height: 20px;
  padding: 0 6px;
  background: #f0f0f0;
  border-top: 1px solid #a0a0a0;
  white-space: pre;
  overflow: hidden;
}
.statusbar .pane { padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
.statusbar .pane[hidden] { display: none; }
.statusbar .pane-msg { flex: 1 1 auto; min-width: 0; }
/* Magic status panes, sunken, right-aligned group. FIXED pixel widths, measured: XP shots Handwerkerauftrag p14 (1280 px
   screen) and p8 (1023 px) have the same boxes - SUPERVISOR 168 | Modifiz. 108 | ZOOM 44 | Breiter 45 | Ein 49 to the
   right edge, 3 px apart, 18 px high, #a0a0a0 top/left, white bottom/right. */
.statusbar .pane-sunken {
  box-sizing: border-box; flex: 0 0 auto; height: 18px; line-height: 16px; margin: 1px 0 0 3px; padding: 0 3px;
  border: 1px solid; border-color: #a0a0a0 #fff #fff #a0a0a0;
}
.statusbar .pane-user { width: 168px; }
.statusbar .pane-mode { width: 108px; }
.statusbar .pane-zoom { width: 44px; }
.statusbar .pane-wide { width: 45px; }
.statusbar .pane-insert { width: 49px; }
.statusbar { padding: 0 0 0 6px; }
#status-errors { color: #c00000; font-weight: bold; cursor: help; }

/* Windows 10 caption buttons: 46x30 each, glyphs 10x10 1px (minimise, maximise, close).
   Drawn only: the browser page cannot minimise/close its own window. */
.caption-buttons { position: absolute; top: 0; right: 0; height: 30px; display: flex; }
.cap-btn { width: 46px; height: 30px; position: relative; }
.cap-btn:hover { background: #e5e5e5; }
.cap-close:hover { background: #e81123; }
.cap-min::after { content: ""; position: absolute; left: 18px; top: 15px; width: 10px; height: 1px; background: #000; }
.cap-max::after { content: ""; position: absolute; left: 18px; top: 10px; width: 8px; height: 8px; border: 1px solid #000; }
.cap-close::before, .cap-close::after { content: ""; position: absolute; left: 17px; top: 15px; width: 13px; height: 1px; background: #000; }
.cap-close::before { transform: rotate(45deg); }
.cap-close::after { transform: rotate(-45deg); }
.cap-close:hover::before, .cap-close:hover::after { background: #fff; }
.caption { padding-right: 150px; }
/* Mac app: the native window title bar replaces ours. */
body.desktop .caption { display: none; }

/* Long menus (System > Daten-Bank 219 entries): Windows breaks a menu taller than the screen into
   columns (MF_MENUBARBREAK) - items flow top-to-bottom, then into the next column. */
.menu-popup.menu-columns {
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start;
  overflow: hidden; max-height: none;
}
.menu-popup.menu-columns > .menu-item, .menu-popup.menu-columns > .menu-sep { width: var(--menu-col-w); box-sizing: border-box; }

/* Windows 10 tooltip: white, 1px #767676 border, Segoe UI 12px, 2px 6px padding, slight shadow. */
.hpx-tip {
  position: fixed; z-index: 20000; background: #fff; color: #575757; border: 1px solid #767676;
  padding: 1px 6px 2px; white-space: pre; box-shadow: 1px 1px 2px rgba(0,0,0,.25); pointer-events: none;
}

/* Windows MDI: a minimised child sits as a small caption at the bottom-left of the client area. */
.mdi > .hpx-win.hpx-minimised { top: auto !important; bottom: 0 !important; left: 0 !important; }
/* A modal dialog is open (hpx.setModal): the frame's menu bar and toolbar do not react. */
body.hpx-modal-on #menubar, body.hpx-modal-on #toolbar { pointer-events: none; }
/* ... and the toolbar's buttons look disabled while it lasts (Magic disables the frame's tools under a modal task). */
body.hpx-modal-on .tool-btn img { filter: grayscale(1) contrast(0.2415) brightness(1.478); }
body.hpx-modal-on .tool-btn.tool-builtin { color: #6d6d6d; }

/* MDI client scroll bars (a child larger than the work area, e.g. the News window 1638 px at 1440x900): Windows 10
   draws classic 17 px bars that are always visible - not the Mac's hidden overlay bars. */
.mdi::-webkit-scrollbar { width: 17px; height: 17px; background: #f0f0f0; }
.mdi::-webkit-scrollbar-thumb { background: #cdcdcd; border: 1px solid #f0f0f0; }
.mdi::-webkit-scrollbar-thumb:hover { background: #a6a6a6; }
.mdi::-webkit-scrollbar-thumb:active { background: #606060; }
.mdi::-webkit-scrollbar-corner { background: #f0f0f0; }
.mdi::-webkit-scrollbar-button:single-button { display: block; width: 17px; height: 17px; background: #f0f0f0 no-repeat center; }
.mdi::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5'%3E%3Cpath d='M0 5L4.5 0 9 5' fill='none' stroke='%23606060'/%3E%3C/svg%3E"); }
.mdi::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5'%3E%3Cpath d='M0 0L4.5 5 9 0' fill='none' stroke='%23606060'/%3E%3C/svg%3E"); }
.mdi::-webkit-scrollbar-button:single-button:horizontal:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='9'%3E%3Cpath d='M5 0L0 4.5 5 9' fill='none' stroke='%23606060'/%3E%3C/svg%3E"); }
.mdi::-webkit-scrollbar-button:single-button:horizontal:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='9'%3E%3Cpath d='M0 0L5 4.5 0 9' fill='none' stroke='%23606060'/%3E%3C/svg%3E"); }
