/* Origin: rice.e — Westbridge Terminal source. */
/* =========================================================
   WESTBRIDGE TERMINAL v2 — retro OS chrome
   ========================================================= */

:root {
  --desktop-bg: #2b2b2e;
  --chrome-face: #c0c0c0;
  --chrome-face-dark: #9c9c9c;
  --chrome-shadow: #6f6f6f;
  --chrome-highlight: #c8c8c8;
  --chrome-darkest: #3a3a3a;
  --titlebar-start: #1c1c1e;
  --titlebar-end: #4c4c50;
  --titlebar-text: #e8e8ea;
  --taskbar-bg: #17171a;
  --taskbar-text: #e8e8ea;
  --accent: #5a5a60;
  --danger: #c0392b;
  --font-ui: Tahoma, "MS Sans Serif", Geneva, Verdana, sans-serif;
}

* { box-sizing: border-box; }

::selection {
  background: #3169c6;
  color: #ffffff;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  background: #000;
  -webkit-font-smoothing: none;
}

body {
  display: flex;
  flex-direction: column;
}

/* ---------- TOP BAR ---------- */
#top-bar {
  height: 28px;
  flex: 0 0 auto;
  background: linear-gradient(to bottom, var(--titlebar-end), var(--titlebar-start));
  color: var(--titlebar-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  border-bottom: 2px solid var(--chrome-darkest);
  z-index: 100;
}

.top-bar-section { display: flex; align-items: center; gap: 6px; height: 100%; }
.top-bar-section > * { flex: 0 0 auto; }

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 4px #2ecc71;
  display: block;
}
.status-dot.disconnected {
  background: #e74c3c;
  box-shadow: 0 0 4px #e74c3c;
}

.status-connected { color: #a6f5c0; font-weight: bold; }
.status-disconnected { color: #ffb3ac; font-weight: bold; }

.top-label { white-space: nowrap; display: flex; align-items: center; }
.pin-icon { display: block; }

/* Shared vertical divider — a real 1px bar */
.vdivider {
  align-self: center;
  width: 1px;
  height: 14px;
  background: currentColor;
  opacity: 0.4;
  flex: 0 0 auto;
}

/* ---------- MAIN AREA ---------- */
#main-area {
  flex: 1 1 auto;
  position: relative;
  background: var(--desktop-bg);
  overflow: auto;
}

/* ---------- LOGIN SCREEN ---------- */
#login-screen {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
}

.login-panel {
  background: var(--chrome-face);
  border: 2px solid var(--chrome-darkest);
  box-shadow:
    inset -1px -1px 0 var(--chrome-highlight),
    inset 1px 1px 0 var(--chrome-shadow),
    4px 4px 10px rgba(0,0,0,0.5);
  width: 360px;
  max-width: 90vw;
}

.login-panel-titlebar {
  background: linear-gradient(to bottom, var(--titlebar-end), var(--titlebar-start));
  color: var(--titlebar-text);
  font-weight: bold;
  font-size: 13px;
  padding: 6px 10px;
  letter-spacing: 0.5px;
}

.login-panel-body {
  padding: 20px 18px;
  text-align: center;
  color: var(--chrome-darkest);
}

.login-panel-body p {
  font-size: 12px;
  margin: 0 0 16px;
  line-height: 1.5;
}

.login-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 rgba(200,200,200,0.6), inset 1px 1px 0 rgba(0,0,0,0.3);
  padding: 10px 18px;
  cursor: pointer;
  width: 100%;
}
.login-btn:active { box-shadow: inset 1px 1px 0 rgba(200,200,200,0.6), inset -1px -1px 0 rgba(0,0,0,0.3); }
.login-btn:disabled { opacity: 0.6; cursor: default; }

