/* ==========================================================================
   포스트잇 투두 (Post-it Todo) — shared stylesheet
   Used by index.html (ko), index-en.html (en), and future locale pages.
   Locale-specific type is switched purely with :root:lang(xx) — to add a
   new language (es, vi, ...), add one more :root:lang() block below and
   an HTML file that sets <html lang="xx">. No other CSS changes needed.
   ========================================================================== */

   @import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&family=Caveat:wght@500;700&display=swap');

   /* ---------- Design tokens ---------- */
   :root {
     --wall: #33210f;
     --wall-shadow: #24160a;
   
     --note-font-scale: 1;
     --ad-bar-height: clamp(50px, 6vh, 100px);
   
     --wood-dark: #5c3b22;
     --wood-mid: #7c5031;
     --wood-light: #9c6b41;
   
     --board-base: #cda06b;
     --board-speckle-1: rgba(101, 67, 33, 0.28);
     --board-speckle-2: rgba(101, 67, 33, 0.16);
     --board-grain: rgba(101, 67, 33, 0.07);
   
     --ink: #2e2419;
     --ink-soft: #6b5b4a;
     --paper-cream: #fff8e9;
     --paper-cream-2: #fbeed4;
   
     --note-yellow: #ffe066;
     --note-yellow-shade: #e6c94f;
     --note-pink: #ff9ebb;
     --note-pink-shade: #e6829f;
     --note-blue: #8ecae6;
     --note-blue-shade: #6fb0cf;
     --note-green: #b7e4a4;
     --note-green-shade: #98cb85;
     --note-orange: #ffb454;
     --note-orange-shade: #e69a3c;
     --note-purple: #d9b8fa;
     --note-purple-shade: #bd97e0;
   
     --danger: #d1495b;
     --success: #4c8c5c;
   
     --shadow-soft: 0 6px 14px rgba(36, 22, 10, 0.28);
     --shadow-note: 3px 6px 10px rgba(36, 22, 10, 0.3);
     --shadow-note-hover: 5px 12px 18px rgba(36, 22, 10, 0.34);
   
     --radius-card: 14px;
   
     --font-hand: 'Gaegu', cursive;
     --font-body: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
   
     --dur-fast: 0.18s;
     --dur-med: 0.32s;
   }
   
   /* Per-language type swap. Add new locales here as they launch. */
   :root:lang(ko) {
     --font-hand: 'Gaegu', cursive;
     --font-body: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
   }
   :root:lang(en) {
     --font-hand: 'Caveat', cursive;
     --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
   }
   
   /* ---------- Reset ---------- */
   * { box-sizing: border-box; }
   html, body { margin: 0; padding: 0; }
   ul { list-style: none; margin: 0; padding: 0; }
   button { font: inherit; cursor: pointer; }
   input { font: inherit; }
   img, svg { display: block; max-width: 100%; }
   
   .sr-only {
     position: absolute;
     width: 1px; height: 1px;
     padding: 0; margin: -1px;
     overflow: hidden;
     clip: rect(0, 0, 0, 0);
     white-space: nowrap;
     border: 0;
   }
   
   :focus-visible {
     outline: 3px dashed var(--ink);
     outline-offset: 3px;
   }
   
   body {
     font-family: var(--font-body);
     color: var(--ink);
     background: var(--wall);
     min-height: 100vh;
   }
   
   /* ---------- Wall / page wrapper ---------- */
   .wood-wall {
     min-height: 100vh;
     padding: 28px 16px calc(var(--ad-bar-height) + 48px);
     background:
       radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.05), transparent 55%),
       repeating-linear-gradient(100deg, var(--wall) 0 3px, var(--wall-shadow) 3px 6px);
     display: flex;
     flex-direction: column;
     align-items: center;
   }
   
   /* ---------- Header ---------- */
   .site-header {
     text-align: center;
     max-width: 640px;
     margin-bottom: 18px;
   }
   
   .board-title {
     font-family: var(--font-hand);
     font-weight: 700;
     font-size: clamp(2rem, 6vw, 2.9rem);
     color: var(--paper-cream);
     margin: 0 0 6px;
     text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
     letter-spacing: 0.5px;
   }
   
   .board-subtitle {
     font-family: var(--font-hand);
     font-size: clamp(1.05rem, 3vw, 1.35rem);
     color: var(--note-yellow);
     min-height: 1.6em;
     margin: 0;
     opacity: 0.9;
   }
   
   .board-subtitle .ti-cursor {
     color: var(--note-yellow);
   }
   
   /* ---------- Info card (localStorage explainer) ---------- */
   .info-card {
     width: 100%;
     max-width: 520px;
     background: var(--paper-cream);
     color: var(--ink);
     border-radius: 3px;
     box-shadow: var(--shadow-soft);
     margin: 0 0 22px;
     padding: 2px 0 0;
     position: relative;
     transform: rotate(-0.6deg);
   }
   
   .info-card::before {
     content: '';
     position: absolute;
     top: -10px;
     left: 50%;
     transform: translateX(-50%) rotate(-2deg);
     width: 70px;
     height: 20px;
     background: rgba(255, 255, 255, 0.55);
     border: 1px solid rgba(255, 255, 255, 0.7);
     box-shadow: var(--shadow-soft);
   }
   
   .info-card summary {
     list-style: none;
     cursor: pointer;
     padding: 14px 18px;
     font-family: var(--font-hand);
     font-size: 1.15rem;
     display: flex;
     align-items: center;
     gap: 8px;
   }
   .info-card summary::-webkit-details-marker { display: none; }
   .info-card summary::after {
     content: '▾';
     margin-left: auto;
     font-family: var(--font-body);
     font-size: 0.85rem;
     color: var(--ink-soft);
     transition: transform var(--dur-fast) ease;
   }
   .info-card[open] summary::after { transform: rotate(180deg); }
   
   .info-card-body {
     padding: 0 18px 16px;
     border-top: 1px dashed rgba(46, 36, 25, 0.25);
     margin-top: 2px;
   }
   
   .info-card-body ul {
     padding-top: 12px;
     display: grid;
     gap: 8px;
     font-size: 0.92rem;
     color: var(--ink-soft);
   }
   .info-card-body li { display: flex; gap: 8px; align-items: flex-start; }
   .info-card-body li strong { color: var(--ink); }
   .info-card-body .info-warn {
     margin-top: 4px;
     padding-top: 10px;
     border-top: 1px dashed rgba(46, 36, 25, 0.2);
     font-size: 0.85rem;
     color: var(--danger);
   }
   
   /* ---------- Corkboard ---------- */
   .corkboard {
     width: 100%;
     max-width: 980px;
     position: relative;
     background-color: var(--board-base);
     border-radius: var(--radius-card);
     padding: 26px 22px 34px;
     border: 14px solid var(--wood-mid);
     outline: 6px solid var(--wood-dark);
     outline-offset: -14px;
     box-shadow:
       inset 0 0 40px rgba(36, 22, 10, 0.35),
       0 18px 40px rgba(0, 0, 0, 0.4);
     background-image:
       radial-gradient(circle at 8% 15%, var(--board-speckle-1) 0, transparent 2.4%),
       radial-gradient(circle at 22% 62%, var(--board-speckle-2) 0, transparent 2%),
       radial-gradient(circle at 38% 30%, var(--board-speckle-1) 0, transparent 1.8%),
       radial-gradient(circle at 55% 78%, var(--board-speckle-2) 0, transparent 2.2%),
       radial-gradient(circle at 68% 18%, var(--board-speckle-1) 0, transparent 2%),
       radial-gradient(circle at 82% 55%, var(--board-speckle-2) 0, transparent 2.4%),
       radial-gradient(circle at 92% 85%, var(--board-speckle-1) 0, transparent 1.8%),
       radial-gradient(circle at 12% 88%, var(--board-speckle-2) 0, transparent 2%),
       radial-gradient(circle at 47% 8%, var(--board-speckle-1) 0, transparent 1.6%),
       radial-gradient(circle at 75% 40%, var(--board-speckle-2) 0, transparent 2.2%),
       radial-gradient(circle at 30% 45%, var(--board-speckle-1) 0, transparent 1.6%),
       radial-gradient(circle at 64% 92%, var(--board-speckle-2) 0, transparent 1.8%),
       repeating-linear-gradient(97deg, var(--board-grain) 0 2px, transparent 2px 9px);
   }
   
   /* ---------- Board toolbar (add-note form + font-size control) ---------- */
   .board-toolbar {
     display: flex;
     flex-direction: column;
     align-items: stretch;
     gap: 14px;
     margin: 0 0 26px;
   }
   
   .toolbar-top-row {
     display: flex;
     flex-wrap: wrap;
     align-items: flex-start;
     gap: 12px;
   }
   
   .data-actions {
     display: flex;
     flex-wrap: wrap;
     gap: 8px;
     align-self: flex-start;
   }
   
   .data-action-btn {
     display: flex;
     align-items: center;
     gap: 6px;
     background: var(--paper-cream);
     border: 1px solid rgba(46, 36, 25, 0.2);
     border-radius: 999px;
     padding: 9px 16px;
     font-family: var(--font-body);
     font-size: 0.82rem;
     color: var(--ink);
     box-shadow: var(--shadow-note);
   }
   .data-action-btn:hover { background: rgba(46, 36, 25, 0.06); }
   
   .font-size-control {
     align-self: flex-start;
     display: flex;
     align-items: center;
     gap: 8px;
     background: var(--paper-cream);
     border-radius: 4px 12px 4px 12px;
     box-shadow: var(--shadow-note);
     padding: 10px 14px;
     transform: rotate(1deg);
   }
   .font-size-label {
     font-family: var(--font-hand);
     font-size: 1.1rem;
     color: var(--ink-soft);
   }
   .font-size-btn {
     width: 28px;
     height: 28px;
     border-radius: 50%;
     border: 1px solid rgba(46, 36, 25, 0.25);
     background: var(--paper-cream-2);
     color: var(--ink);
     font-size: 1rem;
     line-height: 1;
     display: flex;
     align-items: center;
     justify-content: center;
   }
   .font-size-btn:hover { background: rgba(46, 36, 25, 0.1); }
   .font-size-value {
     font-family: var(--font-body);
     font-size: 0.8rem;
     color: var(--ink-soft);
     min-width: 34px;
     text-align: center;
   }
   
   /* ---------- Add-note form (fresh pad) ---------- */
   .add-note-form {
     background: var(--paper-cream);
     border-radius: 4px 12px 4px 12px;
     box-shadow: var(--shadow-note);
     padding: 16px;
     width: 100%;
     margin: 0;
     transform: rotate(-0.4deg);
     position: relative;
   }
   .add-note-form::before {
     content: '';
     position: absolute;
     inset: 4px 4px auto auto;
     width: 100%;
     height: 100%;
     background: var(--paper-cream-2);
     border-radius: 4px 12px 4px 12px;
     z-index: -1;
     transform: rotate(2.5deg);
     opacity: 0.9;
   }
   
   .add-note-form textarea,
   .add-note-form input[type='text'] {
     width: 100%;
     border: none;
     background: transparent;
     resize: none;
     font-family: var(--font-hand);
     font-size: calc(1.2rem * var(--note-font-scale, 1));
     color: var(--ink);
     line-height: 1.4;
     border-bottom: 1px dashed rgba(46, 36, 25, 0.3);
     padding-bottom: 8px;
   }
   .add-note-form textarea::placeholder,
   .add-note-form input[type='text']::placeholder {
     color: var(--ink-soft);
     opacity: 0.7;
   }
   .add-note-form textarea:focus,
   .add-note-form input[type='text']:focus {
     outline: none;
     border-bottom-color: var(--ink);
   }
   
   .form-row {
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin-top: 12px;
     gap: 10px;
   }
   
   .color-picker {
     display: flex;
     gap: 6px;
   }
   
   .color-dot {
     width: 22px;
     height: 22px;
     border-radius: 50%;
     border: 2px solid rgba(255, 255, 255, 0.7);
     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
     padding: 0;
     transition: transform var(--dur-fast) ease;
   }
   .color-dot[data-color='yellow'] { background: var(--note-yellow); }
   .color-dot[data-color='pink'] { background: var(--note-pink); }
   .color-dot[data-color='blue'] { background: var(--note-blue); }
   .color-dot[data-color='green'] { background: var(--note-green); }
   .color-dot[data-color='orange'] { background: var(--note-orange); }
   .color-dot[data-color='purple'] { background: var(--note-purple); }
   .color-dot:hover { transform: scale(1.12); }
   .color-dot[aria-pressed='true'] {
     outline: 2px solid var(--ink);
     outline-offset: 2px;
   }
   
   .stick-btn {
     background: var(--ink);
     color: var(--paper-cream);
     border: none;
     border-radius: 20px;
     padding: 9px 18px;
     font-family: var(--font-hand);
     font-size: 1.05rem;
     font-weight: 700;
     box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
     transition: transform var(--dur-fast) ease;
   }
   .stick-btn:hover { transform: translateY(-1px); }
   .stick-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
   
   .input-shake {
     animation: shake 0.4s ease;
   }
   @keyframes shake {
     10%, 90% { transform: translateX(-3px) rotate(-1.4deg); }
     20%, 80% { transform: translateX(4px) rotate(-1.4deg); }
     30%, 50%, 70% { transform: translateX(-6px) rotate(-1.4deg); }
     40%, 60% { transform: translateX(6px) rotate(-1.4deg); }
   }
   
   /* ---------- Notes grid ---------- */
   .notes-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
     gap: 30px;
     align-items: start;
   }
   
   .postit {
     position: relative;
     background: var(--note-color, var(--note-yellow));
     min-height: 140px;
     padding: 30px 14px 18px;
     border-radius: 2px 2px 8px 2px;
     box-shadow: var(--shadow-note);
     transform: rotate(var(--rot, 0deg));
     transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
     will-change: transform;
   }
   
   @media (hover: hover) {
     .postit:hover {
       transform: rotate(0deg) translateY(-4px) scale(1.02);
       box-shadow: var(--shadow-note-hover);
       z-index: 2;
     }
   }
   
   /* folded-corner effect (kept small so it never fights the delete button) */
   .postit::after {
     content: '';
     position: absolute;
     top: 0;
     right: 0;
     width: 18px;
     height: 18px;
     background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 45%, rgba(0, 0, 0, 0.12) 50%, transparent 52%);
     clip-path: polygon(100% 0, 0 0, 100% 100%);
     border-radius: 0 2px 0 10px;
     z-index: 0;
   }
   
   .note-text {
     font-family: var(--font-hand);
     font-size: calc(1.15rem * var(--note-font-scale, 1));
     line-height: 1.35;
     color: var(--ink);
     margin: 0;
     overflow-wrap: anywhere;
     white-space: pre-wrap;
     cursor: pointer;
   }
   .note-text:hover { text-decoration: underline dotted rgba(46, 36, 25, 0.4); }
   
   .note-edit-input {
     display: block;
     width: 100%;
     min-height: 60px;
     font-family: var(--font-hand);
     font-size: calc(1.15rem * var(--note-font-scale, 1));
     line-height: 1.35;
     color: var(--ink);
     background: rgba(255, 255, 255, 0.35);
     border: none;
     border-bottom: 1px dashed rgba(46, 36, 25, 0.4);
     border-radius: 2px;
     resize: none;
     padding: 0;
     margin: 0;
     position: relative;
     z-index: 1;
   }
   .note-edit-input:focus { outline: none; }
   
   .postit.is-done .note-text {
     text-decoration: line-through solid;
     text-decoration-color: var(--ink);
     text-decoration-thickness: 2.5px;
     opacity: 0.72;
   }
   
   .note-check,
   .note-delete {
     position: absolute;
     top: -9px;
     width: 32px;
     height: 32px;
     border-radius: 50%;
     border: 2px solid rgba(46, 36, 25, 0.25);
     background: var(--paper-cream);
     color: var(--ink);
     font-size: 0.92rem;
     line-height: 1;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
     transition: transform var(--dur-fast) ease, background var(--dur-fast) ease;
     z-index: 3;
   }
   .note-check { left: -9px; }
   .note-delete { right: -9px; }
   .note-check:hover, .note-delete:hover { transform: scale(1.12); }
   .postit.is-done .note-check {
     background: var(--success);
     color: #fff;
     border-color: var(--success);
   }
   
   .note-date {
     display: block;
     text-align: right;
     margin-top: 10px;
     font-size: 0.6rem;
     color: rgba(46, 36, 25, 0.42);
     font-family: var(--font-body);
   }
   
   /* ---------- Note style skins ---------- */
   /* "default" needs no override. Switch with body[data-note-style]. */
   
   /* Vintage: torn pad edges + faded, sun-aged color.
      The jagged silhouette lives on a ::before layer *behind* the check/
      delete buttons and text, so clip-path clips the paper only — not
      the buttons sitting on top of it. */
   body[data-note-style='torn'] .postit {
     background: none;
     box-shadow: none;
   }
   body[data-note-style='torn'] .postit::before {
     content: '';
     position: absolute;
     inset: 0;
     z-index: 0;
     border-radius: 2px 2px 8px 2px;
     background-color: var(--note-color, var(--note-yellow));
     background-image:
       radial-gradient(circle at 78% 18%, rgba(120, 90, 40, 0.2), transparent 30%),
       radial-gradient(circle at 18% 82%, rgba(120, 90, 40, 0.16), transparent 26%);
     filter: sepia(0.35) saturate(0.75) brightness(0.95) contrast(0.97) drop-shadow(2px 5px 5px rgba(60, 40, 20, 0.35));
     clip-path: polygon(
       0% 5%, 7% 0%, 15% 4%, 23% 0%, 31% 5%, 39% 1%, 47% 4%, 55% 0%, 63% 5%, 71% 1%, 79% 4%, 87% 0%, 95% 5%, 100% 1%,
       100% 95%, 93% 100%, 85% 96%, 77% 100%, 69% 95%, 61% 100%, 53% 96%, 45% 100%, 37% 95%, 29% 100%, 21% 96%, 13% 100%, 5% 95%, 0% 100%
     );
   }
   body[data-note-style='torn'] .postit::after { display: none; }
   body[data-note-style='torn'] .note-text,
   body[data-note-style='torn'] .note-date {
     position: relative;
     z-index: 1;
   }
   
   /* Index card: ruled paper + red margin line, color kept as a top accent bar */
   body[data-note-style='index'] .postit {
     background-color: var(--paper-cream);
     background-image: linear-gradient(rgba(120, 140, 170, 0.35) 1px, transparent 1px);
     background-size: 100% 22px;
     background-position: 0 36px;
     border-top: 6px solid var(--note-color, var(--note-yellow));
     border-radius: 3px;
     box-shadow: 2px 4px 0 rgba(46, 36, 25, 0.12), 0 4px 10px rgba(46, 36, 25, 0.18);
   }
   body[data-note-style='index'] .postit::after { display: none; }
   body[data-note-style='index'] .postit::before {
     content: '';
     position: absolute;
     top: 6px;
     bottom: 0;
     left: 28px;
     width: 1px;
     background: rgba(209, 73, 91, 0.5);
   }
   body[data-note-style='index'] .note-text {
     font-family: var(--font-body);
     padding-left: 14px;
   }
   body[data-note-style='index'] .note-edit-input {
     font-family: var(--font-body);
     padding-left: 14px;
   }
   
   /* Neo-brutalist: bold flat color, thick ink outline, hard offset shadow,
      sharp corners, no soft skeuomorphism — a currently very popular UI trend. */
   body[data-note-style='brutal'] .postit {
     border-radius: 2px;
     border: 3px solid var(--ink);
     box-shadow: 6px 6px 0 var(--ink);
   }
   @media (hover: hover) {
     body[data-note-style='brutal'] .postit:hover {
       box-shadow: 8px 8px 0 var(--ink);
     }
   }
   body[data-note-style='brutal'] .postit::after { display: none; }
   body[data-note-style='brutal'] .note-text {
     font-family: var(--font-body);
     font-weight: 800;
     letter-spacing: -0.2px;
   }
   body[data-note-style='brutal'] .note-edit-input {
     font-family: var(--font-body);
     font-weight: 800;
   }
   body[data-note-style='brutal'] .note-check,
   body[data-note-style='brutal'] .note-delete {
     border: 2px solid var(--ink);
     border-radius: 4px;
     box-shadow: 3px 3px 0 var(--ink);
   }
   body[data-note-style='brutal'] .postit.is-done .note-check {
     background: var(--success);
     border-color: var(--ink);
   }
   
   /* ---------- Empty state ---------- */
   .empty-state {
     grid-column: 1 / -1;
     border: 2px dashed rgba(46, 36, 25, 0.35);
     border-radius: 8px;
     padding: 34px 18px;
     text-align: center;
     font-family: var(--font-hand);
     font-size: 1.15rem;
     color: rgba(46, 36, 25, 0.6);
   }
   
   /* ---------- Floating action stack (style switcher + trash) ---------- */
   .fab-stack {
     position: fixed;
     right: 20px;
     bottom: calc(var(--ad-bar-height) + 20px);
     z-index: 20;
     display: flex;
     flex-direction: column;
     align-items: flex-end;
     gap: 12px;
   }
   
   .fab-btn {
     position: relative;
     width: 48px;
     height: 48px;
     border-radius: 50%;
     border: none;
     background: var(--wood-dark);
     color: var(--paper-cream);
     font-size: 1.15rem;
     box-shadow: var(--shadow-soft);
     display: flex;
     align-items: center;
     justify-content: center;
     opacity: 0.8;
     transition: opacity var(--dur-fast) ease;
   }
   .fab-btn[hidden] { display: none; }
   .fab-btn:hover,
   .fab-btn:focus-visible {
     opacity: 1;
   }
   
   .style-fab-wrap {
     position: relative;
   }
   
   .trash-count {
     position: absolute;
     top: -4px;
     right: -4px;
     min-width: 20px;
     height: 20px;
     padding: 0 5px;
     border-radius: 999px;
     background: var(--danger);
     color: #fff;
     font-size: 0.7rem;
     font-family: var(--font-body);
     display: flex;
     align-items: center;
     justify-content: center;
   }
   .trash-count[data-empty='true'] { display: none; }
   
   /* ---------- Style-switcher popover ---------- */
   .style-menu {
     position: absolute;
     bottom: 100%;
     right: 0;
     margin-bottom: 12px;
     background: var(--paper-cream);
     border-radius: 12px;
     box-shadow: var(--shadow-soft);
     padding: 8px;
     display: flex;
     flex-direction: column;
     gap: 4px;
     width: 200px;
     max-width: calc(100vw - 40px);
   }
   .style-menu[hidden] { display: none; }
   
   .style-option {
     display: flex;
     align-items: center;
     gap: 10px;
     border: none;
     background: transparent;
     border-radius: 8px;
     padding: 8px 10px;
     font-family: var(--font-body);
     font-size: 0.85rem;
     color: var(--ink);
     text-align: left;
     width: 100%;
   }
   .style-option:hover { background: rgba(46, 36, 25, 0.07); }
   .style-option[aria-checked='true'] {
     background: rgba(46, 36, 25, 0.12);
     font-weight: 700;
   }
   
   .style-swatch {
     width: 28px;
     height: 28px;
     border-radius: 2px 2px 6px 2px;
     flex-shrink: 0;
     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
     background: var(--note-yellow);
   }
   .style-swatch--torn {
     background: var(--note-orange);
     filter: sepia(0.35) saturate(0.75) brightness(0.95);
     clip-path: polygon(0 12%, 22% 0, 45% 9%, 70% 0, 100% 10%, 100% 88%, 76% 100%, 50% 90%, 24% 100%, 0 90%);
   }
   .style-swatch--index {
     background: var(--paper-cream-2);
     border: 1px solid rgba(46, 36, 25, 0.2);
     border-radius: 2px;
     position: relative;
   }
   .style-swatch--index::after {
     content: '';
     position: absolute;
     top: 4px;
     bottom: 4px;
     left: 8px;
     width: 1px;
     background: var(--danger);
   }
   .style-swatch--brutal {
     background: var(--note-blue);
     border: 2px solid var(--ink);
     border-radius: 2px;
     box-shadow: 3px 3px 0 var(--ink);
   }
   
   /* ---------- Trash panel ---------- */
   .scrim {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     bottom: var(--ad-bar-height);
     background: rgba(20, 12, 5, 0.55);
     z-index: 25;
   }
   
   .trash-panel {
     position: fixed;
     top: 0;
     right: 0;
     bottom: var(--ad-bar-height);
     width: min(380px, 100vw);
     background: var(--paper-cream);
     box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
     z-index: 30;
     transform: translateX(100%);
     transition: transform var(--dur-med) ease;
     display: flex;
     flex-direction: column;
   }
   .trash-panel[hidden] { display: none; }
   .trash-panel.is-open { transform: translateX(0); }
   
   .trash-panel-inner {
     display: flex;
     flex-direction: column;
     height: 100%;
     padding: 18px;
     overflow: hidden;
   }
   
   .trash-panel header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin-bottom: 12px;
   }
   .trash-panel h2 {
     font-family: var(--font-hand);
     font-size: 1.5rem;
     margin: 0;
     color: var(--ink);
   }
   .close-btn {
     background: none;
     border: none;
     font-size: 1.2rem;
     color: var(--ink-soft);
     padding: 6px;
   }
   
   .trash-list {
     flex: 1;
     overflow-y: auto;
     display: grid;
     align-content: start;
     gap: 10px;
     padding-right: 4px;
   }
   
   .trash-item {
     display: flex;
     align-items: center;
     gap: 10px;
     background: var(--note-color, var(--note-yellow));
     border-radius: 4px 4px 10px 4px;
     padding: 10px 12px;
     box-shadow: var(--shadow-note);
     opacity: 0.85;
   }
   .trash-item-text {
     flex: 1;
     min-width: 0;
   }
   .trash-item-text p {
     margin: 0;
     font-family: var(--font-hand);
     font-size: 1rem;
     overflow-wrap: anywhere;
   }
   .trash-item-text time {
     font-size: 0.68rem;
     color: rgba(46, 36, 25, 0.6);
     font-family: var(--font-body);
   }
   .trash-item-actions {
     display: flex;
     flex-direction: column;
     gap: 6px;
   }
   .trash-item-actions button {
     border: none;
     border-radius: 14px;
     padding: 4px 9px;
     font-size: 0.72rem;
     font-family: var(--font-body);
     white-space: nowrap;
   }
   .restore-btn { background: var(--success); color: #fff; }
   .forever-btn { background: var(--danger); color: #fff; }
   
   .trash-empty {
     text-align: center;
     color: var(--ink-soft);
     font-family: var(--font-hand);
     font-size: 1.05rem;
     margin-top: 40px;
   }
   
   .empty-trash-btn {
     margin-top: 12px;
     border: 1px solid var(--danger);
     background: transparent;
     color: var(--danger);
     border-radius: 20px;
     padding: 10px;
     font-family: var(--font-body);
     font-size: 0.85rem;
   }
   .empty-trash-btn:hover { background: rgba(209, 73, 91, 0.08); }
   
   /* ---------- Confetti canvas (paper flutter) ---------- */
   .confetti-canvas {
     position: fixed;
     inset: 0;
     pointer-events: none;
     z-index: 40;
   }
   
   /* ---------- Confirm modal ---------- */
   .confirm-modal-backdrop {
     position: fixed;
     inset: 0;
     background: rgba(20, 12, 5, 0.6);
     z-index: 60;
     opacity: 0;
     transition: opacity var(--dur-fast) ease;
   }
   .confirm-modal-backdrop.is-open { opacity: 1; }
   .confirm-modal-backdrop[hidden] { display: none; }
   
   .confirm-modal {
     position: fixed;
     top: 50%;
     left: 50%;
     z-index: 61;
     width: min(320px, calc(100vw - 40px));
     transform: translate(-50%, -50%) scale(0.9);
     opacity: 0;
     transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease;
   }
   .confirm-modal.is-open {
     transform: translate(-50%, -50%) scale(1);
     opacity: 1;
   }
   .confirm-modal[hidden] { display: none; }
   
   .confirm-modal-card {
     background: var(--paper-cream);
     border-radius: 4px 16px 4px 16px;
     box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
     padding: 24px 20px 20px;
     transform: rotate(-1deg);
   }
   .confirm-modal-message {
     font-family: var(--font-hand);
     font-size: 1.15rem;
     line-height: 1.4;
     color: var(--ink);
     margin: 0 0 18px;
     text-align: center;
   }
   .confirm-modal-actions {
     display: flex;
     gap: 10px;
     justify-content: center;
   }
   .confirm-cancel-btn,
   .confirm-ok-btn {
     border: none;
     border-radius: 20px;
     padding: 10px 18px;
     font-family: var(--font-body);
     font-size: 0.88rem;
     font-weight: 600;
   }
   .confirm-cancel-btn {
     background: var(--paper-cream-2);
     color: var(--ink);
     border: 1px solid rgba(46, 36, 25, 0.25);
   }
   .confirm-cancel-btn:hover { background: rgba(46, 36, 25, 0.08); }
   .confirm-ok-btn {
     background: var(--danger);
     color: #fff;
   }
   .confirm-ok-btn:hover { filter: brightness(1.08); }
   
   /* ---------- Explore-more button ---------- */
   .explore-more-btn {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 8px;
     margin: 22px auto 0;
     padding: 12px 22px;
     background: var(--wood-dark);
     color: var(--paper-cream);
     border: none;
     border-radius: 999px;
     font-family: var(--font-hand);
     font-size: 1.1rem;
     font-weight: 700;
     box-shadow: var(--shadow-soft);
     transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
   }
   .explore-more-btn:hover {
     transform: translateY(-2px);
     box-shadow: var(--shadow-note-hover);
   }
   .explore-more-icon { font-size: 1.05rem; }
   
   /* ---------- Promo-links modal ---------- */
   .promo-modal {
     position: fixed;
     top: 50%;
     left: 50%;
     z-index: 61;
     width: min(680px, calc(100vw - 32px));
     transform: translate(-50%, -50%) scale(0.96);
     opacity: 0;
     transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease;
   }
   .promo-modal.is-open {
     transform: translate(-50%, -50%) scale(1);
     opacity: 1;
   }
   .promo-modal[hidden] { display: none; }
   
   .promo-modal-card {
     background-color: var(--board-base);
     background-image:
       radial-gradient(circle at 12% 20%, var(--board-speckle-1) 0, transparent 2.2%),
       radial-gradient(circle at 70% 60%, var(--board-speckle-2) 0, transparent 2%),
       radial-gradient(circle at 85% 15%, var(--board-speckle-1) 0, transparent 2%);
     border-radius: var(--radius-card);
     border: 10px solid var(--wood-mid);
     outline: 4px solid var(--wood-dark);
     outline-offset: -10px;
     box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
     padding: 18px;
     max-height: min(78vh, 620px);
     display: flex;
     flex-direction: column;
   }
   
   .promo-modal-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin-bottom: 14px;
     flex-shrink: 0;
   }
   .promo-modal-header h2 {
     font-family: var(--font-hand);
     font-size: 1.4rem;
     color: var(--paper-cream);
     margin: 0;
     text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
   }
   .promo-modal-header .close-btn { color: var(--paper-cream); }
   
   .promo-grid {
     overflow-y: auto;
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
     align-content: start;
     gap: 10px;
     padding-right: 4px;
   }
   
   .promo-card {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     gap: 6px;
     text-decoration: none;
     background: var(--paper-cream);
     border-radius: 4px 10px 4px 10px;
     padding: 12px 8px;
     box-shadow: var(--shadow-note);
     color: var(--ink);
     text-align: center;
     transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
   }
   .promo-card:hover {
     transform: translateY(-3px);
     box-shadow: var(--shadow-note-hover);
   }
   .promo-icon { font-size: 1.6rem; line-height: 1; }
   .promo-text {
     font-family: var(--font-body);
     font-size: 0.78rem;
     line-height: 1.3;
   }
   
   @media (max-width: 640px) {
     .promo-modal { width: calc(100vw - 24px); }
     .promo-modal-card { max-height: 82vh; padding: 14px; }
     .promo-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
   }
   
   /* ---------- Export-format modal ---------- */
   .export-modal {
     position: fixed;
     top: 50%;
     left: 50%;
     z-index: 61;
     width: min(420px, calc(100vw - 32px));
     transform: translate(-50%, -50%) scale(0.95);
     opacity: 0;
     transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease;
   }
   .export-modal.is-open {
     transform: translate(-50%, -50%) scale(1);
     opacity: 1;
   }
   .export-modal[hidden] { display: none; }
   
   .export-modal-card {
     background: var(--paper-cream);
     border-radius: 4px 16px 4px 16px;
     box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
     padding: 20px;
   }
   
   .export-modal-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin-bottom: 14px;
   }
   .export-modal-header h2 {
     font-family: var(--font-hand);
     font-size: 1.3rem;
     color: var(--ink);
     margin: 0;
   }
   
   .export-options {
     display: flex;
     gap: 10px;
     margin-bottom: 14px;
   }
   .export-option-btn {
     flex: 1;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 8px;
     background: var(--paper-cream-2);
     border: 1px solid rgba(46, 36, 25, 0.18);
     border-radius: 4px 12px 4px 12px;
     padding: 18px 10px;
     font-family: var(--font-body);
     font-size: 0.85rem;
     color: var(--ink);
     transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
   }
   .export-option-btn:hover {
     transform: translateY(-2px);
     box-shadow: var(--shadow-note);
   }
   .export-option-icon { font-size: 1.8rem; }
   
   .export-hint {
     margin: 0;
     font-size: 0.76rem;
     line-height: 1.5;
     color: var(--ink-soft);
     text-align: center;
   }
   
   /* ---------- Ad footer ---------- */
   .ad-footer {
     position: fixed;
     left: 0;
     right: 0;
     bottom: 0;
     width: 100%;
     z-index: 50;
     background: var(--wood-dark);
     box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.3);
   }
   .ad-slot {
     width: 100%;
     height: var(--ad-bar-height);
     overflow: hidden;
     display: flex;
     align-items: center;
     justify-content: center;
   }
   .ad-slot .adsbygoogle {
     width: 100%;
     height: 100%;
   }
   
   /* ---------- Responsive ---------- */
   @media (max-width: 640px) {
     .wood-wall { padding: 20px 10px calc(var(--ad-bar-height) + 40px); }
     .corkboard { padding: 20px 12px 26px; border-width: 10px; }
     .notes-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 24px; }
     .trash-panel { width: 100%; }
   }
   
   @media (max-width: 380px) {
     .board-title { font-size: 1.7rem; }
   }
   
   /* ---------- Reduced motion ---------- */
   @media (prefers-reduced-motion: reduce) {
     * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
   }