/*


            ├๏┤    ├๏┤

               ﴾─๏─﴿ I have you now.



          ______┌─┐______
         │_____O│∩│O_____│
         ││    O│█│O    ││
         †│     │ │     │†
          †     │ │     †
                \_/  Use the force, Luke.
         ꍓ                 


                        ꍓ

*/
        @media (orientation: portrait) {
            #fullscreen.console>#header{display:none!important;}
            #fullscreen.novella>#header{display:block!important;}
            #switcher,
            #book,
            #code,
            #shortcuts,
            #save{
                top:10px;
            }
            #switcher{left:15px;}
            #save{right:15px;}
            #book,#code{left:33%;}
            #shortcuts{right:33%;}
            #notepad.console{
                padding:0px 10px 10px 10px;
                height:calc(100% - 29px);
            }
            .textarea-wrapper-container.console >
            .textarea-wrapper {
    	        margin-top:50px;
		        height:calc(100% - 50px)               
            }
    		#line-numbers {
                padding:0px 8px 10px 0;
                margin-top:50px;
		    }
	        #notepad.novella,
	        #notepad.novella.book{
                padding:50pt 18pt;
            }
            #context-menu{top:50px;}
        }

        @media (orientation: landscape) {
            #fullscreen>#header{display:none!important;}
            #switcher,
            #book,
            #code,
            #shortcuts,
            #save{
                right:15px;
            }
            #switcher{top:15px;}
            #save{bottom:15px;}
            #book,#code{top:33%;}
            #shortcuts{bottom:33%;}
            #notepad.console{
                padding:10px 50px 10px 10px;
                height:calc(100% - 30px) !important;
            }
		    #line-numbers{padding: 10px 8px 10px 0;}
            .textarea-wrapper-container.novella{ 
                height:calc(100% - 29px);
            }
            #notepad.novella{
                padding:36pt;
            }
            #notepad.novella.book{
                padding:4rem max(4rem, calc((100% - 800px)/2));
            }
            #context-menu{bottom:50px;}
        }

        html,body,#fullscreen{height:100%;width:100%;margin:0;padding:0;position:absolute;}
        html.console{background:black;}
        html.novella{background:white;}
        #fullscreen.console{background:#000;}
        #fullscreen.novella{background:#fff;}
        #notepad{
            width:100%;
            border:none; 
            outline:0;
            resize:none;
        }
        
        #notepad.console{
            font-size:12pt;
            font-family:monospace;
            background:#000;
            color:#fff;
            tab-size:4;
        }
        #notepad.console::selection{
            background:white;
            color:black;
        }
        #fullscreen.console.code{display:flex;}
        /* Combined Pre-Wrap Code Mode Styling Configuration */
        #fullscreen.console.code {
            display: flex !important;
            flex-direction: row;
            overflow: hidden;
        }
        
        .textarea-wrapper-container {
            display: none;
        }
        .textarea-wrapper-container.active { 
            display: block; 
            flex: 1;
        }

        .textarea-wrapper {
            position: relative;
            flex: 1;
            height: 100%;
            overflow: hidden;
        }

        #notepad.console.code, #backdrop {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            margin: 0;
            box-sizing: border-box;
            font-size: 12pt;
            font-family: monospace;
            line-height: 12pt;
            white-space: pre-wrap;
            word-wrap: break-word;
            tab-size: 4;
        }

        #notepad.console.code {
            background: transparent;
            color: #fff;
            z-index: 2;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* Hidden text replica block to calculate visual wrapper heights */
        #backdrop {
            padding: 10px;
            color: transparent;
            background: transparent;
            z-index: 1;
            overflow-y: hidden;
            pointer-events: none;
        }

        #line-numbers {
            width: 50px;
            background-color: #111;
            color: #0f0;
            text-align: right;
            overflow: hidden;
            user-select: none;
            font-family: monospace;
            font-size: 12pt;
            line-height: 12pt;
            box-sizing: border-box;
            height:calc(100% - 29px);
        }

        .line-num-block {
            box-sizing: border-box;
            line-height: 12pt;
        }

        
        #notepad.novella{
            height:100%;
            background:#fff;
            color:#333;
            font-family:sans-serif;
            font-size:24pt;
            line-height:1.4;
            margin:0 auto;
            tab-size:8;
        }
        #notepad.novella::selection{
            background:#ddd;
            color:#333;
        }
        
        #notepad.novella.book{
            font-family:serif!important;
            text-align:justify!important;
        }
        
        #switcher,
        #book,
        #code,
        #shortcuts,
        #save{
            position:fixed;
            height:30px;
            width:30px;
            z-index:10;
            cursor:pointer;
        }
        
        #switcher>svg,
        #book>svg,
        #code>svg,
        #shortcuts>svg,
        #save>svg{
            width:100%;
            height:100%;
        }
        
        #tolight,
        #code,
        #c-short,
        #c-short,
        #c-save{
            filter:invert(1);
        }
        #code.green{
            filter:brightness(0)
                   saturate(100%)
                   invert(57%)
                   sepia(42%)
                   saturate(5129%)
                   hue-rotate(86deg)
                   brightness(123%)
                   contrast(124%);
        }

        #tolight,
        #todark,
        #book,
        #opened,
        #closed,
        #code,
        #c-short,
        #n-short,
        #c-save,
        #n-save,
        #FileInput,
        #line-numbers,
        #images{
            display:none;
        }
        .active{display:block!important;}
        .novella>#line-numbers.active{display:none!important;}
        
    /* The core container for the context menu */
    #context-menu {
      background-color: #ffffff;
      border: 1px solid #e4e6eb;
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      min-width: 160px;
      padding: 6px 0;
      position: fixed;
      display: none;
      z-index: 1000;
      right:15px;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }

    /* Menu list styles */
    #context-menu ul {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    /* Individual menu links/buttons */
    #context-menu ul li {
      padding: 8px 14px;
      font-size: 14px;
      color: #050505;
      cursor: pointer;
      transition: background-color 0.15s ease;
    }

    /* Hover effect */
    #context-menu ul li:hover {
      background-color: #f2f2f2;
    }

    /* Decorative separator line */
    #context-menu ul li.separator {
      height: 1px;
      background-color: #e4e6eb;
      margin: 4px 0;
      padding: 0;
      cursor: default;
    }
    