.restriction-banner {
  width: 360px;
  max-width: 90vw;
  background: #2a0d0d;
  border: 2px solid var(--danger);
  color: #ff9a90;
  font-size: 12px;
  padding: 12px 14px;
  line-height: 1.5;
  display: none;
}
.restriction-banner.visible { display: block; }
.restriction-banner strong { color: #ffb3ac; }

.login-generic-error {
  width: 360px;
  max-width: 90vw;
  background: #2a1c0d;
  border: 2px solid #c08a2b;
  color: #ffd28a;
  font-size: 12px;
  padding: 10px 14px;
  display: none;
}
.login-generic-error.visible { display: block; }

.login-policy-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.login-policy-links a {
  color: #b9b9c0;
  text-decoration: none;
}
.login-policy-links a:hover { text-decoration: underline; color: #fff; }
.login-policy-links .vdivider { background: #b9b9c0; height: 11px; }

/* ---------- MAIN APP SHELL ---------- */
#app-shell {
  display: none;
  height: 100%;
  width: 100%;
  color: var(--taskbar-text);
  font-size: 13px;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ---------- DESKTOP WALLPAPER (department background engine) ---------- */
#desktop-wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--wallpaper-color, var(--desktop-bg));
  transition: background-color 0.25s ease;
}

/* Subtle win98-style dithered texture overlay, tinted per-department via
   the same currentColor as the background text so it never needs a
   per-department image asset. */
.wallpaper-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image:
    repeating-linear-gradient(45deg, #fff 0, #fff 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(-45deg, #000 0, #000 1px, transparent 1px, transparent 3px);
}

.wallpaper-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}

.wallpaper-icon {
  width: 220px;
  height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.wallpaper-label {
  color: #fff;
  font-weight: bold;
  font-size: 22px;
  letter-spacing: 0.5px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  max-width: 420px;
}

.wallpaper-monitor-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  text-align: center;
  color: #ff4c42;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.75px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  display: none;
}
.wallpaper-monitor-text.visible { display: block; }

/* ---------- DESKTOP ICON GRID ---------- */
#desktop-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, 88px);
  gap: 18px;
  padding: 24px;
  align-content: start;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 6px 4px;
  cursor: pointer;
  width: 88px;
}
.app-icon:hover { background: rgba(255,255,255,0.06); }
.app-icon:active { background: rgba(255,255,255,0.1); }
.app-icon.selected {
  border: 2px solid #d0d0d0;
  background: rgba(255,255,255,0.08);
}

.app-icon-glyph {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #c0392b;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.25),
    inset 0 -3px 6px rgba(0,0,0,0.35),
    2px 3px 6px rgba(0,0,0,0.4);
  flex: 0 0 auto;
}

.app-icon-label {
  font-size: 11px;
  line-height: 1.3;
  color: var(--taskbar-text);
  text-align: center;
  word-break: break-word;
}

/* ---------- WINDOWS LAYER ---------- */
#windows-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
#windows-layer > * { pointer-events: auto; }

/* Origin: rice.e — Westbridge Terminal source. */
/* ---------- APP WINDOW ---------- */
.os-window {
  position: absolute;
  background: var(--chrome-face);
  border: 2px solid var(--chrome-darkest);
  box-shadow:
    inset -1px -1px 0 var(--chrome-highlight),
    inset 1px 1px 0 var(--chrome-shadow),
    4px 4px 14px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  color: var(--chrome-darkest);
  min-width: 320px;
  min-height: 220px;
}
.os-window.os-window-fixed {
  min-width: 0;
  min-height: 0;
}
.os-window[data-app-key="stopwatch"] .window-content {
  padding: 6px;
}
.os-window.minimized { display: none; }

.window-titlebar {
  background: linear-gradient(to bottom, var(--titlebar-end), var(--titlebar-start));
  color: var(--titlebar-text);
  font-weight: bold;
  font-size: 13px;
  padding: 6px 8px 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  cursor: move;
  user-select: none;
}

.window-titlebar-buttons {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.window-min,
.window-close {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: bold;
  background: var(--chrome-face);
  border: 1px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
  width: 20px;
  height: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--chrome-darkest);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
}
.window-min:active,
.window-close:active { box-shadow: inset 1px 1px 0 var(--chrome-highlight), inset -1px -1px 0 var(--chrome-shadow); }

.window-tabbar {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  background: var(--chrome-face-dark);
  padding: 6px 6px 0;
  overflow-x: auto;
}

.window-tab {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--chrome-darkest);
  background: var(--chrome-face-dark);
  border: 1px solid var(--chrome-darkest);
  border-bottom: none;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.window-tab.active {
  background: #ffffff;
  font-weight: bold;
}
.window-tab.tab-logout {
  color: var(--danger);
  font-weight: bold;
}
.window-tab.tab-logout.active { background: var(--chrome-face-dark); }

