:root {
  color: #202724;
  background: #f5f7f6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f5f7f6;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid #d8dedb;
  background: rgba(245, 247, 246, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #202724;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.search {
  position: relative;
  width: min(340px, 48vw);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: #68736e;
  font-size: 22px;
  transform: translateY(-54%);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  border: 1px solid #cbd3cf;
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  color: #202724;
}

.search input:focus {
  border-color: #18735a;
  box-shadow: 0 0 0 3px rgba(24, 115, 90, 0.14);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 760px);
  gap: clamp(28px, 6vw, 80px);
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 42px clamp(16px, 4vw, 48px) 80px;
}

.note-list {
  min-width: 0;
}

.list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.list-heading h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: #68736e;
}

.list-heading span {
  color: #7f8984;
  font-size: 13px;
}

#notes {
  display: grid;
  gap: 6px;
}

.note-button {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #202724;
  text-align: left;
  cursor: pointer;
}

.note-button:hover {
  background: #e9eeeb;
}

.note-button.active {
  border-color: #c8d3ce;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(24, 38, 32, 0.06);
}

.note-title {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 650;
}

.note-preview {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #74807a;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader {
  min-width: 0;
  padding-top: 4px;
}

.reader-meta {
  color: #718078;
  font-size: 13px;
}

.reader h2 {
  margin: 10px 0 24px;
  color: #17201c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  line-height: 1.08;
}

.reader-body {
  color: #35413b;
  font-size: 17px;
  line-height: 1.72;
}

.reader-body p {
  margin: 0 0 18px;
}

.reader-body h3 {
  margin: 30px 0 10px;
  color: #202724;
  font-size: 17px;
}

.reader-body ul {
  margin: 0 0 20px;
  padding-left: 22px;
}

.reader-body li {
  margin: 8px 0;
}

.reader-body code {
  padding: 2px 5px;
  border: 1px solid #d7dedb;
  border-radius: 4px;
  background: #edf1ef;
  color: #1d5e4b;
  font-size: 0.9em;
}

.empty {
  padding: 20px 14px;
  color: #74807a;
  font-size: 14px;
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .search {
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 28px;
  }

  .reader {
    padding-top: 24px;
    border-top: 1px solid #d8dedb;
  }

  .reader h2 {
    font-size: 34px;
  }
}
