/* ── TOKENS ─────────────────────────────────────────────── */
    :root {
      --paper:       #f5efe0;
      --paper-dark:  #e8ddc8;
      --ink:         #3a2e1e;
      --ink-light:   #7a6a52;
      --rule:        #d4c5a9;

      --note-yellow:   #fef08a;
      --note-pink:     #fbcfe8;
      --note-blue:     #bae6fd;
      --note-green:    #bbf7d0;
      --note-peach:    #fed7aa;
      --note-lavender: #ddd6fe;
	  --note-orange: #F5E4C2;
	  --note-skyblue: #C2F2F5;
	  --note-red: #EF9AAB;
	  --note-grey: #B2BEB5;
	  --note-cream: #fefce8;

      --shadow-note: 2px 4px 12px rgba(80,60,20,0.18), 0 1px 3px rgba(80,60,20,0.10);
      --shadow-lift: 4px 10px 28px rgba(80,60,20,0.26), 0 2px 6px rgba(80,60,20,0.14);

      --font-hand:  'Courier New', monospace;
      --font-label: 'Patrick Hand', cursive;
      --font-loose: 'Reenie Beanie', cursive;
    }

    /* ── RESET ──────────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    /* ── JOURNAL BACKGROUND ─────────────────────────────────── */
    body {
      min-height: 100vh;
      background-color: var(--paper);
      background-image:
        /* horizontal rules */
        repeating-linear-gradient(
          transparent,
          transparent 27px,
          var(--rule) 27px,
          var(--rule) 28px
        ),
        /* left margin line */
        linear-gradient(to right, transparent 58px, #e8a0a0 58px, #e8a0a0 59px, transparent 59px),
        /* subtle grain */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
      font-family: var(--font-label);
      color: var(--ink);
      padding-bottom: 80px;
    }
	
	    /* ── FOOTER ─────────────────────────────────────────────── */
    footer {
      max-width: 1100px;
      margin: 0 auto;
      padding: 48px 40px 20px 80px;
      position: relative;
    }
	
	.categories {
      font-family: var(--font-hand);
      font-size: .8rem;
      color: var(--ink-light);
      margin-left: 4px;
      transform: rotate(-0.5deg);
      display: inline-block;
    }
	
	/* hand-drawn underline */
    .categories::before {
      content: '';
      display: block;
      height: 3px;
      background: var(--ink);
      border-radius: 2px;
      margin-top: 4px;
      transform: scaleX(0.92) rotate(-0.5deg);
      transform-origin: left;
      opacity: 0.35;
    }

    /* ── HEADER ─────────────────────────────────────────────── */
    header {
      max-width: 1100px;
      margin: 0 auto;
      padding: 48px 40px 20px 80px;
      position: relative;
    }

    .journal-title {
      font-family: var(--font-loose);
      font-size: clamp(3rem, 7vw, 5.5rem);
      line-height: 1;
      color: var(--ink);
      letter-spacing: 0.01em;
      transform: rotate(-1deg);
      display: inline-block;
      margin-bottom: 6px;
    }

    .journal-subtitle {
      font-family: var(--font-hand);
      font-size: 1.1rem;
      color: var(--ink-light);
      margin-left: 4px;
      transform: rotate(-0.5deg);
      display: inline-block;
    }

    /* hand-drawn underline */
    .journal-title::after {
      content: '';
      display: block;
      height: 3px;
      background: var(--ink);
      border-radius: 2px;
      margin-top: 4px;
      transform: scaleX(0.92) rotate(-0.5deg);
      transform-origin: left;
      opacity: 0.35;
    }

    /* ── FILTER TABS ─────────────────────────────────────────── */
    .filter-bar {
      max-width: 1100px;
      margin: 0 auto 32px;
      padding: 0 40px 0 80px;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }

    .filter-label {
      font-family: var(--font-hand);
      font-size: 0.85rem;
      color: var(--ink-light);
      margin-right: 4px;
    }

    .tab {
      font-family: var(--font-hand);
      font-size: 0.92rem;
      padding: 6px 16px;
      border: 1.5px solid var(--paper-dark);
      border-radius: 20px;
      background: transparent;
      color: var(--ink-light);
      cursor: pointer;
      transition: all 0.15s ease;
      position: relative;
    }

    .tab:hover {
      background: rgba(0,0,0,0.05);
      color: var(--ink);
      border-color: var(--ink-light);
    }

    .tab.active {
      background: var(--ink);
      color: var(--paper);
      border-color: var(--ink);
    }

    /* color-coded tabs */
    .tab[data-color="yellow"].active  { background: #ca8a04; border-color: #ca8a04; }
    .tab[data-color="pink"].active    { background: #db2777; border-color: #db2777; }
    .tab[data-color="blue"].active    { background: #0284c7; border-color: #0284c7; }
    .tab[data-color="green"].active   { background: #16a34a; border-color: #16a34a; }
    .tab[data-color="peach"].active   { background: #ea580c; border-color: #ea580c; }
    .tab[data-color="lavender"].active{ background: #7c3aed; border-color: #7c3aed; }
	.tab[data-color="orange"].active{ background: #DB9E24; border-color: #DB9E24; }
	.tab[data-color="skyblue"].active{ background: #1DAAB4; border-color: #1DAAB4; }
	.tab[data-color="red"].active{ background: #B51C1C; border-color: #B51C1C; }
	.tab[data-color="grey"].active{ background: #B2BEB5; border-color: #B2BEB5; }
	.tab[data-color="cream"].active{ background: #fefce8; border-color: #fefce8; }

    /* ── GRID ────────────────────────────────────────────────── */
    .notes-grid {
      max-width: 1100px;
      margin: 0 auto;
      padding: 0 40px 0 80px;
      columns: 3 280px;
      column-gap: 28px;
    }

    /* ── STICKY NOTE ─────────────────────────────────────────── */
    .note {
      break-inside: avoid;
      display: inline-block;
      width: 100%;
      margin-bottom: 28px;
      padding: 28px 24px 20px;
      border-radius: 2px;
      box-shadow: var(--shadow-note);
      position: relative;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      cursor: default;
    }

    .note:hover {
      transform: scale(1.03) rotate(0deg) !important;
      box-shadow: var(--shadow-lift);
      z-index: 10;
    }

    /* color variants */
    .note-yellow   { background: var(--note-yellow); }
    .note-pink     { background: var(--note-pink); }
    .note-blue     { background: var(--note-blue); }
    .note-green    { background: var(--note-green); }
    .note-peach    { background: var(--note-peach); }
    .note-lavender { background: var(--note-lavender); }
	.note-orange { background: var(--note-lavender); }
	.note-skyblue { background: var(--note-lavender); }
	.note-red { background: var(--note-lavender); }
	.note-grey { background: var(--note-grey); }
	.note-cream { background: var(--note-cream); }

    /* tape strip at top */
    .note::before {
      content: '';
      position: absolute;
      top: -9px;
      left: 50%;
      transform: translateX(-50%);
      width: 52px;
      height: 18px;
      background: rgba(255,255,255,0.55);
      border-radius: 2px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.10);
      border: 1px solid rgba(255,255,255,0.4);
    }

    /* folded corner */
    .note::after {
      content: '';
      position: absolute;
      bottom: 0; right: 0;
      width: 22px; height: 22px;
      background: linear-gradient(225deg, rgba(0,0,0,0.12) 0%, transparent 55%);
      border-radius: 0 0 2px 0;
    }

    /* category chip */
    .note-category {
      font-family: var(--font-hand);
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: rgba(58,46,30,0.5);
      margin-bottom: 10px;
    }

    /* quote text */
    .note-text {
      font-family: var(--font-hand);
      font-size: .9rem;
      line-height: 1.55;
      color: var(--ink);
      margin-bottom: 14px;
    }

    /* open-quote flourish */
    .note-text::before {
      content: '\201C';
      font-family: var(--font-loose);
      font-size: 2.4rem;
      line-height: 0;
      vertical-align: -0.5rem;
      color: rgba(58,46,30,0.2);
      margin-right: 2px;
    }

    /* author + source */
    .note-meta {
      border-top: 1px dashed rgba(58,46,30,0.2);
      padding-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .note-author {
      font-family: var(--font-hand);
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--ink);
    }

    .note-author::before {
      content: '— ';
      opacity: 0.5;
    }

    .note-source {
      font-family: var(--font-hand);
      font-size: 0.78rem;
      color: var(--ink-light);
      font-style: italic;
    }

    .note-source a {
      color: inherit;
      text-decoration: underline dotted;
    }

    /* copy button */
    .note-copy {
      position: absolute;
      bottom: 10px;
      right: 28px;
      background: none;
      border: none;
      cursor: pointer;
      opacity: 0;
      transition: opacity 0.15s;
      font-size: 0.72rem;
      font-family: var(--font-hand);
      color: var(--ink-light);
      padding: 2px 6px;
      border-radius: 4px;
    }

    .note:hover .note-copy {
      opacity: 1;
    }

    .note-copy:hover {
      background: rgba(0,0,0,0.08);
    }
	
	
	.fab {display:none;}
    /* ── ADD QUOTE BUTTON ────────────────────────────────────── 
    .fab {
      position: fixed;
      bottom: 36px;
      right: 36px;
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: var(--ink);
      color: var(--paper);
      border: none;
      font-size: 1.8rem;
      line-height: 1;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(58,46,30,0.35);
      transition: transform 0.15s, box-shadow 0.15s;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .fab:hover {
      transform: scale(1.08);
      box-shadow: 0 6px 22px rgba(58,46,30,0.42);
    }
	*/

    /* ── MODAL ───────────────────────────────────────────────── */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(58,46,30,0.45);
      backdrop-filter: blur(2px);
      z-index: 100;
      align-items: center;
      justify-content: center;
    }

    .modal-overlay.open { display: flex; }

    .modal {
      background: var(--note-yellow);
      border-radius: 3px;
      width: min(500px, 92vw);
      padding: 36px 32px 28px;
      box-shadow: var(--shadow-lift);
      position: relative;
    }

    .modal::before {
      content: '';
      position: absolute;
      top: -10px; left: 50%;
      transform: translateX(-50%);
      width: 70px; height: 20px;
      background: rgba(255,255,255,0.55);
      border-radius: 2px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .modal h2 {
      font-family: var(--font-loose);
      font-size: 2rem;
      margin-bottom: 22px;
      color: var(--ink);
    }

    .field {
      margin-bottom: 16px;
    }

    .field label {
      display: block;
      font-family: var(--font-hand);
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--ink-light);
      margin-bottom: 5px;
    }

    .field input,
    .field textarea,
    .field select {
      width: 100%;
      background: rgba(255,255,255,0.5);
      border: 1.5px solid rgba(58,46,30,0.2);
      border-radius: 4px;
      padding: 9px 12px;
      font-family: var(--font-hand);
      font-size: 1rem;
      color: var(--ink);
      outline: none;
      resize: vertical;
    }

    .field input:focus,
    .field textarea:focus,
    .field select:focus {
      border-color: rgba(58,46,30,0.5);
      background: rgba(255,255,255,0.7);
    }

    .modal-actions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      margin-top: 22px;
    }

    .btn {
      font-family: var(--font-hand);
      font-size: 1rem;
      padding: 9px 22px;
      border: 1.5px solid;
      border-radius: 20px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .btn-primary {
      background: var(--ink);
      color: var(--paper);
      border-color: var(--ink);
    }

    .btn-primary:hover { opacity: 0.85; }

    .btn-ghost {
      background: transparent;
      color: var(--ink-light);
      border-color: rgba(58,46,30,0.25);
    }

    .btn-ghost:hover { border-color: var(--ink-light); color: var(--ink); }

    /* ── API INFO BOX ────────────────────────────────────────── */
    .api-info {
      max-width: 1100px;
      margin: 0 auto 32px;
      padding: 0 40px 0 80px;
    }

    details {
      background: rgba(255,255,255,0.35);
      border: 1.5px dashed rgba(58,46,30,0.2);
      border-radius: 6px;
      padding: 14px 18px;
    }

    summary {
      font-family: var(--font-hand);
      font-size: 0.9rem;
      color: var(--ink-light);
      cursor: pointer;
      user-select: none;
    }

    summary:hover { color: var(--ink); }

    .api-block {
      margin-top: 14px;
      font-family: 'Courier New', monospace;
      font-size: 0.8rem;
      color: var(--ink);
      background: rgba(255,255,255,0.5);
      border-radius: 4px;
      padding: 12px 14px;
      line-height: 1.7;
      white-space: pre-wrap;
      word-break: break-all;
    }

    /* ── EMPTY STATE ─────────────────────────────────────────── */
    .empty {
      padding: 60px 40px 60px 80px;
      font-family: var(--font-hand);
      font-size: 1.4rem;
      color: var(--ink-light);
      opacity: 0.6;
    }

    /* ── TOAST ───────────────────────────────────────────────── */
    .toast {
      position: fixed;
      bottom: 100px;
      right: 36px;
      background: var(--ink);
      color: var(--paper);
      font-family: var(--font-hand);
      font-size: 0.9rem;
      padding: 10px 20px;
      border-radius: 20px;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.25s, transform 0.25s;
      pointer-events: none;
      z-index: 200;
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }

    /* ── RESPONSIVE ──────────────────────────────────────────── */
    @media (max-width: 640px) {
      header, footer, .filter-bar, .notes-grid, .api-info {
        padding-left: 20px;
        padding-right: 20px;
      }

      .notes-grid { columns: 1; }
    }