/* The family board in a browser. Sizes, colors, and shapes follow the app's own views:
   Theme.swift (Palette, markers, note pads), Components.swift, Paper.swift, WeekPage.swift, BoardNotes.swift. */
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  --cork: #c8a476;
  --mark: #eadbc3;
  --sticky-ink: #2b2118;
  --sticky-link: #8f2d1c;
  /* Markers (Marker.color). Mustard's text is ink by day, like Marker.textColor. */
  --m-brick: #a63a26; --m-teal: #23667f; --m-purple: #6247a0; --m-pine: #2f6b3f;
  --m-mustard: #9a6f0a; --m-rose: #a3386c; --m-ink: #4a3726; --t-mustard: #4a3726;
  /* Note pads (NoteColor.fill). */
  --n-yellow: #f5dc82; --n-pink: #f6b8c6; --n-blue: #aad6ea; --n-green: #c5e1a0; --n-orange: #f8c088;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cork: #8a6b45;
    --mark: #55432e;
    --m-brick: #ee8670; --m-teal: #6db6d6; --m-purple: #b39de0; --m-pine: #82c493;
    --m-mustard: #e5bc4c; --m-rose: #e595b5; --m-ink: #f2e8d5; --t-mustard: #e5bc4c;
    --n-yellow: #e8c96a; --n-pink: #e2a1b1; --n-blue: #92c1d6; --n-green: #aecb88; --n-orange: #e4aa70;
  }
}

.board-body { padding-bottom: 120px; }
.board-body header { max-width: 1160px; }

.kb { max-width: 620px; margin: 0 auto; padding: 0 16px; color: var(--ink); }
.kb-loading { text-align: center; color: var(--muted); font: 500 16px "Fredoka", sans-serif; margin: 60px 0; }
/* :where keeps this below every button style that sets its own font. */
:where(.kb, dialog.sheet) button { font: inherit; color: inherit; }
.kb [hidden] { display: none !important; }

.chunky { font-family: "Fredoka", sans-serif; font-weight: 700; }
.label { font-family: "Fredoka", sans-serif; font-weight: 500; }
.hand { font-family: "Patrick Hand", "Chalkboard SE", "Comic Sans MS", cursive; font-weight: 400; }

/* Top bar: month, pager, and the settings magnet */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 6px; }
.top h1 { font: 700 38px/1.1 "Fredoka", sans-serif; margin: 0; }
.pager { display: flex; align-items: center; gap: 0; margin: 0 0 16px -6px; }
.pager .wk { font: 500 15px "Fredoka", sans-serif; }
.pager button.chev { background: none; border: 0; width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; }
.pager button.chev:disabled { opacity: 0.25; cursor: default; }
.pager button.chev svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.today-btn { margin-left: 6px; padding: 5px 9px; font: 700 13px "Fredoka", sans-serif; color: var(--link) !important; background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 3px 6px rgb(90 64 34 / 0.22); }

.magnet { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none;
  box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 3px 8px rgb(90 64 34 / 0.28); }
.magnet:active { transform: translateY(1.5px); box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 1px 3px rgb(90 64 34 / 0.18); }
.magnet svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.magnet.brick { background: var(--m-brick); color: var(--card); width: 46px; height: 46px; }
.magnet:disabled { opacity: 0.45; cursor: default; }

/* Index card around the week (IndexCard) */
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 4px 14px;
  box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 3px 8px rgb(90 64 34 / 0.28); }
.card.paper { background: var(--paper); transform: rotate(0.4deg); }
.card.faded { opacity: 0.45; pointer-events: none; }
.card.locked { filter: blur(5px); pointer-events: none; user-select: none; }
.rule { height: 1.5px; background: var(--cork); }