svg,img {
  /* Prevents text/image selection highlight */
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE 10+ and Edge */
  user-select: none;         /* Standard syntax */

  /* Prevents the semi-transparent blue overlay on mobile tap */
  -webkit-tap-highlight-color: transparent;

  /* Prevents Safari iOS context menu pop-up on long press */
  -webkit-touch-callout: none;

  /* Prevents ghost image dragging */
  -webkit-user-drag: none;
  user-drag: none;
}

#counter{pointer-events:none;}

#counter.console{
    position: absolute;
    bottom: 0;
    left: 0;
    margin: 0;
    padding: 7px 10px;
    color: #0f0;
    font-family: monospace;
    background: #000;
    width: 100%;
    box-sizing: border-box;
    z-index: 5;
    border-top: 1px solid;
    border-image: linear-gradient(to right, #0f0, #000) 1;
}
#counter.console::selection{
    background:#000;
    color:#fff;
}

#counter.novella {
    color: black;
    font-family: sans-serif;
    font-size: 16pt;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0px, #fff 32px);
    display: flex;
    align-items: flex-end; 
    width: 100%;
    height: 60px; 
    left: 0;
    right: 0;
    bottom: 0;
    position: fixed;
    padding-left: 8px;
    padding-bottom: 16px;
    margin: 0;
    line-height: 1.2; 
}
#counter.novella>span {
    margin-right: 8px;
    margin-left: 8px;
}
#counter.novella::selection{
    background:#fff;
    color:#333;
}

#header{
    background:linear-gradient(to top, rgba(255, 255, 255, 0) 0px, #fff 32px);
    width:100%;
    height:60px; 
    left:0;right:0;top:0;
    position:fixed;
    margin:0;
    z-index:1;
    padding-top:20px;
}

#qrcode{
    height:100%;
    width:100%;
    display:none;
    z-index:10;
    background:rgba(255,255,255,0.8);
}
#qrcode.active{display:block!important;}
#qrcode>img{
    display:block!important;
    max-height:80%;
    max-width:80%;
    height:auto;
    width:auto;
    margin:auto;
    position:absolute;
    border:16px solid white;
    border-radius:16px;
}
#qrcode,#qrcode>img{
    top:0;right:0;left:0;bottom:0;
    position:absolute;
}

#list-link{
    color:darkred;
    text-decoration:none;
    font-weight:bold;
}

/* Full-screen backdrop overlay */
.alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Alert dialog box */
.alert-box {
  background-color: #ffffff;
  border: 1px solid #e4e6eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding-top: 6px;
}

#ab-title{
    text-align:center;
    background:#f8f9fa;
}

/* Centered Tab Header Bar */
.alert-tabs {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #e4e6eb;
  background-color: #f8f9fa;
  padding: 8px 40px 0 40px; /* Buffer space for top-right close icon */
  gap: 12px;
}

/* Tab Buttons */
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #606770;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tab-btn:hover {
  color: #050505;
}

.tab-btn.active {
  color: #000000;
  border-bottom-color: #000000;
  font-weight: 600;
}

/* Scrollable message content container */
.alert-content {
  padding: 16px;
  font-size: 14px;
  color: #050505;
  line-height: 1.5;
  overflow-y: auto;
  white-space: pre-wrap;
}

