/* ============================================================
   EBKaC labs — Sticky day notes
   Page chrome (hero, form panel, board) + the sticky notes.
   Each note is an <aside class="note"> wrapper (shadow + tape as
   pseudo elements) around a .note-body (paper, fold, noise).
   Notes are sized from --note-size so the same markup works on
   screen (px) and in print (mm, 12 per A4 portrait page).
   Sticky note look after Christian Alder's "Sticky Note"
   experiment; tape after the classic CodePen taped notes.
   ============================================================ */

:root{
  --bg:#fbfbfd;
  --surface:#ffffff;
  --ink:#1d1d1f;
  --ink-soft:#6e6e73;
  --line:#e3e3e6;
  --accent:#2563d9;
  --radius:18px;
  --shadow:0 1px 3px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.06);
  --maxw:1380px;
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-whimsy:"Shantell Sans","Comic Sans MS","Chalkboard SE","Bradley Hand",cursive;

  /* note ink + the "dark" tints used for fold, edge and shadow */
  --note-ink:#2b2622;
  --note-dark-25:rgba(40,30,20,.25);
  --note-dark-50:rgba(40,30,20,.45);

  /* fine paper grain, tiled over the note colour */
  --texture-noise:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:var(--font);
  color:var(--ink);
  background:var(--bg);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---- hero (top padding clears the floating nav pill) ---- */