/* Day rows (DayRow) */
.day { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.day.past { opacity: 0.55; }
.dnum { width: 50px; flex: none; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.dnum .n { font: 700 24px "Fredoka", sans-serif; width: 40px; height: 34px; display: grid; place-items: center; position: relative; }
.dnum .w { font: 700 10px "Fredoka", sans-serif; letter-spacing: 1px; color: var(--muted); }
.day.today .dnum .n, .day.today .dnum .w { color: var(--m-brick); }
.dnum .circle { position: absolute; left: -1px; top: -1px; width: 42px; height: 36px; overflow: visible; fill: none; stroke: var(--m-brick); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.items { flex: 1; min-width: 0; min-height: 44px; padding-top: 4px; display: flex; flex-direction: column; gap: 2px; align-items: stretch; }
.more { align-self: flex-start; background: none; border: 0; cursor: pointer; font: 700 14px "Fredoka", sans-serif; color: var(--link) !important; padding: 4px 6px; }

.day.short { align-items: baseline; padding: 6px 0; opacity: 0.55; cursor: pointer; background: none; border: 0; width: 100%; text-align: left; }
.day.short .sn { width: 50px; flex: none; display: flex; justify-content: center; align-items: baseline; gap: 4px; }
.day.short .sn b { font: 700 15px "Fredoka", sans-serif; }
.day.short .sn span { font: 700 10px "Fredoka", sans-serif; letter-spacing: 1px; color: var(--muted); }
.day.short .line { font: 17px "Patrick Hand", cursive; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* One mark (EntryRow) */
.entry { display: flex; align-items: baseline; gap: 7px; padding: 3px 6px; border-radius: 6px; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.entry.fresh { background: var(--mark); animation: land 0.45s cubic-bezier(.3, 1.6, .5, 1) both; transform-origin: left center; }
@keyframes land { from { transform: scale(1.25) rotate(-4deg); } to { transform: none; } }
.entry.done { opacity: 0.55; }
.entry .pins { display: inline-flex; gap: 1px; flex: none; align-self: flex-start; margin-top: 5px; }
.entry .t { font: 700 14px "Fredoka", sans-serif; flex: none; }
.entry .body { min-width: 0; display: flex; flex-direction: column; }
.entry .txt { font: 21px/1.15 "Patrick Hand", cursive; overflow-wrap: anywhere; }
.entry.cont .txt { color: var(--muted); font-size: 18px; }
.entry .cap { font: 500 11px "Fredoka", sans-serif; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .cap b { font: 700 11px "Fredoka", sans-serif; }
.struck { position: relative; }
.struck::after { content: ""; position: absolute; left: -2px; right: -2px; top: calc(50% - 3px); height: 6px; pointer-events: none;
  background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M0 4 C30 1 70 5 100 2' fill='none' stroke='%234a3726' stroke-opacity='.75' stroke-width='1.8' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }

/* A person's pin: their color and their own shape (PersonPin) */
.pin { width: 16px; height: 16px; flex: none; overflow: visible; filter: drop-shadow(0 1px 1px rgb(90 64 34 / 0.3)); }
.pin * { stroke: var(--line); stroke-width: 2; stroke-linejoin: round; }

/* Masking tape label (TapeLabel) */
.tape { display: inline-block; margin: 26px 0 10px; padding: 5px 14px; font: 700 14px "Fredoka", sans-serif; letter-spacing: 1.5px; text-transform: uppercase; background: var(--tape);
  transform: rotate(-2deg); filter: drop-shadow(0 1px 1.5px rgb(90 64 34 / 0.25));
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 10%, 100% 20%, 100% 20%, calc(100% - 3px) 30%, 100% 40%, calc(100% - 3px) 50%, 100% 60%, calc(100% - 3px) 70%, 100% 80%, calc(100% - 3px) 90%, 100% 100%, 0 100%, 3px 90%, 0 80%, 3px 70%, 0 60%, 3px 50%, 0 40%, 3px 30%, 0 20%, 3px 10%); }

/* Sticky notes (stickyNote, BoardNotes) */
.sticky { position: relative; padding: 16px 16px 12px; margin-top: 6px; color: var(--sticky-ink); background: var(--n-yellow); box-shadow: 0 2px 6px rgb(90 64 34 / 0.3); transform: rotate(var(--a, -1.2deg)); }
.sticky::before { content: ""; position: absolute; top: -6px; left: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--pin, var(--m-brick));
  box-shadow: inset 0 0 0 1.5px rgb(122 96 70 / 0.85), 0 2px 3px rgb(90 64 34 / 0.35); }
.sticky::after { content: ""; position: absolute; top: -3px; left: calc(50% - 5px); width: 5px; height: 5px; border-radius: 50%; background: rgb(255 255 255 / 0.5); }
.sticky.pink { background: var(--n-pink); } .sticky.blue { background: var(--n-blue); } .sticky.green { background: var(--n-green); } .sticky.orange { background: var(--n-orange); }
.slip { margin-bottom: 14px; font: 19px/1.3 "Patrick Hand", cursive; }
.slip a, .slip .link { color: var(--sticky-link); font: 700 15px "Fredoka", sans-serif; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }

.notes { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; align-items: stretch; margin-bottom: 14px; }
.notes .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bnote { width: 100%; min-height: 80px; text-align: left; border: 0; cursor: pointer; font: 21px/1.2 "Patrick Hand", cursive; color: var(--sticky-ink) !important; }
.bnote .from { display: block; text-align: right; font-size: 18px; opacity: 0.8; margin-top: 6px; }
.bnote .pinned-label { display: flex; align-items: center; gap: 4px; font: 700 10px "Fredoka", sans-serif; letter-spacing: 1px; color: var(--sticky-link); margin-bottom: 6px; }
.bnote .pinned-what { display: flex; align-items: baseline; gap: 6px; }
.bnote .pinned-when { display: block; font: 500 12px "Fredoka", sans-serif; opacity: 0.8; margin-top: 6px; }
.add-note { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 56px; padding: 0 14px; background: none; cursor: pointer; font: 700 15px "Fredoka", sans-serif;
  border: 1.5px dashed var(--line); border-radius: 6px; margin-top: 6px; flex: 1; }
.add-note.compact { min-height: 40px; display: inline-flex; margin: 0 0 14px; }
.add-note svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }

/* The pen line (PenLineBar) */
.pen { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--card); border-top: 1.5px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.pen[hidden] { display: none; }
.pen > * { max-width: 588px; margin-left: auto; margin-right: auto; }
.pen-preview { margin-bottom: 8px; padding: 0 4px; font: 500 14px "Fredoka", sans-serif; }
.pen-preview:empty { display: none; }
.pen-preview b { font-weight: 700; }
.pen-row { display: flex; gap: 10px; align-items: center; }
.pen-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; }
.pen-field svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linejoin: round; }
.pen-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 18px "Patrick Hand", cursive; }
.pen-field input::placeholder { color: var(--muted); }
.pen-field:focus-within { outline: 2px solid var(--m-brick); outline-offset: 1px; }

/* Buttons (ChunkyButtonStyle) and fields (PaperField) */
.chunky-btn { display: block; width: 100%; padding: 13px 18px; font: 700 18px "Fredoka", sans-serif; color: var(--card) !important; background: var(--ink); border: 2px solid var(--line); border-radius: 12px; cursor: pointer;
  box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 3px 8px rgb(90 64 34 / 0.28); }
.chunky-btn:active { transform: translateY(1.5px); box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 1px 3px rgb(90 64 34 / 0.18); }
.chunky-btn.light { background: var(--card); color: var(--ink) !important; }
.chunky-btn.danger { background: var(--card); color: var(--m-brick) !important; }
.chunky-btn.google { background: var(--card); color: var(--ink) !important; display: flex; align-items: center; justify-content: center; gap: 10px; }
.chunky-btn.google svg { width: 20px; height: 20px; }
.chunky-btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; min-width: 0; }
.plain-btn { background: none; border: 0; cursor: pointer; font: 700 16px "Fredoka", sans-serif; color: var(--muted) !important; padding: 6px; }
.plain-btn.link { color: var(--link) !important; }
.plain-btn.brick { color: var(--m-brick) !important; }
.field { width: 100%; padding: 10px 12px; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: 8px; font: 500 15px "Fredoka", sans-serif; }
.field:focus { outline: 2px solid var(--m-brick); outline-offset: 1px; }
.field.hand { font: 20px "Patrick Hand", cursive; }
.field-label { display: block; font: 700 15px "Fredoka", sans-serif; margin-bottom: 8px; }
.hint { font: 500 13px "Fredoka", sans-serif; color: var(--muted); }
.error { font: 500 13px "Fredoka", sans-serif; color: var(--sticky-link); }

