/* Notepad */
.app-notepad .np-root { flex: 1; display: flex; min-height: 0; background: #fff; border-top: 1px solid #ACA899; }
.app-notepad .np-text {
  flex: 1; min-width: 0; width: 100%; height: 100%; margin: 0; border: 0; outline: none; resize: none;
  padding: 1px 2px; background: #fff; color: #000; line-height: 1.2;
  font-family: "Lucida Console", "Courier New", monospace; font-size: 10pt; tab-size: 8;
  overflow: auto; overflow-y: scroll; cursor: var(--cur-text);
  user-select: text; -webkit-user-select: text; white-space: pre-wrap; overflow-wrap: anywhere;
}
.app-notepad .np-text.nowrap { white-space: pre; overflow-wrap: normal; overflow-x: scroll; }
.app-notepad .np-text::selection { background: #316AC5; color: #fff; }
.app-notepad .np-status .part:first-child { flex: 1; }
.app-notepad .np-status .part:nth-child(2) { flex: 0 0 150px; min-width: 0; }

/* Find / Replace (modeless) */
.app-notepad.np-dlg-win .window-body { overflow: visible; }
.app-notepad .np-dlg { display: flex; gap: 10px; padding: 10px 8px 10px 10px; }
.app-notepad .np-dlg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.app-notepad .np-dlg-field { display: flex; align-items: center; gap: 6px; }
.app-notepad .np-dlg-field label { flex: 0 0 72px; white-space: nowrap; }
.app-notepad .np-dlg-field .xp-input { flex: 1; min-width: 0; }
.app-notepad .np-dlg-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.app-notepad .np-dir { display: flex; gap: 10px; margin: 0; padding: 2px 8px 5px; }
.app-notepad .np-dlg-btns { display: flex; flex-direction: column; gap: 5px; flex: none; }
.app-notepad .np-dlg-btns .xp-btn { min-width: 84px; }

/* Go To */
.app-notepad .np-goto-body { display: flex; flex-direction: column; gap: 5px; width: 220px; max-width: 100%; }
.app-notepad .np-goto-wrap { position: relative; }
.app-notepad .np-goto { width: 100%; }
.app-notepad .np-balloon {
  position: absolute; left: 10px; top: 28px; z-index: 5; width: 200px; padding: 6px 8px 8px; background: #FFFFE1;
  border: 1px solid #000; border-radius: 6px; box-shadow: 2px 2px 3px rgba(0,0,0,.3); line-height: 14px;
}
.app-notepad .np-balloon::before { content: ''; position: absolute; left: 14px; top: -10px; border: 5px solid transparent; border-bottom: 5px solid #000; }
.app-notepad .np-balloon b { display: block; margin-bottom: 2px; }

/* Font */
.app-notepad .np-font { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.app-notepad .np-font-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, .6fr); gap: 10px; }
.app-notepad .np-font-col { display: flex; flex-direction: column; margin-top: 3px; }
.app-notepad .np-font-col .xp-input { width: 100%; }
.app-notepad .np-font-list { height: 110px; border-top: 0; }
.app-notepad .np-font-list .row { cursor: var(--cur-arrow); }
.app-notepad .np-font-bottom { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.app-notepad .np-sample-box { flex: 1 1 200px; margin: 0; }
.app-notepad .np-sample { height: 46px; display: grid; place-items: center; overflow: hidden; white-space: nowrap; }
.app-notepad .np-script { display: flex; flex-direction: column; gap: 3px; flex: 0 0 120px; }

@media (max-width: 420px) {
  .app-notepad .np-dlg { flex-direction: column; }
  .app-notepad .np-dlg-btns { flex-direction: row; flex-wrap: wrap; }
  .app-notepad .np-dlg-btns .xp-btn { min-width: 0; flex: 1; }
  .app-notepad .np-font-cols { grid-template-columns: 1fr 1fr; }
}

/* selection mirror shown while a modeless Find/Replace dialog has focus */
.app-notepad .np-root { position: relative; }
.app-notepad .np-mirror { position: absolute; left: 0; top: 0; overflow: hidden; pointer-events: none; color: transparent; box-sizing: border-box; }
.app-notepad .np-mirror-in { min-height: 100%; }
.app-notepad .np-mirror mark { background: #316AC5; color: #fff; }
.window.np-goto-win, .np-goto-win .window-client, .np-goto-win .window-body { overflow: visible; }
