body {
  background: #18181b;
  color: #f4f4f5;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
}
.container {
  max-width: 900px;
  margin: 2rem auto;
  background: #23232a;
  border-radius: 12px;
  box-shadow: 0 2px 12px #0004;
  padding: 2rem;
  width: 95vw;
}
@media (max-width: 950px) {
  .container {
    max-width: 98vw;
    padding: 1rem;
  }
}

header {
  text-align: center;
  margin-bottom: 2rem;
}
header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.2rem;
  color: #fbbf24;
}

#note-input-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
#note-content {
  min-height: 60px;
  border-radius: 8px;
  border: 1px solid #444;
  padding: 0.75rem;
  background: #18181b;
  color: #f4f4f5;
  font-size: 1rem;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: #444 #18181b;
}
/* For Webkit browsers (Chrome, Edge, Safari) */
.note-content::-webkit-scrollbar {
  width: 8px;
  background: #18181b;
  border-radius: 6px;
}
.note-content::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 6px;
  border: 2px solid #18181b;
}
.note-content::-webkit-scrollbar-thumb:hover {
  background: #666;
}

#add-note-btn {
  background: #fbbf24;
  color: #23232a;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.5rem;
  margin-bottom: 0.5em;
  transition: background 0.2s;
  width: 100%;
}
#add-note-btn:hover {
  background: #f59e42;
}

.notes-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  position: relative;
  margin-top: 0;
  padding-top: 0;
  min-height: 120px;
}
.notes-header h2 {
  margin: 0;
}
.notes-header-btns {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5em;
  margin-top: 0;
  padding-top: 0;
}
#go-to-archive-btn, #sync-notes-btn {
  width: 175px;
}
#unsynced-count {
  margin-left: 1rem;
  color: #fbbf24;
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 0.5em;
  display: block;
  text-align: right;
  width: 100%;
}

#notes-list-section {
  margin-bottom: 2rem;
}
#notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}
.note {
  display: grid;
  grid-template-columns: 1fr 140px;
  grid-template-rows: auto 1fr auto;
  background: #18181b;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 1rem;
  gap: 0.5rem;
  min-height: 90px;
  position: relative;
  overflow: hidden;
  max-height: 180px;
  margin: 0.5em 0;
  padding: 0.5em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Diagonal Ribbon */
.ribbon {
  position: absolute;
  top: 16px;
  right: -28px;
  width: 60%;
  min-width: 70px;
  max-width: 140px;
  text-align: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  transform: rotate(35deg);
  transform-origin: top right;
  box-shadow: 0 2px 8px #0006;
  z-index: 2;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px #0008;
  background: linear-gradient(120deg, #fff3 0%, #fff1 100%);
  border-top: 1.5px solid #fff4;
  border-bottom: 1.5px solid #fff4;
  opacity: 0.97;
  padding: 0.18rem 0;
  pointer-events: none;
}
.ribbon-synced {
  background: linear-gradient(120deg, #14532d 60%, #198754 100%);
  color: #fff;
}
.ribbon-unsynced {
  background: linear-gradient(120deg, #7f1d1d 60%, #e11d48 100%);
  color: #fff;
}

.note-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.note-content {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  white-space: pre-wrap;
  text-align: left;
  font-size: 1rem;
  align-self: start;
  max-height: 110px;
  overflow-y: auto;
  margin-right: 1rem;
  padding-right: 0.5rem;
}
.note-status-tag {
  display: inline-block;
  padding: 0.10rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: bold;
  border: none;
  letter-spacing: 0.02em;
  margin-right: 0;
  margin-left: 1rem;
  min-width: 90px;
  text-align: center;
}
.note-status-tag.synced {
  background: linear-gradient(90deg, #14532d 0%, #1e7a3a 100%);
  color: #fff;
  border: 1.5px solid #14532d;
}
.note-status-tag.unsynced {
  background: #fff;
  color: #23232a;
  border: 1.5px solid #fbbf24;
}
.note-meta {
  grid-column: 2 / 3;
  grid-row: 3 / 4;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 2.2rem;
}
.note-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.note-status-bar {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  width: 140px;
  padding: 0.18rem 0;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.08em;
  border-radius: 6px;
  box-shadow: 0 2px 8px #0006;
  text-shadow: 0 1px 2px #0008;
  background: linear-gradient(120deg, #fff3 0%, #fff1 100%);
  border-top: 1.5px solid #fff4;
  border-bottom: 1.5px solid #fff4;
  opacity: 0.97;
  z-index: 2;
  align-self: start;
  justify-self: end;
}
.note-status-bar.synced {
  background: linear-gradient(90deg, #14532d 60%, #198754 100%);
  color: #fff;
}
.note-status-bar.unsynced {
  background: linear-gradient(90deg, #7f1d1d 60%, #e11d48 100%);
  color: #fff;
}

.sync-single-btn,
.delete-note-btn {
  width: 140px;
  padding: 0.32rem 0;
  font-size: 0.95rem;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.08em;
  border-radius: 6px;
  box-shadow: 0 2px 8px #0006;
  text-shadow: 0 1px 2px #0008;
  border: none;
  opacity: 0.97;
  transition: background 0.2s, color 0.2s;
}
.sync-single-btn {
  background: linear-gradient(90deg, #184cb4 60%, #279abd 100%);
  color: #fff;
  border: 1.5px solid #279abd;
  align-self: flex-end;
}
.sync-single-btn:hover {
  background: linear-gradient(90deg, #279abd 60%, #184cb4 100%);
  color: #fff;
  border: 1.5px solid #279abd;
}
.delete-note-btn {
  background: linear-gradient(90deg, #7f1d1d 60%, #e11d48 100%);
  color: #fff;
  border: 1.5px solid #e11d48;
  align-self: flex-end;
  margin-left: 0.5rem;
}
.delete-note-btn:hover {
  background: linear-gradient(90deg, #e11d48 60%, #7f1d1d 100%);
  color: #fff;
  border: 1.5px solid #7f1d1d;
}

footer {
  text-align: center;
  color: #a1a1aa;
  margin-top: 2rem;
  font-size: 0.95rem;
}

.note-meta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.7rem;
  height: 100%;
}

.toggle-btn {
  font-weight: bold;
  margin-bottom: 0.5em;
}

#custom-toast {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #23232a;
  color: #fbbf24;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px #0004;
  max-width: 400px;
  font-weight: bold;
  font-size: 1.1rem;
  z-index: 9999;
  border: 3px solid #fbbf24;
  margin-left: 0;
  margin-right: auto;
  margin-top: 0;
  margin-bottom: 0;
  text-align: left;
}