.hero{
  text-align:center;
  padding:120px 22px 44px;
  background:linear-gradient(180deg,#f5f7fb 0%,var(--bg) 100%);
  border-bottom:1px solid var(--line);
}
.hero h1{font-size:clamp(32px,5.5vw,48px);font-weight:600;letter-spacing:-.02em}

/* ---- app layout ---- */
.sn-app{
  max-width:var(--maxw);margin:0 auto;padding:36px 22px 72px;
  display:grid;grid-template-columns:300px minmax(0,1fr);gap:28px;align-items:start;
}

.panel{
  position:sticky;top:96px;
  /* fit the window and scroll on its own, so every option stays reachable on short screens */
  max-height:calc(100vh - 96px - 20px);max-height:calc(100dvh - 96px - 20px);
  overflow-y:auto;overscroll-behavior:contain;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:22px;
  display:flex;flex-direction:column;gap:18px;
}
.panel > *{flex-shrink:0}
.panel fieldset{border:0;display:flex;flex-direction:column;gap:10px}
.panel legend{
  font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  color:var(--ink-soft);margin-bottom:8px;
}
.row{display:flex;gap:10px}
.field{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.field--num{flex:0 0 92px}
.field > span{font-size:13px;color:var(--ink-soft)}
.field select,.field input{
  font:inherit;font-size:15px;color:var(--ink);
  background:var(--surface);border:1px solid #d2d2d7;border-radius:10px;
  padding:8px 10px;width:100%;min-height:40px;
}
.field select:focus,.field input:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:transparent}
.check{display:flex;align-items:center;gap:10px;font-size:15px;cursor:pointer}
.check input{width:18px;height:18px;accent-color:var(--accent)}

.mode-count,.mode-range{display:flex;flex-direction:column;gap:10px}
.sn-app[data-mode="count"] .mode-range,
.sn-app[data-mode="range"] .mode-count,
.sn-app:not([data-count-dates]) .mode-count-dates{display:none}

/* two-way switch: number of days / date range */
.segmented{
  display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:3px;
  background:#f0f0f3;border-radius:11px;
}
.segmented label{position:relative;cursor:pointer}
.segmented input{position:absolute;opacity:0;inset:0;cursor:pointer}
.segmented span{
  display:block;text-align:center;font-size:14px;font-weight:500;color:var(--ink-soft);
  padding:7px 6px;border-radius:9px;
}
.segmented input:checked + span{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
.segmented input:focus-visible + span{outline:2px solid var(--accent);outline-offset:1px}

.swatches{display:flex;flex-wrap:wrap;gap:6px}
.swatch{
  width:26px;height:26px;border-radius:50%;cursor:pointer;
  border:2px solid var(--surface);box-shadow:0 0 0 1px #d2d2d7;
}
.swatch.is-on{box-shadow:0 0 0 2px var(--ink)}
.swatch:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.print-btn{
  font:inherit;font-size:16px;font-weight:600;color:#fff;background:var(--accent);
  border:0;border-radius:12px;padding:13px 18px;cursor:pointer;
}
.print-btn:hover{opacity:.92}
.print-btn:disabled{opacity:.45;cursor:not-allowed}
.summary{font-size:14px;color:var(--ink);text-align:center;margin-top:-8px}
.hint{font-size:12.5px;color:var(--ink-soft)}

.preview{min-width:0}
.error{
  background:#fdecec;color:#a11d1d;border:1px solid #f3c2c2;border-radius:12px;
  padding:12px 16px;font-size:15px;margin-bottom:16px;
}

/* ---- bottom breadcrumb (shared look with products/support) ---- */
.breadcrumb-bottom{border-top:1px solid var(--line);background:var(--bg)}
.breadcrumb-bottom .bc-inner{max-width:var(--maxw);margin:0 auto;padding:16px 22px;display:flex;align-items:center;gap:10px;font-size:13px}
.breadcrumb-bottom .brand{font-weight:600;color:var(--ink)}
.breadcrumb-bottom .crumb{color:var(--ink-soft)}

/* ============================================================
   THE BOARD + STICKY NOTES
   ============================================================ */
.board{
  --note-size:190px;
  display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;
  gap:46px 34px;
  padding:34px 8px 44px;
  min-height:240px;
}
.board:empty{display:none}
.print-page{display:contents}

.note{
  --note-color:#feff9c;
  --note-rotate:0deg;
  --tape-rotate:-2deg;
  --tape-shift:0%;

  position:relative;flex:none;
  width:var(--note-size);
  /* perspective keeps rotated edges smooth in Firefox */
  transform:perspective(1px) rotate(var(--note-rotate));
  break-inside:avoid;page-break-inside:avoid;
  -webkit-print-color-adjust:exact;print-color-adjust:exact;
}

/* soft shadow under the lifted bottom-right corner */
.note::before{
  content:'';position:absolute;inset:0;
  background:var(--note-dark-25);
  border-radius:0 0 100px/5px 0;
  filter:blur(2px);
}

/* translucent tape across the top edge, with torn ends */
.note::after{
  content:'';position:absolute;z-index:2;
  top:calc(var(--note-size) * -.07);
  left:50%;
  width:calc(var(--note-size) * .52);
  height:calc(var(--note-size) * .14);
  transform:translateX(calc(-50% + var(--tape-shift))) rotate(var(--tape-rotate));
  background:
    linear-gradient(180deg,rgba(255,255,255,.35),rgba(255,255,255,0) 60%),
    rgba(232,224,200,.7);
  box-shadow:0 1px 1.5px rgba(0,0,0,.16);
  clip-path:polygon(
    2% 0,98% 0,100% 12%,97% 26%,100% 42%,97% 58%,100% 74%,97% 88%,99% 100%,
    1% 100%,3% 86%,0 72%,3% 57%,0 42%,3% 27%,0 13%);
}
.board.no-tape .note::after{display:none}

.note-body{
  position:relative;
  width:var(--note-size);aspect-ratio:1/1;
  padding:calc(var(--note-size) * .08);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;
  font-family:var(--font-whimsy);color:var(--note-ink);line-height:1;

  background-color:var(--note-color);
  background-image:var(--texture-noise),
    linear-gradient(165deg,transparent 84%,var(--note-dark-25) 100%);
  /* the elliptical radius curls the bottom-right corner up */
  border-radius:0 0 75%/10% 0;
  border-bottom:solid 2px var(--note-dark-50);
  outline:solid 1px var(--note-dark-25);
  outline-offset:-1px;
}

.note-label{
  font-size:calc(var(--note-size) * .115);font-weight:600;
  letter-spacing:.02em;opacity:.8;
}
.note-num{
  font-size:calc(var(--note-size) * .4);font-weight:800;
  letter-spacing:-.03em;line-height:.95;margin:calc(var(--note-size) * .02) 0;
}
/* long numbers ("1000") shrink to stay inside the note */
.note-num.is-long{font-size:calc(var(--note-size) * .3)}
.note-date{font-size:calc(var(--note-size) * .085);font-weight:400;margin-top:calc(var(--note-size) * .03)}
.note-total{
  position:absolute;right:calc(var(--note-size) * .09);bottom:calc(var(--note-size) * .07);
  font-size:calc(var(--note-size) * .065);opacity:.65;
}
.note-today{
  position:absolute;left:calc(var(--note-size) * .08);top:calc(var(--note-size) * .09);
  font-size:calc(var(--note-size) * .06);font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  opacity:.7;
}

@media (max-width:860px){
  .sn-app{grid-template-columns:1fr}
  .panel{position:static;max-height:none;overflow:visible}
}
@media (max-width:520px){
  .hero{padding:100px 16px 36px}
  .sn-app{padding:24px 16px 56px}
}

/* ============================================================
   PRINT — only the notes, 3 × 4 per A4 portrait page
   ============================================================ */
@page{size:A4 portrait;margin:12mm}

@media print{
  html,body{background:#fff}
  body > *:not(main){display:none !important}
  .sn-app{display:block;max-width:none;padding:0;margin:0}
  .panel,.error{display:none !important}
  .board{
    --note-size:52mm;
    display:block;
    width:186mm;padding:0;border:0;border-radius:0;background:none;min-height:0;
  }
  .print-page{
    display:flex;flex-wrap:wrap;align-content:flex-start;
    break-after:page;page-break-after:always;
  }
  .print-page:last-child{break-after:auto;page-break-after:auto}
  /* 62mm wide × 66mm tall slots: 3 across, 4 down on 186 × 273mm */
  .note{margin:7mm 5mm}
  .note-today{display:none}
}
