/* A compact stock desk using the existing Windows desktop and character sprites. */
body.theme-31 #desktop #win-main.stock-desk {
  width: min(860px, calc(100vw - 24px)) !important;
  height: min(640px, calc(100dvh - var(--taskbar-h, 36px) - 24px)) !important;
  min-width: 0 !important; min-height: 0 !important;
  grid-template-rows: 24px 25px 48px minmax(0, 1fr) 25px;
  padding: 2px !important; background: #c0c0c0; overflow: hidden !important;
}
body.theme-31 #desktop #win-main.stock-desk:not(.hidden) { display: grid !important; }
body.theme-31 #desktop #win-main.stock-desk.hidden { display: none !important; }
#win-main.stock-desk > .titlebar { margin: 0 !important; }
.desk-menu { display: flex; align-items: stretch; gap: 2px; padding: 0 3px; font: 12px Tahoma, sans-serif; border-bottom: 1px solid #888; }
.desk-menu details { position: relative; }
.desk-menu summary { padding: 4px 8px; cursor: pointer; list-style: none; }
.desk-menu summary::-webkit-details-marker { display: none; }
.desk-menu details[open] > summary, .desk-menu summary:hover { color: #fff; background: #000080; }
.desk-menu-items { position: absolute; top: 100%; left: 0; min-width: 188px; padding: 3px; z-index: 80; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; box-shadow: 2px 2px #555; }
.desk-menu-items button { display: block; width: 100%; padding: 6px 12px; font: 12px Tahoma, sans-serif; text-align: left; border: 0; color: #000; background: transparent; white-space: nowrap; }
.desk-menu-items button:hover, .desk-menu-items button:focus-visible { background: #000080; color: white; }
.desk-menu details:last-child .desk-menu-items { left: auto; right: 0; }
.desk-tape-row { display: flex; align-items: stretch; gap: 5px; min-width: 0; padding: 4px 262px 4px 6px; }
.desk-tape { display: flex; flex: 1; overflow-x: auto; min-width: 0; align-items: center; background: #f4f4e8; border: 2px solid; border-color: #808080 #fff #fff #808080; font: 11px 'Courier New', monospace; font-variant-numeric: tabular-nums; }
.desk-tape-empty { padding: 7px; white-space: nowrap; }
.desk-tape-quote { flex-shrink: 0; display: grid; grid-template-columns: auto auto auto; gap: 1px 7px; background: transparent; border: 0; border-right: 1px solid #aaa; padding: 2px 9px; font: inherit; color: #111; text-align: left; cursor: pointer; }
.desk-tape-quote small { grid-column: 1 / -1; font-size: 9px; }
.tape-up { color: #235526; }.tape-down { color: #8b2020; }
#editTape { font: 10px Tahoma, sans-serif; padding: 3px 5px; }
body.theme-31 #desktop #win-main .desk-body { position: static !important; inset: auto !important; width: auto !important; display: grid !important; grid-template-columns: 180px minmax(0, 1fr); gap: 9px; padding: 4px 7px 7px !important; height: auto !important; min-height: 0 !important; overflow: visible !important; font: 12px Tahoma, sans-serif; }
.desk-companions { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; }
.desk-companions h2 { margin: 3px 0 7px; font: bold 11px Tahoma, sans-serif; text-transform: uppercase; color: #333; }
#win-main #petDirectory { display: flex !important; flex-direction: column; align-items: stretch; gap: 2px; height: auto !important; min-height: 0; overflow-y: auto !important; padding: 2px; border: 2px solid; border-color: #808080 #fff #fff #808080; }
body.theme-31 #win-main #petDirectory .agent-select-btn { flex: 0 0 auto; display: flex !important; align-items: center; height: auto !important; min-height: 40px !important; gap: 7px !important; padding: 5px !important; text-align: left; border: 0 !important; box-shadow: none !important; color: #111; background: transparent; }
body.theme-31 #win-main #petDirectory .agent-select-btn.active { background: #000080 !important; color: white !important; }
.desk-pet-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.theme-31 #win-main #petDirectory .desk-pet-label b { font: bold 12px Tahoma, sans-serif !important; }
body.theme-31 #win-main #petDirectory .desk-pet-label small { display: block !important; font: 10px/1.2 Tahoma, sans-serif; white-space: normal; color: inherit; }
#win-main #petDirectory .agent-thumb { position: relative; flex: 0 0 24px; width: 24px !important; height: 25px !important; overflow: hidden; }
.desk-conversation { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 75px 76px minmax(0, 1fr) auto 35px; gap: 6px; min-width: 0; min-height: 0; }
.desk-heading { padding-right: 247px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.desk-heading strong { font: bold 14px Tahoma, sans-serif; }
.desk-heading span { font: 11px Tahoma, sans-serif; }
.desk-mobile-companion { display: none; }
.desk-companion-header { display: grid; grid-template-columns: minmax(120px, .75fr) minmax(0, 1fr) 240px; align-items: stretch; gap: 7px; background: #d8d8d8; border: 1px solid; border-color: #fff #888 #888 #fff; padding: 4px 7px; min-width: 0; position: relative; overflow: visible; }
.desk-active-companion { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0; }
.desk-active-companion strong { font: bold 14px Tahoma, sans-serif; }
.desk-active-companion span { font: 11px Tahoma, sans-serif; }
.desk-active-companion small { font: 10px Tahoma, sans-serif; color: #555; }
.desk-speech-slot { display: flex; align-items: center; min-width: 0; overflow: hidden; }
body.theme-31 #desktop #win-main #stageBubble { position: static !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; max-height: 76px !important; padding: 5px !important; margin: 0 !important; font: 11px/1.3 Tahoma, sans-serif !important; white-space: normal !important; overflow-wrap: anywhere; overflow: auto !important; border: 1px solid #888 !important; border-radius: 0 !important; box-shadow: none !important; transform: none !important; background: #ffffe1; }
body.theme-31 #desktop #win-main #stageBubble::before, body.theme-31 #desktop #win-main #stageBubble::after { display: none !important; }
body.theme-31 #desktop #win-main #companionStage { position: relative !important; width: auto !important; height: auto !important; inset: auto !important; min-width: 0; overflow: visible; }
#petSpriteStage { position: absolute; bottom: 0; width: 100%; height: 200px; overflow: visible; isolation: isolate; pointer-events: none; }
body.theme-31 #petSpriteStage .petos-clippy-agent { z-index: 1 !important; pointer-events: none !important; filter: none !important; }
body.theme-31 #desktop #win-main #chatHistory { margin: 0 !important; height: auto !important; min-height: 0 !important; max-height: none !important; overflow: auto !important; background: #fffffa !important; border: 2px solid !important; border-color: #808080 #fff #fff #808080 !important; padding: 7px !important; font: 12px/1.45 Tahoma, sans-serif !important; }
body.theme-31 #win-main #chatHistory .chat-message { display: grid !important; grid-template-columns: 55px minmax(0, 1fr) !important; gap: 5px !important; padding: 7px 1px !important; border-bottom: 1px solid #ddd; border-radius: 0; overflow-wrap: anywhere; }
#win-main .suggested-questions { display: flex !important; flex-wrap: wrap; gap: 4px; }
#win-main .suggested-questions .ui-btn { font: 11px Tahoma, sans-serif; padding: 4px 7px; }
.desk-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 55px auto; align-items: center; gap: 5px; min-width: 0; }
.desk-input-row > input { box-sizing: border-box; width: 100%; height: 33px; min-width: 0; padding: 4px 6px; border: 2px solid; border-color: #888 #fff #fff #888; background: #fff; font: 12px Tahoma, sans-serif; }
.desk-input-row > button { height: 33px; font: 12px Tahoma, sans-serif; }
.desk-voice { display: flex; align-items: center; gap: 2px; font: 10px Tahoma, sans-serif; white-space: nowrap; }
.desk-statusbar { display: flex; gap: 3px; min-width: 0; padding: 2px 3px; font: 10px Tahoma, sans-serif; }
.desk-statusbar span { padding: 3px 5px; border: 1px solid; border-color: #888 #fff #fff #888; white-space: nowrap; }
.desk-statusbar #chatStatus { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.desk-dialog { width: min(470px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 65px); padding: 2px; background: #c0c0c0; color: #111; border: 2px solid; border-color: #fff #404040 #404040 #fff; border-radius: 0; box-shadow: 3px 3px #444; font: 12px Tahoma, sans-serif; }
.desk-dialog::backdrop { background: rgb(0 0 0 / 15%); }
.desk-dialog .titlebar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; background: #000080; color: white; padding: 3px 5px; min-height: 24px; }
.desk-dialog .titlebar button { color: #000; background: #c0c0c0; border: 2px solid; border-color: #fff #444 #444 #fff; width: 20px; height: 20px; line-height: 14px; }
.desk-dialog-body { padding: 12px; display: grid; gap: 10px; overflow: auto; max-height: calc(100dvh - 130px); }
.desk-dialog p { margin: 0; line-height: 1.4; }
.desk-control-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.desk-control-label input, .desk-control-label select { min-width: 0; flex: 1; padding: 5px; background: #fff; border: 2px solid; border-color: #888 #fff #fff #888; font: inherit; }
.desk-control-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.desk-dialog .ui-btn { font: inherit; padding: 5px 10px; }
.desk-diagnostics-log { max-height: 280px; min-height: 90px; overflow: auto; padding: 8px; background: #fff; border: 2px solid; border-color: #888 #fff #fff #888; font: 11px/1.4 'Courier New', monospace; }
.desk-diagnostics-log .chat-message { display: block; margin: 0 0 7px; overflow-wrap: anywhere; }
.desk-diagnostics-log .chat-message b { margin-right: 6px; }
#watchlistChoices { min-height: 100px; max-height: 310px; overflow: auto; padding: 4px; background: #fff; border: 2px solid; border-color: #888 #fff #fff #888; }
#watchlistChoices label { display: grid; grid-template-columns: 18px 60px minmax(0, 1fr); gap: 5px; align-items: center; padding: 5px; border-bottom: 1px solid #ddd; font-size: 11px; }
@media (max-width: 700px) {
  body.theme-31 #desktop #win-main .desk-body { grid-template-columns: minmax(0, 1fr); padding: 4px !important; }
  .desk-companions { display: none; }
  .desk-conversation { grid-template-rows: 56px 27px 58px minmax(0, 1fr) auto 35px; gap: 5px; }
  .desk-mobile-companion { min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 11px; padding-right: 136px; }
  .desk-heading { padding-right: 136px; }
  .desk-tape-row { padding: 4px 6px; }
  #petSpriteStage { height: 112px; }
  .desk-mobile-companion select { flex: 1; min-width: 0; padding: 3px; font: 11px Tahoma, sans-serif; }
  .desk-heading strong { font-size: 12px; }.desk-heading span { font-size: 10px; }
  .desk-companion-header { grid-template-columns: 95px minmax(0, 1fr) 128px; gap: 4px; padding: 3px; }
  .desk-active-companion strong { font-size: 12px; }.desk-active-companion span { font-size: 10px; }
  .desk-active-companion small { display: none; }
  body.theme-31 #desktop #win-main #stageBubble { max-height: 65px !important; font-size: 10px !important; }
  .desk-menu { font-size: 10px; gap: 0; }.desk-menu summary { padding: 5px 6px; }
  .desk-statusbar { font-size: 9px; gap: 2px; }.desk-statusbar span { padding: 3px; }
  .desk-statusbar #chatStatus { display: none; }
  #win-main .suggested-questions .ui-btn { font-size: 10px; padding: 4px 5px; }
  .desk-input-row { grid-template-columns: minmax(0, 1fr) 43px auto; }
  .desk-input-row > input { font-size: 11px; }
}
@media (max-height: 480px) {
  body.theme-31 #desktop #win-main.stock-desk { grid-template-rows: 24px 23px 39px minmax(0, 1fr) 24px; }
  .desk-conversation { grid-template-rows: 55px minmax(35px, 1fr) 25px 33px; gap: 3px; }
  .desk-heading, .desk-mobile-companion { display: none; }
  .desk-tape-row { padding: 4px 6px; }
  #petSpriteStage { height: 100%; }
  .desk-mobile-companion { padding-right: 0; }
  .desk-companion-header { grid-template-columns: 110px minmax(0, 1fr) 65px; padding: 2px; }
  .desk-active-companion small { display: none; }
  body.theme-31 #desktop #win-main #stageBubble { max-height: 42px !important; font-size: 10px !important; }
  #win-main .suggested-questions { flex-wrap: nowrap; overflow: auto; }
  #win-main .suggested-questions .ui-btn { flex-shrink: 0; padding: 2px 5px; font-size: 10px; }
}
@media (max-width: 700px) and (max-height: 480px) {
  .desk-conversation { grid-template-rows: 23px 44px minmax(20px, 1fr) 25px 33px; }
  .desk-mobile-companion { display: flex; }
}

#watchlistChoices label { grid-template-columns: 18px 26px 54px minmax(0, 1fr); }
.desk-tape-quote .stock-logo { grid-row: 1 / 3; }

.desk-start-guide { border: 1px solid #aaa; background: #f4f4e8; padding: 8px; margin-bottom: 8px; font: 11px/1.4 Tahoma, sans-serif; }
.desk-start-guide p { margin: 4px 0 7px; }
.desk-start-guide > div { display: flex; flex-wrap: wrap; gap: 4px; }
.desk-start-guide .ui-btn { font: inherit; padding: 3px 6px; }
#briefDialog { width: min(690px, calc(100vw - 24px)); }
#briefContent { display: grid; gap: 9px; min-width: 0; overflow-wrap: anywhere; }
#briefContent table { font-size: 11px; }
#briefContent h3 { font: bold 12px Tahoma, sans-serif; margin: 10px 0 0; }
#briefContent p > small, #briefContent td > small { display: block; font-size: 10px; color: #444; }
#briefContent p a { display: block; }
.desk-alert-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-bottom: 1px solid #888; padding: 7px 0; }
.desk-notice { border: 1px solid #888; color: #000080; background: #ffffe1; font: 10px Tahoma, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.desk-heading:has(.desk-notice:not([hidden])) > span { display: none; }
#statusData h2 { font: bold 16px Tahoma, sans-serif; }
#statusData h3 { font: bold 13px Tahoma, sans-serif; margin: 18px 0 5px; }
#statusData { overflow-wrap: anywhere; }
#statusData a { display: block; margin-top: 8px; }

#stageBubble mark { background: #000080; color: #fff; }

#compareDialog { width: min(760px, calc(100vw - 24px)); }
#compareBody { overflow-x: auto; }
#compareBody h3 { font-size: 13px; }
#compareDialog textarea { display: block; width: 100%; box-sizing: border-box; min-height: 65px; font: 12px Tahoma, sans-serif; }
#researchNotes { max-height: 150px; overflow: auto; overflow-wrap: anywhere; }

#deskpassData { overflow-wrap: anywhere; }
#deskpassData h2 { font-size: 16px; }
#deskpassData th { width: 40%; }
.notification-settings { border-top: 1px solid #888; margin-top: 12px; padding-top: 6px; }
.notification-settings h3, .token-activity h3 { font-size: 13px; }
.token-activity { border-top: 1px solid #888; margin-top: 12px; padding-top: 6px; font: 12px/1.5 Tahoma, sans-serif; overflow-wrap: anywhere; }
.token-activity a { color: #000080; }

.window.is-dragging { transition: none !important; user-select: none; }