/* Signing in: the yellow note the app shows before there's a board (StartBoardSlip) */
.welcome { max-width: 440px; margin: 20px auto 0; display: flex; flex-direction: column; gap: 12px; }
.welcome h1 { font: 700 26px/1.2 "Fredoka", sans-serif; margin: 0; color: var(--sticky-ink); }
.welcome p { margin: 0; font: 19px/1.3 "Patrick Hand", cursive; }
.welcome .code { text-transform: uppercase; letter-spacing: 4px; font: 700 22px "Fredoka", sans-serif; }
.welcome .error, .welcome .hint { color: var(--sticky-ink); }
.welcome .error { color: var(--sticky-link); }

/* Chips (KidChip) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; font: 700 14px "Fredoka", sans-serif;
  box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 3px 6px rgb(90 64 34 / 0.2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--card) !important; transform: rotate(-2deg); }
.chip .pin { width: 13px; height: 13px; }
.idea { padding: 6px 12px; border: 0; background: var(--n-yellow); cursor: pointer; font: 19px "Patrick Hand", cursive; color: var(--sticky-ink) !important; box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 3px 6px rgb(90 64 34 / 0.2); }

/* Name stickers (Sticker) */
.sticker { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 2.5px solid var(--card); color: var(--card); font: 700 14px "Fredoka", sans-serif; transform: rotate(-3deg);
  box-shadow: 0 1px 1px rgb(90 64 34 / 0.12), 0 3px 6px rgb(90 64 34 / 0.25); }

