/* ════════════════════════════════
   STATUS BAR
   ════════════════════════════════ */
.status-bar {
  padding: 0 2px;
  font-size: 11px;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex-shrink: 0;
  height: 17px;
  background: var(--c-gray-200);
}
.status-resize-slot {
  width: 13px;
  min-width: 13px;
  height: 13px;
  flex-shrink: 0;
  align-self: flex-end;
  background: var(--c-gray-200);
}
.status-item {
  border: none;
  box-shadow: inset -1px -1px 0px #ffffff, inset 1px 1px 0px #808080;
  padding: 0 4px;
  flex: 1;
  display: flex;
  align-items: center;
  background: #c0c0c0;
  position: relative;
}

/* ════════════════════════════════
   NOTEPAD
   ════════════════════════════════ */
.notepad-edit-row {
  flex: 1;
  min-height: 0;
  display: flex;
}
.notepad-ta {
  flex: 1;
  resize: none;
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
  cursor: url('../img/cursor-default.png') 0 0, default;
  border: 2px solid;
  border-top-color: var(--c-border-dark);
  border-left-color: var(--c-border-dark);
  border-bottom-color: var(--c-border-lightest);
  border-right-color: var(--c-border-lightest);
  box-shadow: var(--shadow-input);
  font-family: 'Fixedsys', 'Courier New', monospace;
  font-size: 16px;
  padding: 4px;
  background: #fff;
  outline: none;
  line-height: 1.4;
  color: #000;
}
.notepad-ta::selection,
.notepad-ta *::selection {
  background: #000080;
  color: #fff;
}
.notepad-hscroll {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.notepad-scroll-btn {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-color: #c0c0c0;
  box-shadow: inset -1px -1px 0px #000000, inset 1px 1px 0px #c1c1c1, inset -2px -2px 0px #818181, inset 2px 2px 0px #ffffff;
  border: none;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: 50%;
  background-size: 12px;
}
.notepad-scroll-left {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M9.429 12.002v-12H7.714v12zm-1.715-1.715V1.716H6V3.43H4.286v1.714H2.57V6.86h1.715v1.714H6v1.714z' clip-rule='evenodd'/%3E%3C/svg%3E");
}
.notepad-scroll-right {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M2.571.001v12h1.715v-12zm1.715 1.715v8.571H6V8.573h1.714V6.859H9.43V5.144H7.714V3.43H6V1.716z' clip-rule='evenodd'/%3E%3C/svg%3E");
}
.notepad-htrack {
  flex: 1;
  position: relative;
  background-color: #ffffff;
  background-image:
    repeating-conic-gradient(#c0c0c0 0% 25%, #ffffff 0% 50%);
  background-size: 2px 2px;
}
.notepad-hthumb {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #c0c0c0;
  box-shadow: inset -1px -1px 0px #000000, inset 1px 1px 0px #c1c1c1, inset -2px -2px 0px #818181, inset 2px 2px 0px #ffffff;
  min-width: 22px;
}
.notepad-vscroll {
  width: 22px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--c-gray-200);
}
.notepad-vtrack {
  flex: 1;
  position: relative;
  background-color: #ffffff;
  background-image:
    repeating-conic-gradient(#c0c0c0 0% 25%, #ffffff 0% 50%);
  background-size: 2px 2px;
}
.notepad-vthumb {
  position: absolute;
  left: 0;
  right: 0;
  background: #c0c0c0;
  box-shadow: inset -1px -1px 0px #000000, inset 1px 1px 0px #c1c1c1, inset -2px -2px 0px #818181, inset 2px 2px 0px #ffffff;
  min-height: 22px;
}
.notepad-scroll-up {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M0 9.43h12V7.716H0zm1.714-1.714h8.572V6H8.57V4.287H6.857V2.573H5.143v1.714H3.429v1.714H1.714z' clip-rule='evenodd'/%3E%3C/svg%3E");
}
.notepad-scroll-down {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.57H0v1.714h12zm-1.714 1.714H1.714V6H3.43v1.714h1.714v1.714h1.714V7.713h1.714V5.999h1.715z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* Disabled scrollbar state — embossed gray+white arrows, flat track */
.notepad-scroll-up.scroll-disabled {
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23808080' fill-rule='evenodd' d='M0 9.43h12V7.716H0zm1.714-1.714h8.572V6H8.57V4.287H6.857V2.573H5.143v1.714H3.429v1.714H1.714z' clip-rule='evenodd'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-rule='evenodd' d='M0 9.43h12V7.716H0zm1.714-1.714h8.572V6H8.57V4.287H6.857V2.573H5.143v1.714H3.429v1.714H1.714z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-position: 50% 50%, calc(50% + 1px) calc(50% + 1px);
  background-size: 12px, 12px;
}
.notepad-scroll-down.scroll-disabled {
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23808080' fill-rule='evenodd' d='M12 2.57H0v1.714h12zm-1.714 1.714H1.714V6H3.43v1.714h1.714v1.714h1.714V7.713h1.714V5.999h1.715z' clip-rule='evenodd'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-rule='evenodd' d='M12 2.57H0v1.714h12zm-1.714 1.714H1.714V6H3.43v1.714h1.714v1.714h1.714V7.713h1.714V5.999h1.715z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-position: 50% 50%, calc(50% + 1px) calc(50% + 1px);
  background-size: 12px, 12px;
}
.notepad-scroll-left.scroll-disabled {
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23808080' fill-rule='evenodd' d='M9.429 12.002v-12H7.714v12zm-1.715-1.715V1.716H6V3.43H4.286v1.714H2.57V6.86h1.715v1.714H6v1.714z' clip-rule='evenodd'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-rule='evenodd' d='M9.429 12.002v-12H7.714v12zm-1.715-1.715V1.716H6V3.43H4.286v1.714H2.57V6.86h1.715v1.714H6v1.714z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-position: 50% 50%, calc(50% + 1px) calc(50% + 1px);
  background-size: 12px, 12px;
}
.notepad-scroll-right.scroll-disabled {
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23808080' fill-rule='evenodd' d='M2.571.001v12h1.715v-12zm1.715 1.715v8.571H6V8.573h1.714V6.859H9.43V5.144H7.714V3.43H6V1.716z' clip-rule='evenodd'/%3E%3C/svg%3E"),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-rule='evenodd' d='M2.571.001v12h1.715v-12zm1.715 1.715v8.571H6V8.573h1.714V6.859H9.43V5.144H7.714V3.43H6V1.716z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-position: 50% 50%, calc(50% + 1px) calc(50% + 1px);
  background-size: 12px, 12px;
}
.notepad-vtrack.scroll-disabled,
.notepad-htrack.scroll-disabled {
  background-image: none;
  background-color: var(--c-gray-200);
}

/* ════════════════════════════════
   DIALOG / SHUTDOWN
   ════════════════════════════════ */
#dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 55000;
  align-items: center;
  justify-content: center;
}
#dialog-overlay.visible { display: flex; }

.dialog-box {
  background: var(--c-gray-200);
  box-shadow: var(--shadow-raised);
  min-width: 310px;
  max-width: 380px;
  padding: 4px;
  padding-top: 0;
}
.dialog-title {
  background: linear-gradient(to right, #000080 0%, #1084d0 100%);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
  padding: 3px 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  margin: -4px -4px 8px -4px;
}
.dialog-body {
  padding: 10px 14px;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 12px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.dialog-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 14px 12px;
}
.dialog-btn {
  min-width: 75px;
  height: 23px;
  background: var(--c-gray-200);
  box-shadow: var(--shadow-btn);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
  color: #000000;
  -webkit-text-fill-color: #000000;
}
.dialog-btn:active {
  box-shadow: var(--shadow-btn-active);
  padding-top: 1px;
  padding-left: 1px;
}

/* Shutdown dialog radio options */
.dialog-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding: 0;
  background: transparent;
}
.dialog-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
  cursor: pointer;
  padding: 1px 0;
}
.dialog-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
  accent-color: #000080;
}

