body {
  display: flex;
  flex-direction: column;
  align-items: center;
  
  font-family: 'Libre Baskerville', serif;
  background-color: #135135; 
}

.hr{
   
  display: block;
  position: relative;
  width: 20%;
  left:1%;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  margin-left: auto;
  margin-right: auto;
  border-style: inset;
  border-width: 2px;
/* color the line */
  border-color: #6e0808;
}
.journalCover {
  position: absolute;
  top: 10%;
  left: 0%;
  width: 300px;
  height: 455px;
  border-radius: 10px;
  z-index: 400;
}
.journalCover.flipped {
  -webkit-transform: rotateY(-180deg);
  -moz-transform: rotateY(-180deg);
  transform: rotateY(-180deg);
}

.pageNumber {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #666;
  font-family: 'Courier New', monospace;
  z-index: 10;
}

.endCover {
  position: absolute;
  top: 10%;
  left: 0%;
  width: 300px;
  height: 455px;
  z-index: -1;
  pointer-events: none;
}


.endCover.flipped {
  -webkit-transform: rotateY(-180deg);
  -moz-transform: rotateY(-180deg);
  transform: rotateY(-180deg);
}
.rotate {
  -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-transition: -webkit-transform 1.4s;
  transition: transform 1.4s;
  -webkit-transform-origin: left;
  -moz-transform-origin: left;
  transform-origin: left;
  margin-bottom: 10px;
  cursor: pointer;
}

.front, .backCover, .frontEndCover {
  position: absolute;
  height: 98%;
  width: 98%;
  top: 1%;
  left: 0.0001%;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 10px;
}

/* Front cover with Firefox fix */
.front {
  background-size: cover;
  background-position: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: darkgreen;
  z-index: 2;
  /* Firefox fix: explicit transform to enable backface-visibility on children */
  -webkit-transform: rotateY(0deg);
  -moz-transform: rotateY(0deg);
  transform: rotateY(0deg);
}

.backCover {
  background-color: rgb(235, 209, 184);
  color: rgb(238, 120, 30);
  -webkit-transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
  transform: rotateY(180deg);
  z-index: 1;
}

/* Front end cover (inside of back cover) with Firefox fix */
.frontEndCover {
  background-color: rgb(235, 209, 184);
  color: rgb(238, 120, 30);
  z-index: 2;
  /* Firefox fix: explicit transform to enable backface-visibility on children */
  -webkit-transform: rotateY(0deg);
  -moz-transform: rotateY(0deg);
  transform: rotateY(0deg);
}

.backEndCover {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
 
  background-size: cover;
  background-position: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 10px;    
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
  transform: rotateY(180deg);
}

.mess{
  position: absolute;
  left:2%;
  color:#a1f618
}

.FCmess, .BCmess{
  position:absolute;
  top: 1%;/*  CHANGED THIS TO ACCOMADATE WEURDLY LONG TITLES*/
  left: 15%;
  text-align: center;
}

.FCmess{
  padding: 10%;
  color:#f78b0fbe;
}
/* Firefox change */
.FCmess-inner {
  position: relative;   /* Firefox-safe */
  width: 100%;
  height: 100%;
}

.BCmess{
  top:30%;
  left:0%;
  padding: 10%;
  color:#0f83f7;
  text-align: center;
}

FCsub{
  font-size: 0.3rem;
}

