/* Mom & Calm — personal cover, Family Board, stickers, Year at a glance. */

/* ---------- cover themes (used by the cover banner and the board) ---------- */
[data-theme="blush"]     { --cv-bg: linear-gradient(135deg, #F6E3E7, #FBEFF1 55%, #F7F2EC); --cv-ink: #5B2F4A; --cv-accent: #C8607A; }
[data-theme="sage"]      { --cv-bg: linear-gradient(135deg, #DCEBDF, #EEF5EF 55%, #F7F2EC); --cv-ink: #2F4A37; --cv-accent: #5E8C6A; }
[data-theme="sky"]       { --cv-bg: linear-gradient(135deg, #DCE9F5, #EEF4FA 55%, #F7F2EC); --cv-ink: #23415E; --cv-accent: #3F7FB5; }
[data-theme="lilac"]     { --cv-bg: linear-gradient(135deg, #E8DFF4, #F3EEF9 55%, #F7F2EC); --cv-ink: #45346A; --cv-accent: #8A6BB8; }
[data-theme="sunny"]     { --cv-bg: linear-gradient(135deg, #FBEBC0, #FDF5DE 55%, #F7F2EC); --cv-ink: #5A4210; --cv-accent: #D29A1E; }
[data-theme="botanical"] {
  --cv-bg:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%235E8C6A' stroke-opacity='.22' stroke-width='1.5'%3E%3Cpath d='M20 100 C 30 70 50 60 70 58'/%3E%3Cpath d='M32 80 q 8 -12 20 -10 q -6 12 -20 10z'/%3E%3Cpath d='M48 66 q 10 -10 20 -6 q -8 10 -20 6z'/%3E%3Cpath d='M90 30 C 95 45 92 55 85 65'/%3E%3Cpath d='M92 42 q 10 2 12 12 q -10 -2 -12 -12z'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #E3EFE6, #F4F1E6);
  --cv-ink: #2F4A37; --cv-accent: #5E8C6A;
}
[data-theme="minimal"]   { --cv-bg: linear-gradient(#FFFDFA, #FFFDFA); --cv-ink: #2E1E28; --cv-accent: #2E1E28; }
[data-theme="night"]     {
  --cv-bg:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 70% 20%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 85% 70%, #fff7 50%, transparent 51%), radial-gradient(1px 1px at 40% 80%, #fff6 50%, transparent 51%),
    linear-gradient(160deg, #24223F, #3A1D30);
  --cv-ink: #F6ECEF; --cv-accent: #F0A3B5;
}

.cover {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  border-radius: var(--r-xl); background: var(--cv-bg); color: var(--cv-ink);
  border: 1px solid color-mix(in srgb, var(--cv-ink) 10%, transparent);
}
.cover[data-theme="minimal"] { box-shadow: inset 0 0 0 1px var(--line); }
.cover-photo { width: 72px; height: 72px; border-radius: 22px; object-fit: cover; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.35); flex: none; }
.cover-mark { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--cv-accent) 18%, transparent); color: var(--cv-accent); font-size: 1.8rem; }
.cover-text { flex: 1; min-width: 0; }
.cover-eyebrow { font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.75; }
.cover-title { font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2rem); color: inherit; }
.cover-edit { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); }
.cover-compact { padding: 14px 16px; }
.cover-compact .cover-photo { width: 56px; height: 56px; border-radius: 18px; }
.cover-preview { pointer-events: none; }
.cover-themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cover-theme { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 14px; cursor: pointer; font-size: var(--fs-xs); border: 1.5px solid transparent; }
.cover-swatch { width: 100%; height: 38px; border-radius: 10px; background: var(--cv-bg); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.cover-theme:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.cover-theme:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- stickers ---------- */
.cal-mtop { display: flex; justify-content: space-between; align-items: center; gap: 2px; }
.cal-stickers { font-size: 0.8rem; letter-spacing: -0.05em; line-height: 1; }
.tg-day .cal-stickers { font-size: 0.95rem; }
.sticker-row { display: flex; gap: 8px; min-height: 52px; }
.sticker-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.sticker-tabs .chip-pick { flex: none; }
.sticker-tabs .chip-pick[aria-selected="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--ink); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.sticker {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; min-height: 84px;
  border: 0; border-radius: 16px; background: var(--surface-2); color: var(--ink);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.sticker:hover { background: var(--accent-wash); transform: rotate(-4deg) scale(1.04); }
.sticker[disabled] { opacity: 0.4; }
.sticker-emoji { font-size: 2rem; line-height: 1; }
.sticker-label { font-size: 0.7rem; color: var(--ink-2); text-align: center; line-height: 1.2; }
.sticker-on { width: 52px; min-height: 52px; padding: 0; justify-content: center; font-size: 1.7rem; background: var(--gold-wash); }

/* ---------- Family Board ---------- */
.board {
  position: fixed; inset: 0; z-index: 450; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 16px; padding: 18px clamp(14px, 2vw, 28px) 24px;
  background: var(--bg); color: var(--ink); font-size: clamp(15px, 0.6rem + 0.6vw, 19px);
  animation: fade 300ms ease;
}
.board-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "fam time" "ctl ctl"; gap: 12px 20px; align-items: center; }
.board-family { grid-area: fam; display: flex; align-items: center; gap: 14px; min-width: 0; }
.board-family h1 { font-size: clamp(1.5rem, 1rem + 2vw, 2.6rem); line-height: 1.05; }
.board-photo { width: clamp(56px, 6vw, 84px); height: clamp(56px, 6vw, 84px); border-radius: 24px; object-fit: cover; box-shadow: var(--shadow-2); }
.board-mark { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); font-size: 1.8rem; }
.board-date { color: var(--ink-2); }
.board-time { grid-area: time; font-family: var(--font-display); font-variation-settings: 'SOFT' 100; font-size: clamp(2.4rem, 1.4rem + 4vw, 4.8rem); font-weight: 400; line-height: 1; color: var(--plum); }
:root[data-theme="dark"] .board-time { color: var(--accent-ink); }
.board-controls { grid-area: ctl; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.board-nav { display: flex; gap: 4px; align-items: center; }
.board-exit { margin-left: auto; position: relative; }
@media (min-width: 1100px) {
  .board-head { grid-template-columns: 1fr auto auto; grid-template-areas: "fam ctl time"; }
}

.board-body { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .board-body { grid-template-columns: minmax(0, 1fr) clamp(260px, 22vw, 340px); } }

.board-week {
  display: grid; grid-template-columns: clamp(96px, 10vw, 140px) repeat(7, minmax(110px, 1fr)); gap: 6px;
  overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; box-shadow: var(--shadow-1);
}
.bw-corner { }
.bw-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 0; border-radius: 14px;
  background: var(--surface-2); color: var(--ink-2); min-height: 72px;
}
.bw-day[data-today] { background: var(--plum); color: #FFF6F1; }
:root[data-theme="dark"] .bw-day[data-today] { background: var(--accent); color: var(--on-accent); }
.bw-num { font-size: 1.6em; color: inherit; line-height: 1; }
.bw-wd { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72em; }
.board-stickers { font-size: 1.1em; line-height: 1; }
.bw-person { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; border-radius: 14px; background: var(--m-wash); font-weight: 500; text-align: center; }
.bw-cell { display: flex; flex-direction: column; gap: 4px; min-height: 64px; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--m-wash) 45%, transparent); }
.bw-cell[data-today] { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--plum) 35%, transparent); }
.bw-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; padding: 5px 7px; border: 0; text-align: left;
  border-radius: 9px; background: var(--surface); color: var(--ink); border-left: 4px solid var(--m); font-size: 0.82em; line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.bw-chip[data-kind="birthday"] { background: var(--gold-wash); }
.bw-time { font-size: 0.85em; color: var(--ink-2); font-weight: 600; }
.bw-title { overflow-wrap: anywhere; }

.board-monthwrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-1); }
.board-month-title { font-size: 1.6em; margin-bottom: 10px; }
.board-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.bm-head { text-align: center; font-size: 0.8em; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.bm-cell {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: clamp(72px, 11vh, 120px);
  padding: 6px 8px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--ink); text-align: left; overflow: hidden;
}
.bm-cell[data-out] { background: transparent; color: var(--ink-3); }
.bm-cell[data-today] { background: var(--accent-wash); box-shadow: inset 0 0 0 2px var(--accent); }
.bm-num { font-size: 1.15em; font-weight: 600; }
.bm-cell .board-stickers { position: absolute; top: 6px; right: 8px; font-size: 1.3em; }
.bm-bday { position: absolute; bottom: 6px; right: 8px; }
.bm-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.bm-item { font-size: 0.72em; padding: 1px 6px; border-radius: 6px; background: var(--m-wash); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .bm-item { display: none; } }

.board-side { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (min-width: 1100px) { .board-side { grid-template-columns: 1fr; } }
.board-panel { padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.board-panel h2 { font-size: 1.05em; margin-bottom: 8px; }
.board-big { font-family: var(--font-display); font-variation-settings: 'SOFT' 100; font-size: 1.5em; line-height: 1.2; }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.board-list li { display: flex; align-items: center; gap: 10px; }
.board-tick { flex: none; width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--line-strong); background: var(--surface); }
.board-tick:hover { background: var(--sage); border-color: var(--m-sage); }
.board-note { padding: 10px 12px; border-radius: 12px; background: var(--gold-wash); margin-bottom: 8px; transform: rotate(-0.5deg); }
.board-bday-date { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--gold-wash); font-weight: 600; flex: none; }

/* ---------- Year at a glance ---------- */
.year-switch { display: flex; align-items: center; gap: 4px; }
.year-num { font-family: var(--font-display); font-variation-settings: 'SOFT' 100; font-size: var(--fs-2xl); min-width: 3.2em; text-align: center; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.year-month { padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 10px; }
.year-month[data-now] { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-1); }
.year-month h2 { font-size: var(--fs-lg); }
.mini-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 0.72rem; }
.mm-head { color: var(--ink-3); font-weight: 500; }
.mm-day { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; color: var(--ink-2); text-decoration: none; }
.mm-day[data-mark] { background: var(--m-wash, var(--gold-wash)); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--m, var(--gold)); }
.mm-day[data-today] { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: none; }
.year-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.year-items li { display: flex; gap: 8px; align-items: baseline; }
.year-date { width: 1.8em; text-align: right; color: var(--accent-ink); font-weight: 600; flex: none; }
.look-card { background: linear-gradient(160deg, var(--gold-wash), var(--surface) 70%); border-color: transparent; }
.look-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.look-list li { padding: 10px 14px; border-radius: 14px; background: var(--surface); font-weight: 450; }
.bucket-card { background: linear-gradient(160deg, var(--blush), var(--surface) 70%); border-color: transparent; }

/* the cover theme behind the family name on the board */
.board-family { justify-self: start; padding: 10px 22px 10px 10px; border-radius: 28px; background: var(--cv-bg); color: var(--cv-ink); }
.board-family .board-date { color: inherit; opacity: 0.8; }

@media (max-width: 480px) {
  .cover-compact { gap: 12px; padding: 12px 12px 12px 14px; }
  .cover-compact .cover-eyebrow { display: none; }
  .cover-compact .cover-title { font-size: 1.3rem; }
  .cover-compact .cover-mark { width: 44px; height: 44px; border-radius: 14px; font-size: 1.3rem; }
}
.cover-text { min-width: 0; }

/* ---------- Family Board: the exit button ---------- */
.board-exit-wrap { margin-left: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.board-exit { margin-left: 0; position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; }
.board-exit-fill { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); border-radius: 2px; }
.board-exit.holding { background: var(--accent-wash); }
.board-exit.holding .board-exit-fill { animation: exit-fill var(--hold, 2000ms) linear forwards; }
@keyframes exit-fill { to { width: 100%; } }
.board-exit-hint { font-size: 0.7rem; color: var(--ink-3); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .board-exit.holding .board-exit-fill { animation: none; width: 100%; } }