.window-content {
  flex: 1 1 auto;
  background: #ffffff;
  border-top: 1px solid var(--chrome-darkest);
  padding: 16px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
  text-align: left;
}
.window-content.plain-text {
  white-space: pre-wrap;
}
.window-content .tab-title {
  display: inline-block;
  font-size: 13px;
  font-weight: bold;
  color: var(--chrome-darkest);
}
.window-content hr {
  border: none;
  border-top: 1px solid var(--chrome-shadow);
  margin: 14px 0;
}
.window-content .tab-subheading {
  display: inline-block;
  font-weight: bold;
  color: var(--chrome-darkest);
}
.window-content .ref-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 4px 0 16px 0;
  font-size: 12px;
}
.window-content .ref-table td {
  overflow-wrap: break-word;
}
.window-content .ref-table th,
.window-content .ref-table td {
  border: 1px solid var(--chrome-shadow);
  padding: 4px 8px;
  text-align: left;
  vertical-align: middle;
}
.window-content .ref-table th {
  background: var(--chrome-face);
  font-weight: bold;
  color: var(--chrome-darkest);
}
.window-content .ref-warning {
  color: var(--danger);
}
.window-content .ref-item-name {
  font-weight: bold;
}
.window-content .ref-acronym {
  font-weight: bold;
}

.window-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 50%, var(--chrome-darkest) 50% 60%, transparent 60% 70%, var(--chrome-darkest) 70% 80%, transparent 80%);
}

/* ---------- BOTTOM BAR ---------- */
#bottom-bar {
  height: 30px;
  flex: 0 0 auto;
  background: var(--taskbar-bg);
  border-top: 2px solid var(--chrome-darkest);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: var(--taskbar-text);
  font-size: 12px;
  z-index: 100;
}

#taskbar-minimized {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  height: 100%;
}

.taskbar-chip {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--chrome-darkest);
  background: var(--chrome-face);
  border: 1px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.taskbar-chip:active { box-shadow: inset 1px 1px 0 var(--chrome-highlight), inset -1px -1px 0 var(--chrome-shadow); }

.bottom-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  color: var(--titlebar-text);
  cursor: pointer;
  line-height: 0;
}
.icon-btn svg { display: block; }
.icon-btn:hover { opacity: 0.75; }
.icon-btn:active { opacity: 0.55; }
.icon-btn.selected {
  outline: 2px solid #d0d0d0;
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- POLICY PAGES ---------- */
html.policy-page,
body.policy-page-body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body.policy-page-body {
  width: 100%;
  background: var(--desktop-bg);
  display: block;
  padding: 32px 16px;
}
.policy-page-panel {
  background: var(--chrome-face);
  border: 2px solid var(--chrome-darkest);
  box-shadow:
    inset -1px -1px 0 var(--chrome-highlight),
    inset 1px 1px 0 var(--chrome-shadow),
    4px 4px 14px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 1100px;
  height: fit-content;
  margin: 0 auto;
}
.policy-page-titlebar {
  background: linear-gradient(to bottom, var(--titlebar-end), var(--titlebar-start));
  color: var(--titlebar-text);
  font-weight: bold;
  font-size: 13px;
  padding: 6px 8px 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.policy-page-titlebar a {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: bold;
  color: var(--titlebar-text);
  background: var(--chrome-face);
  border: 1px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
  padding: 3px 10px;
  text-decoration: none;
  color: var(--chrome-darkest);
}
.policy-page-content {
  background: #ffffff;
  border-top: 1px solid var(--chrome-darkest);
  padding: 20px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  color: var(--chrome-darkest);
}

#bottom-clock,
#bottom-date {
  font-family: var(--font-ui);
  color: var(--titlebar-text);
  white-space: nowrap;
}

.hidden { display: none !important; }

/* Origin: rice.e — Westbridge Terminal source. */
/* ---------- PNC SEARCH, BOLOs, MODERATION ---------- */
.pnc-search input,
#bolo-add-area input,
#mod-bans-list input,
#mod-banner input,
#mod-bans-list select,
.window-content input[type="text"],
.window-content select,
.window-content textarea {
  font-family: var(--font-ui);
  border: 2px solid var(--chrome-darkest);
  border-radius: 0;
  box-shadow: inset 1px 1px 0 var(--chrome-highlight), inset -1px -1px 0 var(--chrome-shadow);
  background: #ffffff;
  color: var(--chrome-darkest);
  padding: 6px;
  font-size: 12px;
}

#bolo-add-area .login-btn,
#mod-bans-list .login-btn,
#mod-banner .login-btn {
  width: auto;
  padding: 6px 16px;
  font-size: 12px;
}