.year{
  font-weight: normal;
}
.cover-label {
  display: inline-block;
  min-width: 170px;
  max-width: 235px;
  padding: 8px 12px 9px;
  border-radius: 8px;

  position: absolute;
  top: 35%;
  left: 50%;
  transform: translateX(-50%);

  /* Default = light-cover preset, JS overrides this per brightness band */
  background: rgba(188, 181, 172, 0.74);
  border: 1px solid rgba(88, 68, 58, 0.18);
  box-shadow: 0 2px 6px rgba(0,0,0,0.16);

  /* Keep glass effect subtle so text stays crisp */
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.FCtxt {
  display: block;
  text-align: center;
  line-height: 1.04;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.015em;

  /* Default = light-cover preset */
  color: #4b0f15;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.38),
    0 1px 2px rgba(0,0,0,0.18);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

.coverText2 {
  display: block;
  margin-top: 0.14rem;
  margin-bottom: 0.10rem;
  text-align: center;
  line-height: 1;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #7ea347;
  text-shadow: 0 1px 0 rgba(255,255,255,0.28);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

.coverText3 {
  display: block;
  text-align: center;
  line-height: 1.04;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;

  /* Match main title by default */
  color: #4b0f15;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.38),
    0 1px 2px rgba(0,0,0,0.18);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

.FCtxt2 {
  color: #e1c192;
}

.journalCover .front {
  position: relative;
}
.passMsg{
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #befc6c;
  font-size: 1rem;
}

.btn {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 10px 24px;
  font-size: 16px;
  cursor: pointer;
  z-index: 10000;
}

/*
___________________________________________________________________
inner journal pages
___________________________________________________________________
*/

#page1{
  z-index: 399;
  position: absolute;
  top: 11.5%;
  left: 0%;
}

.content {
  position: absolute;
  top: 12.5%;
  left: 0.1%;
  width: 285px;
  height:430px;
  background-color: rgb(227, 214, 201);
  border-radius: 10px;
  z-index: 399;
  -webkit-perspective: 1000px;
  -moz-perspective: 1000px;
  perspective: 1000px;
}

.content.flipped {
  -webkit-transition: -webkit-transform 0.8s;
  transition: transform 0.8s;
  -webkit-transform: rotateY(-180deg);
  -moz-transform: rotateY(-180deg);
  transform: rotateY(-180deg);
}

.content.pagestack{
  -webkit-transition: -webkit-transform 0.4s;
  transition: transform 0.4s;
  -webkit-transform: rotateY(-180deg);
  -moz-transform: rotateY(-180deg);
  transform: rotateY(-180deg);  
}

.content.goToDateFlipped {
  -webkit-transition: -webkit-transform 0.4s;
  transition: transform 0.4s;
  -webkit-transform: rotateY(-180deg);
  -moz-transform: rotateY(-180deg);
  transform: rotateY(-180deg);
}

.pageFront, .pageBack {
  position: absolute;
  height:100%;
  width: 100%;
  top: 0%;
  left: 1%;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  transform-style: preserve-3d;
  border-color: rgb(238, 180, 174);
  border-width: 5px;
  border-radius: 10px;
  background-color: linen;
  color: black;
}

.pageFront, .pageBack {
  border-radius: 16px;
  box-shadow:
    inset 0 8px 6px -6px rgba(0, 0, 0, 0.2),
    inset 0 -8px 6px -6px rgba(0, 0, 0, 0.2);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05),
    rgba(240, 240, 240, 1),
    rgba(255, 255, 255, 0.05)
  );
  -webkit-font-smoothing: antialiased;
  /* -moz-osx-font-smoothing: grayscale; */
}
.pageBack {
  -webkit-transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
  transform: rotateY(180deg);
}
.pageFront::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.2), transparent);
  pointer-events: none;
  z-index: 2;
}

.pageBack::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(to left, rgba(0,0,0,0.2), transparent);
  pointer-events: none;
  z-index: 2;
}

/* Highlight completed items */
.pageBack .entry-area::selection {
  background: #d4edda;
}

/* Scroll Editor Styles */
.notebook-scroll-editor {
  position: fixed;
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: 265px;
  height: 340px;
  max-height: 75vh;
  overflow-y: auto;
  padding: 10px;

  font-family: "Imperial", cursive;
  font-size: 0.8rem;
  line-height: 1.1;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  outline: none;
  box-sizing: border-box;
    perspective: 1000px;
  transform-origin: top center; /* Ensures it scales from the top down */
  transform: scale(1.28);        /* Change 0.8 to whatever size you want (1 = 100%) */
}

.page-marker {
  display: block;
  margin: 30px 0;
  text-align: center;
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
}

.page-divider {
  border: none;
  border-top: 2px dashed #999;
  margin: 10px 0;
}

