:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --panel: #fffefa;
  --side: #eeede7;
  --ink: #292e2b;
  --muted: #7a7e76;
  --line: #dedfd5;
  --accent: #3d6653;
  --select: #e6ede4;
  --gold: #b68b41;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.7 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
body.dark {
  color-scheme: dark;
  --bg: #202521;
  --panel: #252b26;
  --side: #1a201c;
  --ink: #e9ede6;
  --muted: #a1ac9e;
  --line: #3a443b;
  --accent: #a8ccb4;
  --select: #34483a;
  --gold: #e2b567;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  padding: 7px 12px;
}
button:hover {
  background: var(--select);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.primary {
  background: var(--accent);
  color: var(--panel);
  border: 0;
}
.primary:hover {
  filter: brightness(0.9);
  background: var(--accent);
}
.shell {
  display: grid;
  grid-template-columns: 235px 335px minmax(0, 1fr);
  height: 100dvh;
}
aside {
  background: var(--side);
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  overflow: auto;
}
.brand {
  text-decoration: none;
  color: var(--ink);
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 30px;
}
.brand small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding-right: 38px;
}
.logo {
  color: var(--accent);
  margin-left: 8px;
}
.section-label,
.eyebrow {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.7px;
}
.section-label {
  margin: 28px 10px 9px;
}
nav button {
  display: block;
  width: 100%;
  text-align: right;
  border: 0;
  margin: 3px 0;
}
nav button.active {
  background: var(--select);
  color: var(--accent);
  font-weight: 600;
}
.subtle {
  border: 0;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 35px;
}
.sidebar-bottom > button {
  border: 0;
}
.settings {
  display: flex;
  gap: 5px;
  margin-top: 16px;
}
.settings button {
  font-size: 12px;
}
.sidebar-bottom p {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 0;
}
.sidebar-bottom p span {
  color: var(--muted);
  font-size: 10px;
}
.listing {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 30px 20px 15px;
}
.listing header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h1 {
  font-size: 23px;
  margin: 3px 0 22px;
  letter-spacing: -0.7px;
}
#mobileNew {
  font-size: 25px;
  border: 0;
}
.search {
  display: flex;
  background: var(--side);
  border-radius: 9px;
  padding: 7px 10px;
  gap: 8px;
}
.search input {
  border: 0;
  background: none;
  width: 100%;
  outline: none;
  color: var(--ink);
  font-size: 13px;
}
.list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  margin: 16px 0 8px;
}
#mobileFolders {
  display: none;
}
#notes {
  overflow: auto;
  flex: 1;
}
.note-card {
  display: block;
  width: 100%;
  text-align: right;
  padding: 17px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 5px;
}
.note-card.selected {
  background: var(--select);
}
.note-card strong {
  display: block;
  font-size: 14px;
}
.note-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-card small {
  font-size: 10px;
  color: var(--muted);
}
.pin {
  color: var(--gold);
}
footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 15px;
}
footer button {
  font-size: 11px;
  border: 0;
}
main {
  background: var(--panel);
  min-width: 0;
  overflow: auto;
}
.empty-editor {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.empty-editor > span {
  font-size: 56px;
  color: var(--gold);
}
.empty-editor h2 {
  font-size: 22px;
  font-weight: 500;
  margin: 12px 0 0;
}
.empty-editor p {
  color: var(--muted);
  font-size: 13px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 20px 25px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.toolbar button,
.toolbar select {
  font-size: 12px;
}
.toolbar select {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
  max-width: 130px;
}
.save-state {
  font-size: 11px;
  color: var(--muted);
  margin-right: auto;
}
.paper {
  padding: 35px clamp(20px, 4vw, 70px);
  max-width: 1000px;
  margin: auto;
}
#title {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 30px;
  font-weight: 650;
  outline: none;
  margin-bottom: 18px;
}
#body {
  display: block;
  width: 100%;
  height: calc(100dvh - 270px);
  min-height: 250px;
  resize: vertical;
  background: transparent;
  border: 0;
  outline: none;
  line-height: 2.1;
  color: var(--ink);
}
.note-date {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 24px;
}
.markdown {
  line-height: 2;
  overflow-wrap: anywhere;
}
.markdown pre {
  overflow: auto;
  background: var(--side);
  padding: 16px;
  border-radius: 8px;
  direction: ltr;
  text-align: left;
}
.markdown img {
  max-width: 100%;
}
.markdown blockquote {
  border-right: 3px solid var(--gold);
  padding-right: 18px;
  color: var(--muted);
}
.markdown a {
  color: var(--accent);
}
.markdown input {
  accent-color: var(--accent);
}
#back {
  display: none;
}
#status {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--ink);
  color: var(--panel);
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#status.show {
  opacity: 1;
}
dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  max-width: 90vw;
  width: 400px;
}
dialog::backdrop {
  background: #0007;
}
dialog h2 {
  margin-top: 0;
}
dialog p {
  font-size: 12px;
  color: var(--muted);
}
dialog input {
  padding: 10px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
dialog form > div {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
#passwordError {
  color: #bd5b4f;
}
.no-notes {
  padding: 40px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 1100px) and (min-width: 701px) {
  .shell {
    grid-template-columns: 180px 275px minmax(0, 1fr);
  }
  aside {
    padding: 25px 14px;
  }
  .toolbar {
    padding: 15px;
  }
  .paper {
    padding: 25px;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  aside {
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
    width: 260px;
    z-index: 5;
    box-shadow: 0 0 0 100vmax #0006;
  }
  body.folders-open aside {
    display: flex;
  }
  .listing {
    height: 100dvh;
    border: 0;
    padding: 26px 22px;
  }
  main {
    display: none;
    height: 100dvh;
  }
  body.editing .listing {
    display: none;
  }
  body.editing main {
    display: block;
  }
  #back,
  #mobileFolders {
    display: inline-block;
  }
  .toolbar {
    padding: 14px 12px;
    gap: 5px;
  }
  .toolbar button {
    padding: 6px 8px;
  }
  .save-state {
    width: 100%;
    text-align: center;
  }
  .paper {
    padding: 25px;
  }
  #title {
    font-size: 27px;
  }
  #body {
    height: calc(100dvh - 310px);
  }
}
@media print {
  aside,
  .listing,
  .toolbar,
  #status,
  dialog {
    display: none !important;
  }
  .shell {
    display: block;
    height: auto;
  }
  main {
    display: block !important;
    overflow: visible;
    background: white;
    color: black;
  }
  .paper {
    padding: 0;
    max-width: none;
  }
  #body {
    height: auto;
  }
  body {
    background: white;
  }
  .note-date {
    color: #555;
  }
}

#body {
  unicode-bidi: plaintext;
}
.note-date select {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 8px;
}

.task-list-item {
  list-style: none;
}
.task-list-item input {
  margin-inline-end: 9px;
  cursor: pointer;
}
