@page {
    size: A4 portrait;
    margin: 0;
  }

  :root {
    --ink: #273247;
    --muted: #566478;
    --blue: #5b91c9;
    --pink: #f4a9bd;
    --yellow: #ffe99a;
    --mint: #b9e7d6;
    --lilac: #d9c8f0;
    --paper: #fffef9;
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    background: #e7eaf0;
    color: var(--ink);
    font-family: "Nunito", "Trebuchet MS", sans-serif;
  }

  .sheet {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    margin: 16px auto;
    padding: 13mm 12mm 11mm 17mm;
    overflow: hidden;
    background:
      linear-gradient(90deg, transparent 0 13mm, #f2c4c4 13mm 13.4mm, transparent 13.4mm),
      repeating-linear-gradient(
        to bottom,
        var(--paper) 0,
        var(--paper) 27px,
        #dce9f2 28px
      );
    box-shadow: 0 4px 22px #29364d2b;
  }

  .sheet::before {
    content: "";
    position: absolute;
    left: 8mm;
    top: 10mm;
    bottom: 10mm;
    width: 5px;
    background:
      radial-gradient(circle, #e9a7b0 0 2.5px, transparent 3px)
      center top / 5px 28px repeat-y;
    opacity: .85;
  }

  header {
    position: relative;
    margin: 0 0 13px;
    padding: 8px 12px 10px;
    text-align: center;
  }

  .eyebrow {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
  }

  h1, h2, .hand {
    font-family: 'Dion', sans-serif;
  }

  h1 {
    display: inline-block;
    margin: 0;
    padding: 0 12px 3px;
    color: #315f91;
    font-size: 34px;
    line-height: 1.15;
    transform: rotate(-1deg);
    border-bottom: 5px solid var(--yellow);
  }

  .intro {
    max-width: 600px;
    margin: 8px auto 0;
    color: var(--muted);
    font-size: 12px;
  }

  .doodle {
    position: absolute;
    font-size: 25px;
    transform: rotate(-12deg);
  }

  .doodle.left { left: 12px; top: 12px; }
  .doodle.right { right: 15px; top: 6px; transform: rotate(10deg); }

  .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 8px;
    font-family: "Dion", "Arial Rounded", cursive;
    font-size: 20px;
    line-height: 1;
  }

  .section-title .swash {
    display: inline-block;
    padding: 2px 12px 5px;
    border-radius: 45% 55% 48% 52% / 55% 40% 60% 45%;
    background: var(--yellow);
    transform: rotate(-1deg);
  }

  .section-title.pink .swash { background: #ffdce5; }
  .section-title.mint .swash { background: #d5f1e5; }
  .section-title.lilac .swash { background: #e6dcf7; }

  .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .note {
    position: relative;
    min-height: 92px;
    padding: 10px 11px 9px;
    background: #ffffffd9;
    border: 1.5px solid #526171;
    border-radius: 4px 13px 5px 11px;
    box-shadow: 2px 3px 0 #8796a544;
    transform: rotate(-.25deg);
    break-inside: avoid;
  }

  .note:nth-child(even) { transform: rotate(.35deg); }

  .note::after {
    content: "";
    position: absolute;
    top: -5px;
    right: 13px;
    width: 34px;
    height: 10px;
    background: #ffe99acc;
    transform: rotate(4deg);
  }

  .note h3 {
    display: inline;
    margin: 0;
    padding: 0 3px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    background: linear-gradient(transparent 58%, #fff0ad 58%);
  }

  .note p {
    margin: 6px 0 0;
    color: #354255;
    font-size: 10.5px;
    line-height: 1.35;
  }

  .note a {
    display: inline-block;
    margin-top: 5px;
    color: #286ca2;
    font-size: 10px;
    font-weight: 800;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
  }

  .tag {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 7px;
    border: 1px solid #94a2af;
    border-radius: 12px;
    color: #46566a;
    background: #f7fbff;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
  }

  .recap {
    margin-top: 12px;
    padding: 9px 12px;
    border: 2px dashed #72849a;
    border-radius: 12px;
    background: #fff8d9;
    text-align: center;
  }

  .recap strong {
    font-family: "Dion", "Arial Rounded", cursive;
    font-size: 16px;
  }

  .recap p {
    margin: 3px 0 0;
    font-size: 10px;
  }

  footer {
    margin-top: 8px;
    color: #667589;
    text-align: center;
    font-size: 9px;
  }

  @media (max-width: 700px) {
    .sheet {
      width: 100%;
      min-height: 100vh;
      margin: 0;
      padding: 20px 14px 20px 35px;
    }

    .grid { grid-template-columns: 1fr; }
    h1 { font-size: 29px; }
  }

  @media print {
    body { background: white; }
    .sheet {
      width: 210mm;
      min-height: 297mm;
      margin: 0;
      box-shadow: none;
      print-color-adjust: exact;
      -webkit-print-color-adjust: exact;
    }
  }

.tag-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 800;
  }

  .tag-filter select {
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #94a2af;
    border-radius: 4px;
    color: var(--ink);
    background: var(--paper);
    font: inherit;
  }

  .tag-filter[hidden], .section-title[hidden], .grid[hidden], .note[hidden] {
    display: none;
  }

  @media print {
    .tag-filter { display: none; }
  }