#banner-clear-btn {
  padding: 6px 16px;
  font-size: 12px;
}

#bolo-list .bolo-delete-btn:hover {
  opacity: 0.8;
}

#global-banner {
  background: #c0392b;
  color: white;
  padding: 8px 16px;
  text-align: center;
  font-weight: bold;
  font-size: 13px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  position: relative;
}
#global-banner button {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  position: absolute;
  right: 12px;
}

.window-content .login-btn {
  width: auto;
  padding: 6px 16px;
  font-size: 12px;
}

/* Shared top row (search/username bar etc.) inside any window-content pane.
   Its bottom margin is the ONLY spacing mechanism between it and whatever
   comes after, and it's set to match window-content's own 16px padding so
   the gap above the bar and the gap below it are always equal. */
.content-top-row {
  margin-bottom: 16px;
}

/* ---- Horizontal divider matching the vertical divider used inside a PNC
   board (.pnc-board-middle / .pnc-board-right border-left). Single spacing
   mechanism (margin only) so the gap above and below is always equal. ---- */
.pnc-divider {
  border: none;
  border-top: 2px solid #ddd;
  margin: 16px 0;
  height: 0;
}

/* ---- PNC result boards ---- */
.pnc-boards-container {
  margin-top: 0; /* gap is already provided by .content-top-row above it */
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pnc-board {
  border: 2px solid var(--chrome-darkest);
  border-radius: 0;
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
  background: var(--chrome-face);
  padding: 10px 12px;
  position: relative;
}

.pnc-board-close {
  position: absolute;
  top: 8px;
  right: 8px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  color: var(--chrome-darkest);
  background: var(--chrome-face);
  border: 1px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
  width: 20px;
  height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
}
.pnc-board-close:active {
  box-shadow: inset 1px 1px 0 var(--chrome-highlight), inset -1px -1px 0 var(--chrome-shadow);
}
.pnc-board-close:hover {
  color: var(--danger);
}

/* ---- Lists that should grow/shrink with the window instead of a fixed height ---- */
.scrollable-list {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

/* ---- BOLO "wanted" banner shown on a PNC search result ---- */
.pnc-bolo-banner {
  background: var(--danger);
  color: #ffffff;
  border: none;
  border-bottom: 2px solid var(--chrome-darkest);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  margin: -10px -12px 10px -12px;
}

.pnc-bolo-banner-text {
  font-weight: bold;
  font-size: 12px;
}

.pnc-bolo-banner-close {
  position: static;
  flex: 0 0 20px;
}

/* ---- Flag "wanted subject" banner shown on a PNC search result ---- */
/* Same colour as the BOLO banner so the two bars read as one family. */
.pnc-flag-banner {
  background: var(--danger);
  color: #ffffff;
  border: none;
  border-bottom: 2px solid var(--chrome-darkest);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  margin: -10px -12px 10px -12px;
}

.pnc-flag-banner-text {
  font-weight: bold;
  font-size: 12px;
}

.pnc-board-flag-btn {
  right: 32px;
}

/* ---- Group of control buttons (close / manage-flags) living inside a
   banner bar, instead of being absolutely positioned over the board.
   Flex + align-items on the parent banner keeps these perfectly
   vertically centered no matter how tall the bar ends up being. ---- */
.pnc-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* A control button placed inside a banner bar — same look as
   .pnc-board-close but positioned in normal flow so the surrounding
   flex container centers it, rather than floating over the board. */
.pnc-banner-btn {
  position: static;
  flex: 0 0 20px;
}

.win98-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  text-align: left;
  border: 2px solid var(--chrome-darkest);
  border-radius: 0;
  box-shadow: inset 1px 1px 0 var(--chrome-highlight), inset -1px -1px 0 var(--chrome-shadow);
  background: #ffffff;
  color: var(--chrome-darkest);
  cursor: pointer;
}

.win98-select-btn:active {
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
}

.win98-select-arrow {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--chrome-darkest);
}

