
    body {
      font-family: 'Inter', sans-serif;
      margin: .5rem 2rem 2rem;
      --light1: #fcfbf9;
      --light2: #f4f2ed;
      --light3: #cdccca;
      --accent: #F35A5A;
      /* --dark1: #333333;
      --dark2: #555555;
      --dark3:#888888;
      --dark4: #bbbbbb; */
      --dark1: #121212;
      --dark2: #282828;
      --dark3: #3f3f3f;
      --dark4: #575757;
      --dark5: #717171;
      --dark6: #949391;
      background: var(--light1)
    }



    h1 {
      display: flex;
      gap: .4rem;
      color: var(--dark3);
      font-size: 1.3rem;
      font-weight: 600;
      margin-bottom: .5rem;
    }

    #branding {
      display: flex;
      gap: .4rem;
      align-items: center;
      justify-content: space-between;
    }

    h2 {
      color: var(--dark3);
      font-weight: normal;
      font-size: 1rem;
      margin-bottom: .3rem;
    }
  

    p {
      font-size: .8rem;
      margin-top: .5rem;
    }
    h1 svg {
      width: 1.2rem;
    }
    h1 svg,
    footer span,
    footer a:hover {
      color: var(--accent);
    }

    .note.add-note {
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 24px;
      font-weight: bold;
      background: var(--light2);
      opacity: .7;
      cursor: pointer;
      min-height: 250px;
      color:var(--dark3);
    }

    .note.add-note:hover {
      opacity: 1;    }

    #notesGrid {
      margin-top: .5rem;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
      gap: 15px;
      max-width: 100%;
    }

    .note {
      background: var(--light2);
      padding: .5rem .5rem .2rem .5rem;
      border-radius: 5px;
      min-height: 250px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    .note textarea {
      color: var(--dark1);
      width: 100%;
      border: none;
      background: transparent;
      resize: none;
      outline: none;
      font-family: inherit;
      font-size: 16px;
      line-height: 1.4;
      flex-grow: 1;
      min-height: 50px;
    }

    .note.code textarea {
      font-family: monospace;
      color: var(--dark2);
      font-size: 14px;
    }


    .note button {
      align-self: flex-end;
      margin-top: 5px;
      padding: 2px 6px;
      border: none;
      color: var(--dark3);
      cursor: pointer;
      font-weight: bold;
      font-size: 14px;
      line-height: 1;
      background: none;
    }

    .note button:hover {
      color: var(--dark2);
    }

    .note textarea::placeholder {
      color: var(--light3);
    }

    #exportBtn, #importBtn {
      background: var(--dark1);
      border: none;
      cursor: pointer;
      border-radius: 3px;
      color: var(--light1);
      padding: .3rem .5rem;
    }

    #exportBtn:hover,
    #importBtn:hover {
      background: var(--dark3);
    }

    #confirmPopup {
      display: none;
      /* hidden by default */
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.4);
      justify-content: center;
      align-items: center;
    }

    #confirmPopup .popup-content {
      background: var(--light1);
      padding: 20px;
      border-radius: 8px;
      text-align: center;
      min-width: 200px;
    }

    #confirmPopup button {
      border: none;
      padding: 5px 20px;
      border-radius: 5px;
      cursor: pointer;
    }

    #confirmYes {
      color: var(--light1);
      background: var(--dark2);
    }

    #confirmNo {
      color: var(--light1);
      background: var(--dark2);
    }

    #confirmYes:hover {
      background: var(--accent);
    }

    #confirmNo:hover {
      background: var(--dark2);
    }

    .note-buttons {
      cursor: grab;
    }

    .note-buttons:active {
      cursor: grabbing;
    }

    footer {
      margin-top: 1rem;
      padding-top: 1rem;
      font-size: 12px;
    }

    footer a {
      color:var(--dark2);
      text-decoration: none;
    }

    /* --- DARK MODE TOGGLE --- */
    .dark-toggle {
      display: inline-flex;
      align-items: center;
      cursor: pointer;
      user-select: none;
      font-size: 14px;
      margin: 1rem 0;
    }

    .dark-toggle input {
      display: none;
    }
    .dark-toggle svg, .layout-toggle svg {
      color: var(--dark4);
    }

    .dark-toggle .slider, .layout-toggle .slider {
      position: relative;
      width: 40px;
      height: 20px;
      background: var(--light2);
      border-radius: 10px;
      margin-right: 8px;
      transition: 0.3s;
    }

    .dark-toggle .slider::before {
      content: "";
      position: absolute;
      width: 16px;
      height: 16px;
      left: 2px;
      top: 2px;
      background: var(--light2);
      border-radius: 50%;
      transition: 0.3s;
    }

    .dark-toggle input:checked+.slider::before {
      transform: translateX(20px);
    }

    body.dark .dark-toggle .slider, body.dark .layout-toggle .slider {
      background: var(--dark3);
    }

        /* Grid toggle */
        .layout-toggle {
          display: inline-flex;
          align-items: center;
          cursor: pointer;
          user-select: none;
          font-size: 14px;
        }
    
        .layout-toggle input {
          display: none;
        }
    
      .dark-toggle .slider::before,
      .layout-toggle .slider::before {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        left: 2px;
        top: 2px;
        background: var(--dark6);
        border-radius: 50%;
        transition: 0.3s;
      }


        .dark-toggle input:checked+.slider::before,
        .layout-toggle input:checked+.slider::before {
          transform: translateX(20px);
        }

    
        /* --- LARGE CARD MODE --- */
        body.large-cards #notesGrid {
          grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
        }
    
        body.large-cards .note {
          padding: 1rem;
          min-height: 400px;
        }
    
        body.large-cards .note textarea {
          font-size: 18px;
          line-height: 1.5;
        }

    /* --- DARK MODE --- */
    body.dark {
      background: var(--dark1);
      color: var(--light1);
    }

    body.dark h1 {
      color: var(--light1);
    }

    body.dark p {
      color: var(--light3);
    }

    body.dark h2 {
      color: var(--light3);
    }

    body.dark .note {
      background: var(--dark2);
      border: 1px solid var(--dark3);
    }

    body.dark .note textarea {
      color: var(--light3);
    }

    body.dark .note.code textarea {
      color: var(--dark5);
    }

    body.dark .note button {
      color: var(--dark4);
    }

    body.dark .note button:hover {
      color: var(--dark6);
    }

    body.dark .note.add-note {
      background: var(--dark3);
      color: var(--dark5);
    }

    body.dark .note.add-note:hover {
      background: var(--dark3);
    }

    body.dark footer {
      color: var(--dark6);
    }

    body.dark footer a {
      color: var(--dark5);
    }

    body.dark #exportBtn, body.dark #importBtn {
      background: var(--dark5);
    }

    body.dark #exportBtn:hover,
    body.dark #importBtn:hover {
      background: var(--dark4);
    }

