/* Sticky notes (Post-it colours), the note editor, and the checklist card. */
.sticky-layer { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.sticky {
  position: absolute; width: 260px; min-height: 220px; pointer-events: auto;
  background: var(--sn-bg); color: #1F1D18; border-radius: 4px;
  box-shadow: 0 10px 22px rgba(0,0,0,.22), 0 2px 4px rgba(0,0,0,.12);
  transform: rotate(var(--rot, 0deg)); display: flex; flex-direction: column;
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", "Chalkboard SE", cursive;
}
.sticky.small { width: 200px; min-height: 170px; }
.sticky.large { width: 340px; min-height: 300px; }
.sticky.dragging { box-shadow: 0 22px 40px rgba(0,0,0,.3); transform: rotate(var(--rot, 0deg)) scale(1.03); }
.sticky::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 30px; background: rgba(0,0,0,.06); }
.sn-bar { position: relative; display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 6px; cursor: grab; touch-action: none; }
.sn-grip { font-size: 26px; letter-spacing: 2px; color: rgba(0,0,0,.35); line-height: 1; }
.sn-btn { width: 44px; height: 40px; border: 0; background: rgba(255,255,255,.35); border-radius: 8px; font-size: 22px; color: #1F1D18; }
.sn-body { flex: 1; padding: 6px 14px 16px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.sn-text { font-size: 24px; line-height: 1.25; white-space: pre-wrap; word-break: break-word; }
.sticky.large .sn-text { font-size: 28px; }
.sticky.small .sn-text { font-size: 20px; }
.sn-empty { opacity: .5; }
.sn-pic { width: 100%; border-radius: 4px; object-fit: cover; max-height: 60%; }
.sn-draw { width: 100%; }
.sticky.yellow, .stack-note.yellow, .note-swatch.yellow, #note-card.yellow { --sn-bg: #FFF48F; }
.sticky.blue,   .stack-note.blue,   .note-swatch.blue,   #note-card.blue   { --sn-bg: #8FD8FF; }
.sticky.green,  .stack-note.green,  .note-swatch.green,  #note-card.green  { --sn-bg: #B6F56A; }
.sticky.pink,   .stack-note.pink,   .note-swatch.pink,   #note-card.pink   { --sn-bg: #FF9ACB; }
.sticky.orange, .stack-note.orange, .note-swatch.orange, #note-card.orange { --sn-bg: #FFB54D; }
.sticky.lilac,  .stack-note.lilac,  .note-swatch.lilac,  #note-card.lilac  { --sn-bg: #D9B8FF; }

/* stack sheet */
.notes-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 4px; }
.stack-note { background: var(--sn-bg); color: #1F1D18; border-radius: 4px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 10px rgba(0,0,0,.15); font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", "Chalkboard SE", cursive; }
.stack-open { background: none; border: 0; text-align: left; padding: 0; color: inherit; font: inherit; min-height: 120px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.stack-open .sn-text { font-size: 21px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.stack-open .sn-pic { max-height: 120px; }
.stack-open .sn-draw { max-height: 120px; object-fit: contain; }
.stack-actions { display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--font); }
.small-btn { min-height: 44px; padding: 0 12px; font-size: 17px; }

/* editor */
#note-card { background: var(--sn-bg, #FFF48F); color: #1F1D18; }
#note-card .sheet-head h2, #note-card .hint, #note-card .field > span { color: #1F1D18; }
#note-card .icon-btn { background: rgba(255,255,255,.5); border-color: transparent; color: #1F1D18; }
#note-card .btn { background: rgba(255,255,255,.55); border-color: rgba(0,0,0,.15); color: #1F1D18; }
#note-card .btn.primary { background: #1F1D18; color: #fff; border-color: #1F1D18; }
#note-card .btn.danger { background: #FCEBEB; color: #A32D2D; border-color: #A32D2D; }
#note-card .seg { background: rgba(255,255,255,.4); border-color: rgba(0,0,0,.15); }
#note-card .seg button { background: transparent; color: #1F1D18; border-color: rgba(0,0,0,.15); }
#note-card .seg button[aria-checked="true"], #note-card .seg button[aria-selected="true"] { background: #1F1D18; color: #fff; }
#note-card textarea { background: rgba(255,255,255,.45); border: 1px solid rgba(0,0,0,.15); color: #1F1D18; font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", "Chalkboard SE", cursive; font-size: 26px; min-height: 180px; }
.note-colors { display: flex; gap: 10px; }
.note-swatch { width: 52px; height: 52px; border-radius: 6px; border: 3px solid rgba(0,0,0,.15); background: var(--sn-bg); padding: 0; }
.note-swatch[aria-checked="true"] { border-color: #1F1D18; }
.note-pane { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.draw-box { position: relative; height: 300px; background: rgba(255,255,255,.5); border: 1px dashed rgba(0,0,0,.25); border-radius: 10px; overflow: hidden; }
#note-canvas { width: 100%; height: 100%; touch-action: none; display: block; }
.draw-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pen { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; background: var(--pen); padding: 0; }
.pen[aria-checked="true"] { border-color: #1F1D18; box-shadow: 0 0 0 3px #fff inset; }
.pen-size { width: 44px; height: 44px; border-radius: 10px; border: 2px solid rgba(0,0,0,.2); background: rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center; padding: 0; }
.pen-size span { display: block; background: #1F1D18; border-radius: 50%; }
.pen-size[aria-checked="true"] { border-color: #1F1D18; }
.pen-eraser[aria-checked="true"] { background: #1F1D18; color: #fff; }
.picture-preview { min-height: 160px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.45); border-radius: 10px; overflow: hidden; }
.picture-preview img { max-width: 100%; max-height: 320px; border-radius: 6px; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 64px; padding: 0 24px; border-radius: 14px; background: #1F1D18; color: #fff; font-size: 22px; font-weight: 600; cursor: pointer; }
.file-btn input { display: none; }
.note-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.note-foot .toggle { color: #1F1D18; }

/* checklist card + sheet */
.routine-card.all-done { border-color: var(--accent); background: var(--accent-soft); }
.routine-item .text small { display: block; font-size: 16px; color: var(--text-low); }
.routine-item .text { white-space: normal; }
.mycal-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-right: 10px; vertical-align: -1px; }
.mycal-list { max-height: 40vh; }

/* read-only (her own) events */
.ev.mine .stripe, .wk-ev.mine { border-left-color: var(--ev-color); }
.ev.mine .stripe { background: var(--ev-color); }
.ev .cal { font-size: 15px; color: var(--text-low); }
.wk-ev.mine { border-left-color: var(--ev-color); }
.mo-chip.mine { border-left-color: var(--ev-color); }

.icon-btn.notes-btn { border-radius: 8px; background: #FFF48F; color: #1F1D18; border-color: #E6DA6E; }
:root[data-theme="dark"] .icon-btn.notes-btn { background: #D9CF5F; border-color: #B8AE4A; }

@media (orientation: portrait), (max-width: 820px) {
  .sticky { width: 220px; }
  .sticky.large { width: 280px; }
  .notes-grid { grid-template-columns: 1fr 1fr; }
}