/* ════════════════════════════════
   LOG ON SCREEN  (Shut Down > log on as a different user, js/dialog.js)
   ════════════════════════════════ */
.logon-screen {
  background: #008080;
  width: 100%;
  height: 100vh;
  height: var(--app-height, 100vh);
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 13px;
}
.logon-box {
  background: #c0c0c0;
  box-shadow: inset -1px -1px 0 #0a0a0a, inset 1px 1px 0 #dfdfdf, inset -2px -2px 0 #848584, inset 2px 2px 0 #fefefe;
  width: 440px;
  max-width: calc(100vw - 16px);
  padding: 3px;
}
.logon-title {
  background: #060084;
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-weight: bold;
  padding: 2px 5px;
  display: flex;
  align-items: center;
  height: 22px;
}
.logon-body {
  display: flex;
  padding: 12px 10px 18px;
}
.logon-icon {
  flex-shrink: 0;
  width: 52px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
}
.logon-icon img {
  width: 40px;
  height: 36px;
  image-rendering: pixelated;
}
.logon-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.logon-fields p { margin: 0 0 8px; }
.logon-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logon-row label {
  width: 86px;
  flex-shrink: 0;
}
.logon-field {
  flex: 1;
  min-width: 0;
  height: 18px;
  border: none;
  box-shadow: inset -1px -1px 0 #dfdfdf, inset 1px 1px 0 #848584, inset -2px -2px 0 #fefefe, inset 2px 2px 0 #0a0a0a;
  padding: 0 3px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.logon-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: 10px;
  flex-shrink: 0;
}
.logon-btn {
  min-width: 72px;
  height: 23px;
  background: #c0c0c0;
  box-shadow: inset -1px -1px 0 #0a0a0a, inset 1px 1px 0 #fefefe, inset -2px -2px 0 #848584, inset 2px 2px 0 #dfdfdf;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: #000;
}
.logon-btn:active {
  box-shadow: inset 1px 1px 0 #0a0a0a, inset -1px -1px 0 #fefefe, inset 2px 2px 0 #848584, inset -2px -2px 0 #dfdfdf;
}