.alert-content b,
.alert-content strong {
  font-weight: 600;
  color: #000000;
}

/* Close "X" Button Styling */
.alert-close-x {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  padding: 5px;
  border-radius: 50%;
  color: #606770;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
  z-index: 2001;
}

.alert-close-x:hover {
  background-color: #e4e6eb;
  color: #050505;
}

/* Find & Replace Dialog Box Adjustment */
.fr-box {
  padding: 20px;
  max-width: 380px;
  align-items: center;
}

/* Centered Title */
.fr-title {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #050505;
  text-align: center;
}

/* Input Stack */
.fr-input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Input Field Styling */
.fr-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e4e6eb;
  border-radius: 6px;
  font-size: 14px;
  color: #050505;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

/* Centered Placeholder Text */
.fr-input::placeholder {
  text-align: center;
  color: #8a8d91;
}

.fr-input:focus {
  border-color: #000000;
}

/* Instance Counter Text */
.fr-count {
  margin: 12px 0 16px 0;
  font-size: 12px;
  color: #606770;
  text-align: center;
  white-space: pre-line;
}

/* Side-by-Side Buttons Layout */
.fr-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* Generic Button Style */
.fr-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-family: inherit;
}

/* Cancel Button */
.fr-btn-secondary {
  background-color: #ffffff;
  border: 1px solid #e4e6eb;
  color: #050505;
}

.fr-btn-secondary:hover {
  background-color: #f2f2f2;
}

/* Replace All Button */
.fr-btn-primary {
  background-color: #000000;
  border: 1px solid #000000;
  color: #ffffff;
}

.fr-btn-primary:hover {
  background-color: #333333;
}

/* Input Field Styling */
.fr-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e4e6eb;
  border-radius: 6px;
  font-size: 14px;
  color: #050505;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
  text-align: center; /* Centers the typed input text */
}

/* Centered Placeholder Text */
.fr-input::placeholder {
  text-align: center;
  color: #8a8d91;
}

#hidden1,#hidden2,#hidden3{
    display:none;
    position:fixed;
    left:0;right:0;top:0;bottom:0;
    height:100%;width:100%;
    margin:auto;
    z-index:50;
    object-fit:contain;
    image-rendering:pixelated;
}

/*      What are you doing poking around in here?
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡄⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⠟⠉⠉⢠⡞⠁⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢧⣠⡗⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⠋⢠⠀⠀⣸⠁⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⡏⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢻⡀⠀⡇⢠⣻⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⡾⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⡄⠈⠘⣿⣶⣶⣶⣖⡀
⠀⠀⠀⠀⢀⡤⣲⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⢰⣿⣿⡿⠋⠉⠙
⠀⠀⠀⣴⣯⣏⣽⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⣼⢿⢻⠀⠀⠀⢀
⣦⣤⣾⣿⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣁⣿⡊⠀⠀⠀⣠⠞
⠈⠿⣿⣿⣿⣿⣿⣿⠀⣰⣳⠤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⢈⣷⡏⢇⠀⠀⠀⠀⣿⡇⠁⠀⣠⠟⠁⠀
⠀⠀⠙⣿⣿⣿⣿⣿⠀⣿⣿⡷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣷⣼⣿⣿⡟⠀⠀⠀⢰⣿⣷⣶⠊⡅⠀⠀⠀
⡀⠀⢀⠈⢻⣿⣿⣿⣆⠈⠛⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠀⠀⠀⠀⣾⣿⣿⠃⡼⠁⣰⠆⠀
⠹⣄⠀⢧⠀⢻⣿⣿⣿⣷⡀⠀⠀⠀  ⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⢳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡼⣿⣿⠃⡰⠁⢀⡏⠀⢀
⠀⢻⡄⠘⣆⠀⢻⣿⣿⣿⣯⣦⣀⠀⠀⠀⠀⠀⣠⡴⠀⠀⠀⠀⠀⠀⠈⢿⣔⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⠟⣸⣿⣿⢠⠃⢀⣾⠁⠀⢈
⡇⠀⢿⠀⢹⡆⠘⣿⣿⣿⣿⣿⣿⣿⣿⡶⠶⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠷⣶⣴⣶⣤⣤⣤⡶⠛⠁⢀⣿⣿⣿⣞⡆⢻⣿⠀⠀⠏
⣷⠀⢨⠃⢠⣧⠀⢸⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠀⠀⢠⠀⣸⣿⣿⣿⣧⣿⠚⠻⠀⢸⠀
⡏⠀⡸⠀⡾⠈⢧⣈⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⣿⣿⣷⣂⣀⡇⠀
⢱⡀⢁⡰⠁⠀⠀⢛⡛⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠸⣿⣿⣿⣿⣿⡿⠉⠉⢉⠁⠀
      Well, did you find what you were looking for?     */