.pnc-flag-menu {
  position: absolute;
  z-index: 500;
  background: var(--chrome-face);
  border: 1px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow), 2px 2px 6px rgba(0,0,0,0.3);
  padding: 6px;
  min-width: 200px;
  max-height: 260px;
  overflow-y: auto;
}

.pnc-flag-menu-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  font-size: 12px;
  cursor: pointer;
}

.pnc-flag-menu-row:hover {
  background: var(--chrome-highlight);
}

.pnc-board-content {
  display: flex;
  gap: 16px;
  align-items: stretch;
  padding-right: 20px; /* space for close button */
}

.pnc-board-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

/* Row of small previous-avatar thumbnails shown under the main avatar when
   the account has changed its avatar since it was last searched. */
.pnc-avatar-history {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  max-width: 90px;
}

.pnc-avatar-history-thumb {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--chrome-shadow);
  opacity: 0.85;
}

.pnc-avatar-history-thumb:hover {
  opacity: 1;
  border-color: var(--chrome-darkest);
}

.pnc-board-middle {
  flex: 1;
  border-left: 2px solid #ddd;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pnc-board-right {
  flex: 1.5;
  border-left: 2px solid #ddd;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pnc-board-right .group-entry {
  padding: 2px 0;
}

.plate-box {
  display: inline-block;
  background: #ffcb01;
  padding: 2px 14px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 1px;
  border-left: 6px solid #252c67;
  margin-top: 4px;
  color: #222;
  font-family: 'Courier New', monospace;
}

/* ---- Moderation logs & bans ---- */
.mod-ban-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--chrome-shadow);
  padding: 6px 0;
}

/* ---- Shared small win98 action buttons (Delete / Unban / Clear, etc.) ---- */
.win98-btn-sm {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: bold;
  color: var(--chrome-darkest);
  background: var(--chrome-face);
  border: 2px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
  padding: 4px 12px;
  cursor: pointer;
  flex: 0 0 auto;
}
.win98-btn-sm:active {
  box-shadow: inset 1px 1px 0 var(--chrome-highlight), inset -1px -1px 0 var(--chrome-shadow);
}
.win98-btn-sm.win98-btn-danger { color: #ffffff; background: var(--danger); }
.win98-btn-sm.win98-btn-muted { color: #ffffff; background: var(--accent); }
.mod-ban-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mod-ban-info {
  flex: 1;
}

/* ---------------------------------------------------------------------------
   Win98-style confirm/alert modal (replaces native browser dialogs)
   --------------------------------------------------------------------------- */
.win98-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.win98-modal {
  width: 320px;
  max-width: 90vw;
  background: var(--chrome-face);
  border: 2px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow), 4px 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.win98-modal-body {
  padding: 16px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--chrome-darkest);
  text-align: left;
}

.win98-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
}
.win98-modal-buttons .login-btn {
  width: auto;
  padding: 6px 20px;
}
.win98-modal-buttons .win98-btn-sm {
  padding: 6px 20px;
}