/* ════════════════════════════════
   SCROLLBARS
   ════════════════════════════════ */
/* Mouse-driven screens only. Touch screens (phones, tablets) keep the
   browser's own overlay scrollbars, which take no room from the layout. */
@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar { width: 32px; min-height: 32px; }
  ::-webkit-scrollbar-track {
    background-color: #fff;
    background-image:
      repeating-linear-gradient(45deg,
        var(--c-gray-100) 25%, transparent 25%, transparent 75%, var(--c-gray-100) 75%, var(--c-gray-100)),
      repeating-linear-gradient(45deg,
        var(--c-gray-100) 25%, var(--c-white) 25%, var(--c-white) 75%, var(--c-gray-100) 75%, var(--c-gray-100));
    background-position: 0 0, 3px 3px;
    background-size: 6px 6px;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--c-gray-200);
    box-shadow: var(--shadow-raised);
    border: none;
  }
  ::-webkit-scrollbar-button {
    background-color: var(--c-gray-200);
    box-shadow: var(--shadow-raised);
    display: block;
    height: 32px;
    background-repeat: no-repeat;
    background-position: 50%;
    background-size: 12px;
  }

  /* Vertical — up arrow (pixel-art style) */
  ::-webkit-scrollbar-button:vertical:start:decrement {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M0 9.43h12V7.716H0zm1.714-1.714h8.572V6H8.57V4.287H6.857V2.573H5.143v1.714H3.429v1.714H1.714z' clip-rule='evenodd'/%3E%3C/svg%3E");
  }
  ::-webkit-scrollbar-button:vertical:start:increment { display: none; }
  ::-webkit-scrollbar-button:vertical:end:decrement { display: none; }
  /* Vertical — down arrow (pixel-art style) */
  ::-webkit-scrollbar-button:vertical:end:increment {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.57H0v1.714h12zm-1.714 1.714H1.714V6H3.43v1.714h1.714v1.714h1.714V7.713h1.714V5.999h1.715z' clip-rule='evenodd'/%3E%3C/svg%3E");
  }

  /* Horizontal — left arrow (pixel-art style) */
  ::-webkit-scrollbar-button:horizontal:start:decrement {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M9.429 12.002v-12H7.714v12zm-1.715-1.715V1.716H6V3.43H4.286v1.714H2.57V6.86h1.715v1.714H6v1.714z' clip-rule='evenodd'/%3E%3C/svg%3E");
  }
  ::-webkit-scrollbar-button:horizontal:start:increment { display: none; }
  ::-webkit-scrollbar-button:horizontal:end:decrement { display: none; }
  /* Horizontal — right arrow (pixel-art style) */
  ::-webkit-scrollbar-button:horizontal:end:increment {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M2.571.001v12h1.715v-12zm1.715 1.715v8.571H6V8.573h1.714V6.859H9.43V5.144H7.714V3.43H6V1.716z' clip-rule='evenodd'/%3E%3C/svg%3E");
  }

  ::-webkit-scrollbar-corner { background-color: var(--c-gray-200); box-shadow: var(--shadow-raised); }

  /* Phone layout in a narrow desktop window: Win95's own 16px size, so the
     32px bars never crowd a small dialog or Paint's tool column. */
  body.is-phone ::-webkit-scrollbar { width: 16px; height: 16px; min-height: 16px; }
  body.is-phone ::-webkit-scrollbar-button { width: 16px; height: 16px; background-size: 8px; }
}

/* ════════════════════════════════
   MESSAGE BOX  (showMessageBox in js/dialog.js)
   Uses the normal window chrome, so phones get the big title-bar buttons.
   ════════════════════════════════ */
.msgbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.msgbox.window {
  position: relative;
  width: auto; /* sized to its text, like Win95 */
  max-width: min(420px, 100%);
  max-height: 100%;
  min-width: min(260px, 100%);
  min-height: 0;
  z-index: auto;
  overflow: auto;
}
.msgbox .window-titlebar {
  background: var(--c-header); /* always the active box */
  cursor: url('../img/cursor-default.png') 0 0, default;
  touch-action: auto;
}
.msgbox-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 12px 12px;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}
.msgbox-icon { flex-shrink: 0; }
.msgbox-text {
  flex: 1;
  min-width: 0;
  margin-top: 2px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.msgbox-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 0 8px 8px;
}
body.is-phone .msgbox-body { font-size: 15px; }
body.is-phone .msgbox-btn { min-width: 90px; }

/* Keyboard focus on dialog buttons: the Win95 dotted rectangle, not the
   browser's blue ring. */
.dialog-btn:focus { outline: none; }
.dialog-btn:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -5px;
}
