:root {
  color-scheme: light dark;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111315;
  color: #f2f3f4;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #111315; }
button, input, textarea { font: inherit; }
button {
  border: 1px solid #5c7cfa;
  border-radius: .45rem;
  padding: .55rem .8rem;
  color: #fff;
  background: #4263eb;
  cursor: pointer;
}
button:hover, button:focus-visible { filter: brightness(1.12); }
button.quiet { border-color: #4a4f55; background: #25292d; }
button.danger { border-color: #b33a45; background: #8f2d37; }
input, textarea {
  border: 1px solid #43484e;
  border-radius: .4rem;
  background: #191c1f;
  color: inherit;
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid #91a7ff; outline-offset: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.flash { padding: .7rem 1rem; text-align: center; }
.flash.info { background: #24452d; }
.flash.error { background: #642832; }
.app-header {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid #30353a;
}
.app-header h1 { display: inline; margin: 0 .75rem 0 0; font-size: 1.2rem; }
.view-label { color: #a6abb1; font-size: .9rem; }
.notes-shell { display: grid; grid-template-columns: minmax(16rem, 28rem) 1fr; height: calc(100vh - 4rem); }
.notes-sidebar { overflow: auto; padding: .8rem; border-right: 1px solid #30353a; background: #15181a; }
.sidebar-actions, .editor-actions, .secondary-actions { display: flex; gap: .5rem; align-items: center; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: .4rem; margin: .8rem 0; }
.search-form input { min-width: 0; padding: .55rem .65rem; }
.note-list form { margin: 0 0 .3rem; }
.note-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  border-color: transparent;
  background: transparent;
  text-align: left;
}
.note-row.selected { border-color: #5c7cfa; background: #272d3b; }
.note-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-list, .empty-editor { color: #9aa0a6; }
.note-editor { min-width: 0; padding: 1rem; display: flex; flex-direction: column; }
.note-editor > form { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: .75rem; }
.title-input { width: 100%; padding: .75rem; font-size: 1.2rem; font-weight: 650; }
#note-body { width: 100%; min-height: 18rem; flex: 1; resize: none; padding: .8rem; line-height: 1.55; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.secondary-actions { margin-top: .75rem; }
.login-panel { width: min(28rem, calc(100% - 2rem)); margin: 12vh auto 0; padding: 1.5rem; border: 1px solid #30353a; border-radius: .7rem; background: #171a1d; }
.login-panel h1 { margin-top: 0; }
.login-form { display: grid; gap: 1rem; }
.login-form label { display: grid; gap: .35rem; }
.login-form input { width: 100%; padding: .7rem; }

@media (max-width: 760px) {
  .notes-shell { grid-template-columns: 42% 58%; }
  .notes-sidebar { padding: .5rem; }
  .note-editor { padding: .6rem; }
}