/* ---------- BACKGROUND PICKER (Settings > Background) ---------- */
.bgpicker-wrap {
  padding: 0 2px;
}
.bgpicker-intro {
  font-size: 12px;
  color: var(--chrome-darkest);
  line-height: 1.6;
  margin: 0 0 16px;
}
.bgpicker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 130px);
  gap: 14px;
}
.bgpicker-tile {
  position: relative;
  width: 130px;
  border: 2px solid var(--chrome-darkest);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
  cursor: pointer;
  background: #1a1a1c;
  padding: 0;
  margin: 0;
  color: inherit;
  font-family: var(--font-ui);
  text-align: left;
}
.bgpicker-tile:disabled { cursor: not-allowed; }
.bgpicker-swatch {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.bgpicker-swatch img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.bgpicker-tile.locked .bgpicker-swatch img { opacity: 0.35; filter: grayscale(1); }
.bgpicker-lock {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 12px;
}
.bgpicker-name {
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 5px 6px;
  line-height: 1.3;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.bgpicker-tile.locked .bgpicker-name { color: #aaa; }
.bgpicker-tile.selected {
  border-color: #d0d0d0;
  box-shadow: 0 0 0 2px #d0d0d0, inset -1px -1px 0 var(--chrome-highlight), inset 1px 1px 0 var(--chrome-shadow);
}
.bgpicker-hint {
  font-size: 10px;
  color: #ffb3ac;
  padding: 4px 6px 0;
}

/* Origin: rice.e — Westbridge Terminal source. */
/* ---------- DESKTOP ICON GLYPHS: app logos on colour backdrops ---------- */
.app-icon[data-app="las"] .app-icon-glyph {
  background-color: #1f5c2e;
  background-image: url("backgrounds/las-logo.webp");
  background-size: 62%;
  background-position: center;
  background-repeat: no-repeat;
}
.app-icon[data-app="lfb"] .app-icon-glyph {
  background-color: #781313;
  background-image: url("backgrounds/lfb-logo.webp");
  background-size: 62%;
  background-position: center;
  background-repeat: no-repeat;
}
.app-icon[data-app="mps"] .app-icon-glyph {
  background-color: #0c2b53;
  background-image: url("backgrounds/mps-logo.webp");
  background-size: 62%;
  background-position: center;
  background-repeat: no-repeat;
}
.app-icon[data-app="pnc"] .app-icon-glyph {
  background-color: #0c2b53;
  background-image: url("backgrounds/mps-logo.webp");
  background-size: 62%;
  background-position: center;
  background-repeat: no-repeat;
}
.app-icon[data-app="moderation"] .app-icon-glyph {
  background-image: url("backgrounds/moderation-logo.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.app-icon[data-app="baf"] .app-icon-glyph {
  background-color: #2c2c1f;
  background-image: url("backgrounds/baf-logo.webp");
  background-size: 62%;
  background-position: center;
  background-repeat: no-repeat;
}
.app-icon[data-app="legislature"] .app-icon-glyph {
  background-color: #1b6cb1;
  background-image: url("backgrounds/legislature-logo.png");
  background-size: 70%;
  background-position: center;
  background-repeat: no-repeat;
}
.app-icon-glyph-calculator {
  background-color: #1c3f6e;
  background-image: url("backgrounds/calculator-icon.svg");
  background-size: 56%;
  background-position: center;
  background-repeat: no-repeat;
}
.app-icon-glyph-notes {
  background-color: #d8cf6a;
  background-image: url("backgrounds/notes-icon.svg");
  background-size: 56%;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---------- CALCULATOR APP ---------- */
.calc-display {
  flex: 0 0 auto;
  background: #ffffff;
  border: 1px solid var(--chrome-darkest);
  box-shadow: inset 1px 1px 0 var(--chrome-shadow);
  margin: 10px;
  margin-bottom: 6px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 40px;
}
.calc-display-value {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 600;
  color: var(--chrome-darkest);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.calc-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  padding: 0 10px 10px;
  min-height: 0;
}
.calc-btn {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--chrome-darkest);
  background: var(--chrome-face-dark);
  border: 1px solid var(--chrome-darkest);
  box-shadow: inset -1px -1px 0 var(--chrome-shadow), inset 1px 1px 0 var(--chrome-highlight);
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
}
.calc-btn:active {
  box-shadow: inset 1px 1px 0 var(--chrome-shadow), inset -1px -1px 0 var(--chrome-highlight);
}
.calc-btn-fn { background: #cbc8c0; }
.calc-btn-op {
  background: var(--titlebar-end);
  color: #ffffff;
  box-shadow: inset -1px -1px 0 rgba(0,0,0,0.35), inset 1px 1px 0 rgba(255,255,255,0.2);
}
.calc-btn-zero { grid-column: span 2; }

/* ---------- NOTES APP ---------- */
.notes-textarea {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: #ffffff;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  color: var(--chrome-darkest);
  padding: 12px 14px;
  box-sizing: border-box;
}
