/* Base reset for the standalone site */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: a dotted paper wall of taped notes; one column of strips on a phone, a loose grid on a computer. Single light look on purpose. */
:root {
  color-scheme: light;
  --paper: #FFFEFA;
  --dot: #E4E1D6;
  --ink: #1A1A1A;
  --ink-2: #3D3D38;
  --muted: #55554F;
  --rule: #CFCEC6;
  --field: #FFFFFF;
  --scrim: rgba(26, 26, 26, 0.42);
  --tape: rgba(255, 255, 255, 0.65);
  --warn: #9E2318;
  --font-line: "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Caveat", "Comic Sans MS", cursive;
}
body {
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 72px;
  box-sizing: border-box;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #2148A8; outline-offset: 2px; }
a { color: var(--ink); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 24px 4px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-weight: 800; font-size: 30px; letter-spacing: -1px; }
.stamp { background: #FFE45C; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; transform: rotate(-6deg); display: inline-block; }
.plus { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: var(--paper); border: none; font-size: 28px; line-height: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 22px 0 24px; }
.tagline { font-family: var(--font-hand); font-size: 26px; line-height: 1.1; }
.toggle { display: flex; background: var(--field); border: 2px solid var(--ink); border-radius: 999px; padding: 3px; flex-shrink: 0; }
.toggle button { background: transparent; border: none; border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 600; min-height: 40px; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.toast { margin-top: 14px; background: var(--ink); color: var(--paper); border-radius: 12px; padding: 6px 8px 6px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toast span { font-family: var(--font-hand); font-size: 24px; }
.toast button { background: transparent; border: none; color: var(--paper); font-size: 22px; width: 44px; height: 44px; }

.shuffle { width: 100%; margin: 0 0 30px; background: transparent; border: 2px dashed #B8B4A6; border-radius: 12px; padding: 10px 16px; font-family: var(--font-hand); font-size: 25px; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.surprise { margin: 0 0 40px; display: flex; flex-direction: column; gap: 16px; }
.surprise-label { font-family: var(--font-hand); font-size: 25px; color: var(--muted); }
.surprise-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.pill { background: var(--ink); color: var(--paper); border: none; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600; min-height: 44px; }
.hand-btn { background: transparent; border: none; font-family: var(--font-hand); font-size: 24px; min-height: 44px; padding: 0 6px; }

/* the wall */
.wall.lines { display: flex; flex-direction: column; gap: 18px; max-width: 720px; margin: 0 auto; }
.wall.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 52px 40px; align-items: start; }
@media (min-width: 760px) { .wall.notes > :nth-child(3n+2) { margin-top: 48px; } .wall.notes > :nth-child(3n) { margin-top: 18px; } }

.strip { background: var(--note); border: none; border-radius: 6px; padding: 16px 18px; transform: rotate(var(--tilt)); box-shadow: 0 8px 14px -10px rgba(0,0,0,0.35); text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; width: 100%; color: var(--ink); }
.strip-line { font-family: var(--font-line); font-size: 1.15rem; line-height: 1.25; min-width: 0; }

.note { position: relative; background: var(--note); border-radius: 6px; padding: 38px 24px 18px; transform: rotate(var(--tilt)); box-shadow: 0 14px 24px -14px rgba(0,0,0,0.35); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tape { position: absolute; top: -12px; left: 50%; margin-left: -46px; width: 92px; height: 25px; background: var(--tape); transform: rotate(var(--tape-tilt)); }
.line { margin: 0; font-family: var(--font-line); line-height: 1.13; overflow-wrap: anywhere; }
.line[data-size="l"] { font-size: 2.15rem; }
.line[data-size="m"] { font-size: 1.75rem; }
.line[data-size="s"] { font-size: 1.4rem; line-height: 1.2; }
@media (max-width: 520px) {
  .line[data-size="l"] { font-size: 1.85rem; }
  .line[data-size="m"] { font-size: 1.55rem; }
  .line[data-size="s"] { font-size: 1.28rem; }
}
.scribble { font-family: var(--font-hand); font-size: 23px; line-height: 1.15; }
.foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-top: 2px dashed rgba(26,26,26,0.25); padding-top: 12px; }
.meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.meta-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-src { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go { flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 16px; min-height: 44px; box-sizing: border-box; text-decoration: none; font-size: 14px; font-weight: 600; }
.go:hover { background: #2E2E2B; color: var(--paper); }
.extras { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: -4px; }
.fold { background: transparent; border: none; font-family: var(--font-hand); font-size: 22px; min-height: 44px; padding: 0 8px; }
.del { background: transparent; border: none; font-size: 12px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 4px; margin-left: auto; }
.del-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; }
.del-confirm .yes { background: var(--warn); color: #FFFFFF; border: none; border-radius: 999px; padding: 8px 14px; font-weight: 600; min-height: 40px; }
.del-confirm .no { background: transparent; border: 1px solid var(--ink-2); border-radius: 999px; padding: 8px 14px; min-height: 40px; }

.empty { border: 3px dashed #C9C5B6; border-radius: 8px; padding: 48px 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--muted); }
.empty strong { font-family: var(--font-hand); font-size: 30px; color: var(--ink); font-weight: 600; }
.readonly-note { margin: 32px auto 0; text-align: center; font-size: 13px; color: var(--muted); max-width: 520px; }

/* pin sheet */
.overlay { position: fixed; inset: 0; z-index: 20; background: var(--scrim); overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.sheet { width: 100%; max-width: 520px; min-height: 100%; box-sizing: border-box; background: var(--paper); padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); padding-block: 0 48px; }
@media (min-width: 640px) { .sheet { min-height: 0; margin-block: 40px; border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.45); } }
.sheet-top { position: sticky; top: 0; z-index: 2; background: var(--paper); padding-bottom: 12px; box-shadow: 0 10px 12px -12px rgba(0,0,0,0.25); }
@media (max-height: 620px) { .sheet-top { position: static; box-shadow: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px 8px; }
.sheet-head .cancel { background: transparent; border: none; font-size: 15px; min-height: 44px; padding: 0; }
.sheet-head h2 { margin: 0; font-family: var(--font-hand); font-size: 30px; font-weight: 600; }
.sheet-head .spacer { width: 52px; }
.preview { margin-top: 4px; padding: 22px 16px 10px; min-height: 0; box-sizing: border-box; gap: 8px; transform: rotate(-1deg); }
.preview .line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.preview .line[data-size="l"] { font-size: 1.35rem; }
.preview .line[data-size="m"] { font-size: 1.15rem; }
.preview .line[data-size="s"] { font-size: 1rem; line-height: 1.25; }
.preview .scribble { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview .foot { padding-top: 8px; }
.preview .placeholder { color: rgba(26,26,26,0.45); font-style: italic; }
.preview .go { padding: 7px 13px; min-height: 0; font-size: 13px; }
.form { display: flex; flex-direction: column; gap: 20px; padding-top: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .label { font-weight: 600; font-size: 14px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.count { font-size: 13px; font-weight: 600; color: var(--muted); }
.count.over { color: var(--warn); }
.input { font-size: 16px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 10px; background: var(--field); min-height: 48px; box-sizing: border-box; width: 100%; }
textarea.input { font-family: var(--font-line); font-size: 18px; resize: none; }
.input::placeholder { color: #8A887F; }
.detected { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detected-text { font-size: 13px; color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn { background: transparent; border: none; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 4px; }
.details { display: flex; flex-direction: column; gap: 10px; background: var(--field); border: 1px solid #E3E2DB; border-radius: 12px; padding: 14px; }
.details label { font-size: 13px; font-weight: 600; }
.details .input { border-width: 1px; border-color: #B8B4A6; font-size: 15px; min-height: 44px; padding: 10px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { background: var(--field); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; font-size: 13px; min-height: 38px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 46px; height: 46px; border-radius: 10px; border: 1px solid rgba(26,26,26,0.2); background: var(--sw); }
.swatches button[aria-pressed="true"] { border: 3px solid var(--ink); transform: rotate(-4deg); }
.scribble-input { font-family: var(--font-hand); font-size: 22px; border-style: dashed; border-color: #B8B4A6; }
.msg { font-size: 14px; color: var(--warn); }
.msg:empty { display: none; }
.pin-btn { background: var(--ink); color: var(--paper); border: none; border-radius: 999px; padding: 16px; font-size: 17px; font-weight: 600; min-height: 56px; }
.pin-btn:disabled { background: #D9D7CF; color: var(--muted); cursor: default; }

@media (prefers-reduced-motion: reduce) { .note, .strip, .preview, .stamp, .swatches button { transform: none !important; } }

/* footer + owner sign-in */
.site-foot { margin-top: 64px; padding-top: 20px; border-top: 1px dashed var(--rule); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); }
.link-btn.quiet { color: var(--muted); font-weight: 500; }
.signin { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 420px; }
.signin label { font-weight: 600; color: var(--ink); }
.signin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.signin-row .input { flex: 1; min-width: 0; }