.page-label {
  display: block;
  font-size: 11px;
  color: #666;
  font-style: italic;
  font-weight: bold;
  letter-spacing: 2px;
}

.scroll-editor-buttons {
  position: fixed;
  bottom: 30px;
  left: 80%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 10001;
}

.scroll-editor-buttons .btn {
  padding: 12px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#saveScrollEdit {
  background-color: #4CAF50;
  color: white;
}

#cancelScrollEdit {
  background-color: #f44336;
  color: white;
}

.content.goToDateFlippedBack {
  -webkit-transition: -webkit-transform 0.4s;
  transition: transform 0.4s;
  -webkit-transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
  transform: rotateY(180deg);
}


.edit-tab {
  position: absolute;
  top: 5px;
  right: 5px;
  text-align: center;
  width: 40px;
  padding: 5px 10px;
  background-color: #a4efa7b0;
  color: rgb(32, 84, 66);
  border-radius: 5px;
  cursor: pointer;
  font-size: 8px;
  z-index: 10;
}

.toDo {
  position: absolute;
  width: 10%;
  top: 5px;
  right: 15px;
  /* padding: 5px 10px; */
  background-color: #4c99af;
  color: white;
  border-radius: 5px;
  cursor:crosshair;
  font-size: 7px;
  z-index: 10;
}

.delete-tab {
  position: absolute;
  top: 1px;
  left : 10px;
  width: 30px;
  padding: 1px 10px;
  background-color: #e0c6c628;
  border-radius: 5px;
  cursor: help;
  font-size: 15px;
  text-align: center;
  margin:8px;
  z-index: 1;
} 
.delete-tab2x {
  position: absolute;
  top: 80%;
  left :50%;
  transform: translateX(-50%);
  width: 30px;
  padding: 1px 10px;
  background-color: #e0c6c628;
  border-radius: 5px;
   cursor: pointer;
  font-size: 20px;
  text-align: center;
  z-index: 1;
}


.notebookTitle{
  position: relative;
  top: 0px;
  left: 0%;
  transform: translateX(-0%);
  width: 30%;
  padding: 1px 10px;
  background-color: #e0c6c628;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  border-radius: 10px;
  border-top: 1px solid #135135;
  border-bottom: 1px solid #135135;
  cursor: help;
  font-size: 10px;
  text-align: center;
  z-index: 1;  
}

.pageFront.inactive .delete-tab {
  pointer-events: none;
  opacity: 0.1;
}

.editing-mode .page {
  pointer-events: none;
  opacity: 0.6;
}

.editable-area {
  position: absolute;
  top: 15px;
  left: 0;
  width: 100%;
  min-height: 420px;
  font-size: 0.8rem;
  padding: 20px;
  box-sizing: border-box;
  outline: none;
}

/* Cross-browser scrollbar styling */
.entry-area::-webkit-scrollbar {
  width: 8px;
}