#filterSearchContainer {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
#tag-search {
  display: flex;
  gap: 1rem;
}

/* Tags styling */
.note-tags {
  color: var(--dark4);
  font-weight: normal;
  font-size: .5rem;
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0;
}

.note-tags .tag-btn {
  position: relative;
  font-size: 8px !important;
  line-height: 1.1;
  text-transform: uppercase;
  font-weight: 400 !important;
  padding: 2px 4px !important;
  border-radius: 5px !important;
  border: 1px solid var(--dark4) !important;
  background: none !important;
  color:var(--dark5) !important;
  cursor: pointer;
  margin-top: 0;
}
.note-tags-buttons {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
}

.note-tags-buttons .tag-btn.open {
  display: inline-block;
  margin-left: 4px;
}

.note-tags-buttons.open {
  display: flex;
}

.note-tags .tag-btn.selected:not([data-tag="all"]) {
  padding: 2px 12px 2px 3px !important;
}
.note-tags .tag-btn.selected:not([data-tag="all"])::after
{
  content: "";
  color: var(--accent);
  margin-left: 5px;
  display: inline-block;
  width: 5px;
  height: 5px;
  background-color: var(--accent) ;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  right: 3px;
}
/* Dark mode tags */
body.dark .note-tags .tag-btn {
  background: none !important;
  color: var(--dark5) !important;
}
body.dark .note-tags .tag-btn.selected {

}

#tagFilter {
  display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 0 1 auto;
    min-width: 0;
}

#tagFilter .note-tags .tag-btn {
  font-size: 12px;
  padding: 2px 5px;
  margin: 2px;
  border-radius: 4px;
  border: 1px solid var(--dark5);
  background: var(--light3;);
  color: var(--dark4) !important;
  cursor: pointer;
}

#tagFilter .tag-btn.selected {
}

body.dark #tagFilter .tag-btn {
}

body.dark #tagFilter .tag-btn.selected {
}

.note-tags-toggle svg {
  color: var(--dark5);
}

.note-tags-toggle:hover svg {
  color: var(--dark6);
}

.backup {
font-size: .7rem;
margin: 1rem auto 1rem 0;
}

.backup div {
margin: .7rem 0;
}

/* Search input styling */
.search-wrapper {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  max-width: 450px;
  width: auto;
}

#searchInput {
  width: 100%;
  min-width: 350px;
  padding: 5px 5px 5px 6px;
  font-size: 14px;
  border: 1px solid var(--dark3);
  border-radius: 3px;
  outline: none;
}

#clearSearch {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: var(--dark2);
  display: none;
  user-select: none;
}

/* show X when input has content */
#searchInput:not(:placeholder-shown)+#clearSearch {
  display: block;
}

/* Dark mode */
body.dark #searchInput {
  background-color: var(--dark2);
  color: var(--light3);
}

body.dark #clearSearch {
  color: var(--dark5);
}
@media (max-width: 600px) {
  body { margin: 1rem; }
  #branding {
    flex-direction: column;
    gap: 0;
    max-width: 80%;
    margin: 0 auto 1rem auto;
    text-align: center;
  }
  #filterSearchContainer {
    gap: .2rem;
  }
  h1 {
    font-size: 1.5rem;
  }
  #tag-search {
    flex-direction: column;
  }
  .layout-toggle { display:none; }
  .note.add-note {
    min-width: 100px;
    margin: 1rem auto;
    min-height: 100px;
  }
}
  


