:root {
  --canvas: #f7eee3;
  --ink: #392f2c;
  --muted: #776964;
  --line: rgba(66, 47, 42, .16);
  --red: #a84550;
  --red-dark: #80313a;
  --paper: #fffdf7;
  --butter: #f5dc8e;
  --peach: #f2ba9e;
  --rose: #efb4bc;
  --mint: #bcd9c3;
  --lilac: #cfc2df;
  --display: Georgia, 'Times New Roman', serif;
  --body: 'Trebuchet MS', 'Segoe UI', sans-serif;
  --shadow: 0 18px 50px rgba(78, 53, 47, .13);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  background-color: var(--canvas);
  background-image: linear-gradient(rgba(110, 88, 79, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(110, 88, 79, .055) 1px, transparent 1px);
  background-size: 28px 28px;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 10%, rgba(255,255,255,.75), transparent 34rem), radial-gradient(circle at 92% 92%, rgba(222,174,164,.24), transparent 30rem);
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(168, 69, 80, .35); outline-offset: 3px; }
.hidden { display: none !important; }
main { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 12px; color: var(--red); font-size: .68rem; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.login-view { min-height: 100svh; display: grid; place-items: center; padding: 28px; }
.login-card {
  width: min(100%, 510px);
  position: relative;
  padding: clamp(40px, 8vw, 68px);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: rotate(-.35deg);
}
.login-card::before, .login-card::after { content: ''; position: absolute; width: 72px; height: 22px; background: rgba(237, 205, 140, .58); }
.login-card::before { top: 17px; left: -25px; transform: rotate(-42deg); }
.login-card::after { bottom: 16px; right: -25px; transform: rotate(-42deg); }
.doodle-heart { position: absolute; right: 36px; top: 28px; color: var(--red); font-family: var(--display); font-size: 2.4rem; transform: rotate(11deg); }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 500; text-wrap: balance; }
.login-card h1 { font-size: clamp(3rem, 10vw, 5.4rem); line-height: .88; letter-spacing: -.055em; }
h1 em { color: var(--red); font-weight: 400; }
.intro-copy { margin: 28px 0 30px; color: var(--muted); font-family: var(--display); font-size: 1.05rem; line-height: 1.65; }
label { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.passcode-row { display: flex; margin-top: 9px; border-bottom: 1.5px solid var(--ink); }
.passcode-row input { width: 100%; min-height: 50px; padding: 8px 2px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.passcode-row input::placeholder { color: #ac9e98; }
.round-button { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--red); color: white; cursor: pointer; transition: transform .2s, background .2s; }
.round-button:hover { transform: translateX(3px); background: var(--red-dark); }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--red-dark); font-size: .78rem; }
.tiny { margin: 24px 0 0; color: var(--muted); font-size: .7rem; }
.board-view { width: min(100% - 36px, 1180px); margin: 0 auto; padding: 54px 0 100px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: clamp(2.3rem, 6vw, 4.9rem); line-height: .98; letter-spacing: -.045em; }
.top-actions { display: flex; align-items: center; gap: 16px; padding-bottom: 7px; }
.live-dot { white-space: nowrap; color: var(--muted); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.live-dot i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #668c68; box-shadow: 0 0 0 4px rgba(102,140,104,.14); }
.text-button { min-height: 44px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; cursor: pointer; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.composer { margin: 34px 0 48px; padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.composer-copy { display: flex; align-items: center; gap: 14px; }
.composer-copy strong, .composer-copy small { display: block; }
.composer-copy strong { font-family: var(--display); font-size: 1.05rem; }
.composer-copy small { margin-top: 3px; color: var(--muted); }
.pencil { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--red); font-size: 1.3rem; }
.primary { min-height: 46px; padding: 11px 20px; border: 1px solid var(--red-dark); border-radius: 999px; background: var(--red); color: white; cursor: pointer; box-shadow: 0 8px 20px rgba(128,49,58,.16); transition: transform .2s, background .2s; }
.primary:hover { transform: translateY(-2px); background: var(--red-dark); }
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 26px; }
.sticky-note { position: relative; min-height: 270px; padding: 34px 28px 26px; box-shadow: 0 13px 24px rgba(66,45,39,.13); transform: rotate(var(--tilt)); transition: transform .2s, box-shadow .2s; }
.sticky-note:nth-child(3n+1) { --tilt: -.8deg; }
.sticky-note:nth-child(3n+2) { --tilt: .65deg; }
.sticky-note:nth-child(3n) { --tilt: -.25deg; }
.sticky-note:hover, .sticky-note:focus-within { transform: rotate(0) translateY(-3px); box-shadow: 0 18px 32px rgba(66,45,39,.17); z-index: 2; }
.color-butter { background: var(--butter); }
.color-peach { background: var(--peach); }
.color-rose { background: var(--rose); }
.color-mint { background: var(--mint); }
.color-lilac { background: var(--lilac); }
.pin { position: absolute; top: 12px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: rgba(119,63,59,.7); box-shadow: 1px 2px 3px rgba(60,35,30,.3); }
.sticky-note time { display: block; color: rgba(57,47,44,.58); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.note-text { min-height: 105px; margin: 24px 0; font-family: var(--display); font-size: clamp(1.18rem, 2vw, 1.45rem); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-toggle { min-height: 42px; padding: 0; border: 0; border-bottom: 1px solid rgba(57,47,44,.45); background: transparent; cursor: pointer; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.reply-toggle span { margin-left: 5px; }
.thread { margin-top: 22px; }
.reply { padding: 13px 0; border-top: 1px solid rgba(57,47,44,.18); }
.reply p { margin: 0; font-family: var(--display); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply time { margin-top: 7px; font-size: .58rem; }
.reply-form { margin-top: 18px; }
.reply-form label { font-size: .62rem; }
.reply-form textarea { width: 100%; min-height: 84px; margin-top: 7px; padding: 10px; resize: vertical; border: 1px solid rgba(57,47,44,.25); background: rgba(255,255,255,.42); color: var(--ink); font-family: var(--display); text-transform: none; letter-spacing: normal; }
.reply-form > div { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.reply-form button { min-height: 40px; padding: 7px 11px; border: 1px solid rgba(57,47,44,.3); background: rgba(255,255,255,.45); cursor: pointer; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.empty-state { width: min(100%, 430px); margin: 100px auto; padding: 54px 30px; position: relative; background: var(--paper); box-shadow: var(--shadow); text-align: center; transform: rotate(-1deg); }
.empty-state p { margin: 0 0 8px; font-family: var(--display); font-size: 2rem; }
.empty-state span { color: var(--muted); font-size: .84rem; }
.empty-tape { position: absolute; top: -10px; left: 50%; width: 88px; height: 24px; background: rgba(239,196,151,.7); transform: translateX(-50%) rotate(2deg); }
dialog { width: min(100% - 28px, 650px); padding: 0; border: 0; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(48,37,34,.45); backdrop-filter: blur(3px); }
.dialog-card { position: relative; padding: clamp(32px, 7vw, 56px); background: var(--paper); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(40,27,24,.28); }
.dialog-card h2 { margin: 0 0 28px; font-size: clamp(2.2rem, 7vw, 4rem); letter-spacing: -.04em; }
.close-button { position: absolute; top: 18px; right: 20px; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; font-size: 1.7rem; }
.dialog-card textarea { width: 100%; min-height: 170px; margin-top: 9px; padding: 16px; resize: vertical; border: 1px solid var(--line); background: #fffaf2; color: var(--ink); font-family: var(--display); font-size: 1.1rem; line-height: 1.5; }
.dialog-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 22px; }
fieldset { padding: 0; border: 0; }
legend { margin-bottom: 9px; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.swatches { display: flex; gap: 8px; }
.swatches label input { position: absolute; opacity: 0; pointer-events: none; }
.swatch { width: 30px; height: 30px; display: block; overflow: hidden; border: 2px solid transparent; border-radius: 50%; color: transparent; cursor: pointer; }
.swatches input:checked + .swatch { border-color: var(--ink); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink); }
.swatch.butter { background: var(--butter); }.swatch.peach { background: var(--peach); }.swatch.rose { background: var(--rose); }.swatch.mint { background: var(--mint); }.swatch.lilac { background: var(--lilac); }
@media (max-width: 850px) { .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) {
  .login-card::before, .login-card::after { display: none; }
  .board-view { width: min(100% - 26px, 1180px); padding-top: 32px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-direction: column; align-items: flex-end; gap: 5px; }
  .live-dot { font-size: .58rem; }
  .composer { align-items: flex-end; }
  .composer-copy small { display: none; }
  .notes-grid { grid-template-columns: 1fr; gap: 22px; }
  .sticky-note { min-height: 240px; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
  .dialog-footer .primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