.entry-area::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.entry-area::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.editable-area::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.entry-area {
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

.editable-area[contenteditable="true"] {
  color:#0f83f7;
  background-color: #befc6c;
}

.header-area {
  position: relative;
  left: 45px;
  top: 0px;
  width: calc(100% - 100px);
  font-size: 0.80rem;
  /* text-align: center; */
  padding: 10px 10px;

  border-radius: 5px;
  background-color: #45464600;
}

.header-date {
  font-weight: 600;
  letter-spacing: 0.5px;

}

.topLine{
  position: relative;
  top: 0px;
  height: 2px;
  width: 100%;
  background-color: #821010;
}


.entry-area {
  width: 100%;
  height: 347px;
  padding: 10px;
  box-sizing: border-box;
  outline: none;
  font-family: "Imperial", cursive;
  line-height: 1.1;
  font-size: 0.8rem;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  /* -moz-osx-font-smoothing: grayscale; */
}

.scaled-paste {
  display: inline-block;
  transform: scale(0.7, 0.5);
  transform-origin: top left;
}

.scaled-selection {
  outline: 1px dashed #888;
  background-color: rgba(255, 255, 0, 0.1);
  transition: transform 0.3s ease;
}

.scale-overlay {
  position: fixed;
  bottom: 20px;
  right: 2px;
  height: 150px;
  background: transparent;
  border: 1px solid #ccc;
  padding: 10px;
  z-index: 1000;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.scale-overlay button {
  margin: 1px;
  padding: 2px 5px;
  font-size: 0.5rem;
}

.scale-overlay {
  transition: opacity 0.3s ease;
}

.scale-overlay[style*="display: none"] {
  opacity: 0;
}

.scale-overlay[style*="display: block"] {
  opacity: 1;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #ddd;
  border-radius: 4px;
  outline: none;
}

.selectionReminder {
  position: fixed;
  /* below the book */
  /* bottom: -65px; */
  /* above the book */
  top: 25px;
  z-index: 10000000;
  left: -180px;
  font-size: 0.8rem;
  color: #666;
  margin: 5px auto;
  background-color: #e6f3f4;
  padding: 6px 10px;
  
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.selectionReminder::after {
  content: '|';
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Track */
input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #4caf50, #2196f3);
  height: 8px;
  border-radius: 4px;
}

/* Thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #ff5722;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -4px;
  box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

/* Firefox */
input[type="range"]::-moz-range-track {
  background: linear-gradient(to right, #4caf50, #2196f3);
  height: 8px;
  border-radius: 4px;
}

input[type="range"]::-moz-range-thumb {
  background: #ff5722;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  cursor: pointer;
}


.entry-area[contenteditable="true"] {
  border-color: salmon;
  border-width: 5px;
  border-radius: 10px;
}

.to-do-header{
  /* centralise this div */
  display: flex;
  justify-content: center;
  align-items: center;

  /* background-color: #ebb4b4b1; */
  text-align: center;
  /* position a bit lower */
  margin-top: 10px;
}

.todo-line {
  border-bottom: 1px solid #ccc;
  padding: 4px 0;
  min-height: 1.5em;
}

.todo-line:not(:last-child) {
  border-bottom: 1px solid #ce7575;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 1.9em;
  color: #666;
  margin-top: -13%;
}

.content.no-click {
  pointer-events: none;
  opacity: 0.8;
}

.FCtxt3 {
  display: block;
  text-align: center;
}

.FSize{
  font-size: 0.4rem;
  font-family: 'Brush Script MT', cursive;
  font-style: italic;
  color: rgb(165, 152, 152);
}

.TD{
  text-align: center;
  font-size: 14px;
  font-weight: bold;
}

.newEntry{
  position: absolute;
  left: 0%;  
  bottom: 5%;
  height: 25%;
  width: 280px;
  background-color: rgb(41, 90, 118);
  color: bisque;
  visibility: hidden;
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
  border-radius: 12px
}

.butttontxt{
  position: absolute;
  top: 0%;
  left: 70%;
  transform: translate(-50%, -50%);
  font-size:80%;
  color: #f5f5f3;
}

.legacy-library-actions {
  display: none !important;
}

.library-console-launcher {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  padding: 11px 18px;
  border: 1px solid #b28a4a;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3ddb3 0%, #d6b06d 100%);
  color: #3d2a13;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.library-console-launcher:hover {
  filter: brightness(1.03);
}

.library-console-modal-content {
  width: min(760px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  background-color: #1e5aa8;
}

.library-console-intro {
  margin: 8px 0 18px;
  line-height: 1.4;
}

.library-console-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.library-console-section {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
  text-align: left;
}

.library-console-section h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.library-console-section p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.library-console-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-console-action-btn,
.library-console-link-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.92rem;
  cursor: pointer;
}

.library-console-action-btn:hover,
.library-console-link-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.library-console-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.library-console-link-btn {
  width: auto;
  min-width: 140px;
  background: transparent;
}

.library-search-modal-content {
  width: min(760px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  background-color: #1e5aa8;
  text-align: left;
}

.library-search-copy {
  margin: 8px 0 14px;
  line-height: 1.4;
}

#librarySearchInput {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  margin-bottom: 12px;
}

.library-search-status {
  flex: 1 1 auto;
  margin-bottom: 0;
  font-size: 0.92rem;
  opacity: 0.9;
  text-align: left;
}

.library-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-search-result {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
  color: white;
  cursor: pointer;
}

.library-search-result:hover {
  background: rgba(255, 255, 255, 0.18);
}

.library-search-result__type {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  margin-bottom: 4px;
}

.library-search-result__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.library-search-result__meta {
  font-size: 0.9rem;
  margin-bottom: 4px;
  opacity: 0.9;
}

.library-search-result__match {
  font-size: 0.88rem;
  margin-bottom: 4px;
  color: #f2d58d;
}

.library-search-result__snippet {
  font-size: 0.9rem;
  line-height: 1.35;
  opacity: 0.95;
}

.library-search-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

#librarySearchInput {
  width: 100%;
  flex: 1 1 auto;
  box-sizing: border-box;
  margin-bottom: 0;
}

#librarySearchSubmit {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

#librarySearchSubmit:hover {
  background: rgba(255, 255, 255, 0.22);
}

.library-search-mode-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.library-search-mode-switch__btn {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.library-search-mode-switch__btn.is-active {
  background: rgba(255, 255, 255, 0.22);
}

.library-search-date-controls {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(90px, 0.8fr) minmax(110px, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.library-search-date-controls select,
.library-search-date-controls input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 1rem;
}

.library-search-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .library-search-date-controls {
    grid-template-columns: 1fr;
  }

  .library-search-mode-switch {
    flex-wrap: wrap;
  }
}

#librarySearchTextControls[hidden],
#librarySearchDateControls[hidden],
#librarySearchActions[hidden] {
  display: none !important;
}

.newBookModal{
  display:none;
}

input[type="password"] {
  padding: 10px;
  margin-top: 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 80%;
}

#submitPassword {
  margin-top: 15px;
  padding: 10px 20px;
  background-color: white;
  color: #155bc3;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#submitPassword:hover {
  background-color: #e0e0e0;
}

#passwordModal {
  display: none;
}