/* Sheets: a card from the bottom on phones, a card in the middle on wide screens */
dialog.sheet { width: min(560px, 100%); max-height: min(88vh, 900px); padding: 0; border: 1.5px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink);
  box-shadow: 0 10px 40px rgb(14 11 8 / 0.35); overflow: auto; }
dialog.sheet::backdrop { background: rgb(30 25 19 / 0.45); }
@media (max-width: 600px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; border-bottom: 0; }
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 20px 12px; border-bottom: 1.5px solid var(--line); }
.sheet-head h2 { font: 700 24px/1.2 "Fredoka", sans-serif; margin: 0; }
.sheet-head p { margin: 2px 0 0; font: 500 14px "Fredoka", sans-serif; color: var(--muted); }
.sheet-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 22px; }
.sheet-foot { padding: 14px 20px 16px; border-top: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.sheet-foot .plain-btn { align-self: center; }
.detail { padding: 26px 22px 12px; display: flex; flex-direction: column; gap: 14px; }
.detail h2 { display: flex; align-items: baseline; gap: 10px; margin: 0; font: 32px/1.15 "Patrick Hand", cursive; overflow-wrap: anywhere; }
.detail h2 .pin { width: 22px; height: 22px; }
.detail .when { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 500 16px "Fredoka", sans-serif; }
.detail .quote { padding: 12px; background: var(--paper); border: 1.5px dashed var(--cork); border-radius: 8px; color: var(--muted); font: 15px/1.4 Georgia, serif; }
.detail .quote mark { background: var(--n-yellow); color: var(--sticky-ink); }
.detail .actions { display: flex; flex-direction: column; gap: 12px; padding-top: 30px; }
.note-editor { font: 26px/1.25 "Patrick Hand", cursive; color: var(--sticky-ink); }
.note-editor textarea { width: 100%; min-height: 120px; border: 0; outline: 0; resize: none; background: none; color: var(--sticky-ink); font: inherit; }
dialog.sheet .note-editor textarea:focus-visible { outline: none; }
.note-editor textarea::placeholder { color: rgb(43 33 24 / 0.5); }
.note-editor .count { text-align: right; font: 500 12px "Fredoka", sans-serif; opacity: 0.7; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font: 500 15px "Fredoka", sans-serif; }
.check input { width: 18px; height: 18px; accent-color: var(--m-brick); }
.menu-list { display: flex; flex-direction: column; gap: 12px; }
.who-line { font: 500 14px "Fredoka", sans-serif; color: var(--muted); overflow-wrap: anywhere; }

.kb :focus-visible, dialog.sheet :focus-visible { outline: 2px solid var(--m-brick); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .entry.fresh { animation: none; }
}
.idea.pink { background: var(--n-pink); } .idea.blue { background: var(--n-blue); } .idea.green { background: var(--n-green); } .idea.orange { background: var(--n-orange); }
