.notes-page {
  width: var(--layout);
  max-width: none;
  margin-inline: auto;
  padding: clamp(18px, 3vw, 36px) 0 56px;
}

.notes-heading {
  padding: clamp(23px, 4vw, 50px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.notes-heading p {
  margin: 0;
  color: var(--muted);
}

.notes-heading p:first-child {
  color: var(--green);
  font-size: .85rem;
  font-weight: 700;
}

.notes-heading h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 6vw, 3.55rem);
  line-height: 1.1;
  letter-spacing: -.05em;
}

.notes-toolbar {
  margin-block: 24px 16px;
}

.notes-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notes-filters button {
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 650;
}

.notes-filters button:hover {
  border-color: var(--green);
}

.notes-filters button[aria-pressed="true"] {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--lime);
}

.notes-count {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.notes-toolbar[hidden] + .notes-grid {
  margin-top: 18px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.note-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: clamp(17px, 2vw, 23px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}

.note-card[hidden] {
  display: none;
}

.note-card h2,
.note-card p {
  margin: 0;
}

.note-card h2 {
  font-size: 1.14rem;
  line-height: 1.3;
}

.note-card p {
  font-size: .93rem;
  line-height: 1.6;
}

.note-card .note-subject {
  color: var(--green);
  font-size: .8rem;
  font-weight: 750;
}

.note-card .note-tip {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: .85rem;
}

.note-card a {
  margin-top: auto;
  padding-block: 8px 2px;
  color: var(--green);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notes-references {
  margin-top: 22px;
  color: var(--muted);
  font-size: .87rem;
}

.notes-references summary {
  width: fit-content;
  padding-block: 6px;
  cursor: pointer;
}

.notes-references a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 920px) {
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .notes-grid { grid-template-columns: minmax(0, 1fr); }
}