#overlayModal {
  position: fixed;
  top: 25%;
  left: 15%;
  width: 30%;
  height: 25%;
  color:#4CAF50;
  background: rgba(0,0,0,0.5);
  border: #107e65;
  border-radius: 8px;
  z-index: 1000;
  display: none;
}

.overlay-content {
  background-color:transparent;
  color: white;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.5rem;
}

#closeOverlayBtn{
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.notebook-controls__btn {
  padding: 8px 14px;
  border: 1px solid #6f6a5f;
  border-radius: 6px;
  background: linear-gradient(180deg, #f3efe4 0%, #ddd3be 100%);
  color: #2f2a22;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.notebook-controls__btn:hover {
  background: linear-gradient(180deg, #fbf8f0 0%, #d6c9ae 100%);
  border-color: #5d5649;
}

.sections-editor-modal {
  min-width: 540px;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.sections-editor-title {
  margin-bottom: 10px;
}

.sections-editor-copy {
  margin-bottom: 12px;
  line-height: 1.4;
}

.notebook-section-rows-header,
.notebook-section-row {
  display: grid;
  grid-template-columns: 110px 1fr 92px;
  gap: 10px;
  align-items: center;
}

.notebook-section-rows-header {
  margin-bottom: 8px;
  font-weight: 700;
}

.notebook-sections-rows {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.notebook-section-row {
  margin-bottom: 10px;
}

.notebook-section-row:last-child {
  margin-bottom: 0;
}

.notebook-section-page,
.notebook-section-title {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #8f9788;
  border-radius: 6px;
  font-size: 0.92rem;
}

.notebook-section-page:focus,
.notebook-section-title:focus {
  outline: none;
  border-color: #d5b35b;
  box-shadow: 0 0 0 2px rgba(213, 179, 91, 0.18);
}

.notebook-section-remove {
  min-width: 92px;
}

.sections-add-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.sections-save-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 700px) {
  .sections-editor-modal {
    min-width: 0;
    width: 100%;
  }

  .notebook-section-rows-header,
  .notebook-section-row {
    grid-template-columns: 88px 1fr 84px;
    gap: 8px;
  }

  .notebook-controls__btn {
    padding: 8px 10px;
    font-size: 0.86rem;
  }
}

#newJournalModal{
  display:none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
}

#passwordForm{
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width:90% ;
  background-color:#1965d6;
  padding: 5%;
}

.modal-content {
  background-color:#155bc3;
  color: white;
  padding: 20px;
  border-radius: 8px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.modal-content-info {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 360px;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  overflow: visible;
  background: linear-gradient(180deg, rgba(35, 66, 59, 0.98) 0%, rgba(24, 47, 42, 0.98) 100%);
  color: white;
  padding: 34px 18px 16px;
  border-radius: 12px;
  text-align: center;
  opacity: 1;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.modal-info {
  display: block;
  width: 100%;
  background: transparent;
  color: white;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}

.info-modal-tab {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ead7a5 0%, #cfb272 100%);
  color: #2e2415;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
  z-index: 2;
}

.info-modal-tab:active {
  cursor: grabbing;
}

.info-modal-body {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-right: 4px;
  text-align: left;
  line-height: 1.45;
}

.info-modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.modal-content-info #closeInfo {
  display: inline-block;
  margin: 0;
  padding: 8px 16px;
  border-radius: 6px;
  color: white;
  background-color: #3d6092;
  border: none;
  cursor: pointer;
}

.modal-content-info #closeInfo:hover {
  background-color: #4a73af;
}


.modal-info #closeInfo {
  display: inline-block;
  margin: 0;
  padding: 8px 16px;
  border-radius: 6px;
  background-color: #3d6092;
  color: white;
  border: none;
  cursor: pointer;
}

.modal-info #closeInfo:hover {
  background-color: #4a73af;
}

@media (max-width: 700px) {
  .modal-content-info {
    min-width: 0;
    width: calc(100vw - 20px);
    top: 72px;
    padding: 26px 14px 14px;
  }

  .info-modal-tab {
    min-width: 80px;
    padding: 7px 14px;
    font-size: 0.84rem;
  }
}

.export-selector.hidden {
  display: none;
}

.export-selector {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5000;
}

.export-selector-content {
  background: #fff;
  padding: 20px;
  width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.export-selector-list {
  margin: 15px 0;
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 10px;
}

.export-selector-list label {
  display: flex;
  align-items: center;
  padding: 6px 0;
  cursor: pointer;
}

#confirmDelete, #cancelDelete {
  margin: 10px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

#confirmCreate {
  background: #c8d8eb;
  color: rgb(229, 27, 27);
  border: none;
}

#cancelCreate {
  background: #d6f8b2;
  border: 1px solid #dee2e6;
}

#confirmDelete {
  background: #ff4444;
  color: white;
  border: none;
}

#cancelDelete {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

.msgheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 50rem;
  padding-bottom: 50%;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  border-radius: 5px;
  color: white;
  z-index: 1000;
}

.toast-success { background-color: #28a745; }
.toast-error { background-color: #dc3545; }
.toast-info { background-color: #17a2b8; }

.toast-message {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #155bc3;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 9999;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  opacity: 0.95;
}

.toast-error { background: #c31515; }
.toast-success { background: #155bc3; }

#loadingModal{
  display: none; 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background: rgba(186, 76, 76, 0.5); 
  z-index: 1000; 
  display: flex; 
  align-items: center; 
  justify-content: center;
}

.modal-content-loading{
  background: white; 
  padding: 20px; 
  border-radius: 5px;
}

.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.login-form input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.login-form button {
  padding: 10px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.login-form button:hover {
  background: #357abd;
}
/* cursor positioning */
/* Hide native caret and show custom underscore cursor */
/* .entry-area[contenteditable="true"] {
  caret-color: transparent;
  position: relative;
}

.entry-area[contenteditable="true"]::after {
  content: '_';
  position: absolute;
  animation: blink 1s step-end infinite;
  font-weight: bold;
  color: #333;
  margin-left: 1px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
} */

/* When there's a selection, hide the underscore */
.entry-area[contenteditable="true"].has-selection::after {
  display: none;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/*  item after caret And to do changes */
.todo-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 6px;
}

.todo-number {
  margin-right: 0.75rem; /* You can adjust this anytime */
  user-select: none;
}

.todo-text {
  flex: 1;
  outline: none;
  min-height: 1.2em;
}



.controls-title {
  font-weight: bold;
  margin-bottom: 8px;
  text-align: center;
  color: #444;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0;
}

.control-label {
  flex: 1;
  margin-right: 8px;
}

.control-button {
  padding: 4px 10px;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: linear-gradient(to bottom, #fff, #e6e6e6);
  cursor: pointer;
  font-size: 0.75rem;
}

.control-button:hover {
  background: linear-gradient(to bottom, #fdfdfd, #dcdcdc);
}

.delete-button {
  color: #b00;
  border-color: #c88;
}

/* Cover Picker Modal for Journals and Notebooks */
/* Cover Picker Modal */
#journalCoverPickerModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  background: #fdfdfd;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 20px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
}

#journalCoverPickerModal.visible {
  display: block;
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.cover-option {
  border: 2px solid transparent;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.cover-option:hover {
  border-color: #888;
}

.cover-option.selected {
  border-color: #0078d4;
}

.cover-option img {
  width: 100%;
  height: auto;
  display: block;
}

#confirmJournalCover {
  margin-top: 20px;
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 6px;
  border: none;
  background: #0078d4;
  color: white;
  cursor: pointer;
  opacity: 0.4;
}

#confirmJournalCover.enabled {
  opacity: 1;
  cursor: pointer;
}

#confirmJournalCover:disabled {
  cursor: not-allowed;
}
#cancelJournalCover{
    margin-top: 20px;
    margin-left: 30px;
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 6px;
  border: none;
  background: #0078d4;
  color: white;
  cursor: pointer;
  opacity: 0.4;
}
#cancelJournalCover.enabled {
  opacity: 1;
  cursor: pointer;
}

#cancelJournalCover:disabled {
  cursor: not-allowed;
}
.cover-picker-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.cover-theme-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 6px;
}

.cover-theme-btn {
  padding: 10px 12px;
  border: 1px solid #b7b7b7;
  border-radius: 6px;
  background: #f2efe8;
  color: #333;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
}

.cover-theme-btn:hover {
  background: #e8e1d2;
}

.cover-theme-btn.active {
  background: #0078d4;
  border-color: #0078d4;
  color: white;
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 0;
}

.cover-option-label {
  margin-top: 8px;
  font-size: 0.8rem;
  text-align: center;
  color: #444;
  word-break: break-word;
}

.cover-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.cover-picker-cancel {
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #888;
  background: #f2f2f2;
  color: #333;
  cursor: pointer;
}

.cover-picker-empty {
  color: #666;
  font-style: italic;
  padding: 12px 0;
}

@media (max-width: 700px) {
  .cover-picker-body {
    grid-template-columns: 1fr;
  }

  .cover-theme-list {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    overflow-y: visible;
  }

  .cover-theme-btn {
    text-align: center;
  }
}
.cover-theme-btn {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #b7b7b7;
  border-radius: 6px;
  background: #f2efe8;
  color: #333;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
}

.cover-theme-btn:hover {
  background: #e8e1d2;
}

.cover-theme-btn.active {
  background: #0078d4;
  border-color: #0078d4;
  color: white;
}

.cover-theme-preview {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #ddd;
}

.cover-theme-meta {
  min-width: 0;
}

.cover-theme-name {
  font-weight: 600;
  line-height: 1.1;
}

.cover-theme-count {
  margin-top: 4px;
  font-size: 0.78rem;
  opacity: 0.8;
}

.source-notebook-fields {
  margin-top: 12px;
  text-align: left;
}

.source-notebook-fields input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.source-notebook-help {
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.35;
  opacity: 0.9;
}

.notebook-search-highlight {
  background: rgba(255, 230, 120, 0.9);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.notebook-search-highlight {
  background: rgba(255, 230, 120, 0.9);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
