/* Whole-dashboard palettes. Member and calendar identity colors stay distinct. */
body[data-skin] {
  --canvas:#fff9ed; --ink:#243653; --muted:#596d83; --accent:#e07865; --strong:#243653; --on-strong:#fff;
  --surface:#fffdf8; --card-one:#eef6ff; --card-two:#fffae9; --card-three:#f3fcf5; --spotlight:#fff3ed;
  --line:#e6dfd1; --banner:#dff4e8; --badge:#e6efe7; --glow:#fff0b8; --motif:url('/themes/base.svg');
  color:var(--ink); background:radial-gradient(ellipse at 90% 0,var(--glow),transparent 55%),var(--canvas);
  min-height:100dvh; accent-color:var(--accent); color-scheme:light;
}
body[data-skin="labor"] { --canvas:#fff8df; --ink:#19354e; --muted:#506376; --accent:#b34a1b; --strong:#1b3d60; --surface:#fffefd; --card-one:#deebf7; --card-two:#ffdf7f; --card-three:#ffe5cc; --spotlight:#fff2ba; --line:#bfbd9d; --banner:#1b3d60; --badge:#ffdf7f; --glow:#ffde89; --hero:#1b3d60; --hero-two:#315d7b; --section-one:#1b3d60; --section-two:#9a3f17; --section-three:#1b3d60; --trim:#ffc02a; --motif:url('/themes/labor.svg'); --pattern:url('/themes/patterns/labor.svg'); }
body[data-skin="memorial"] { --canvas:#ffffff; --ink:#203b59; --muted:#55677e; --accent:#ba263e; --strong:#203e65; --surface:#ffffff; --card-one:#e3ebf7; --card-two:#fae3e7; --card-three:#edf1f8; --spotlight:#ffffff; --line:#bdcadc; --banner:#203e65; --badge:#e1eaf8; --glow:#eaf0fa; --hero:#203e65; --hero-two:#324f71; --section-one:#203e65; --section-two:#b1253c; --section-three:#203e65; --trim:#c7a55d; --motif:url('/themes/memorial.svg'); --pattern:url('/themes/patterns/memorial.svg'); }
body[data-skin="july4"] { --canvas:#ffffff; --ink:#143465; --muted:#506582; --accent:#cc233a; --strong:#194b9b; --surface:#ffffff; --card-one:#dae9ff; --card-two:#ffe0e5; --card-three:#e3edff; --spotlight:#ffffff; --line:#abc2e2; --banner:#164b9c; --badge:#dfebff; --glow:#e9f0ff; --hero:#164b9c; --hero-two:#cd233b; --section-one:#164b9c; --section-two:#c8223b; --section-three:#164b9c; --trim:#ffffff; --motif:url('/themes/july4.svg'); --pattern:url('/themes/patterns/july4.svg'); }
body[data-skin="halloween"] { --canvas:#fff1d9; --ink:#2d193b; --muted:#6a516c; --accent:#a34206; --strong:#572282; --surface:#fffaf0; --card-one:#e7d6f5; --card-two:#ffd395; --card-three:#e3d5f1; --spotlight:#fff1d9; --line:#bc96d3; --banner:#572282; --badge:#ffd395; --glow:#ffd292; --hero:#321847; --hero-two:#7434a5; --section-one:#572282; --section-two:#9a3c06; --section-three:#321847; --trim:#fb9728; --motif:url('/themes/halloween.svg'); --pattern:url('/themes/patterns/halloween.svg'); }
body[data-skin="thanksgiving"] { --canvas:#fff1d6; --ink:#59301d; --muted:#79563b; --accent:#b34c1c; --strong:#8c3d21; --surface:#fffdf5; --card-one:#f7d9a8; --card-two:#ffe7a3; --card-three:#e1e7be; --spotlight:#fff1d1; --line:#d7ae70; --banner:#934220; --badge:#f3d27f; --glow:#ffcf6d; --hero:#8c3d21; --hero-two:#a34b22; --section-one:#8c3d21; --section-two:#9d4a0c; --section-three:#526326; --trim:#e8b246; --motif:url('/themes/thanksgiving.svg'); --pattern:url('/themes/patterns/thanksgiving.svg'); }
body[data-skin="easter"] { --canvas:#f9f3ff; --ink:#513269; --muted:#71577d; --accent:#8c369e; --strong:#7e3aa2; --surface:#fffefd; --card-one:#e6d5fa; --card-two:#fbd5e7; --card-three:#d4f0dc; --spotlight:#fff4ce; --line:#cab0df; --banner:#7e3aa2; --badge:#f8db86; --glow:#fff0a9; --hero:#7e3aa2; --hero-two:#a73777; --section-one:#7e3aa2; --section-two:#a73777; --section-three:#247348; --trim:#f0c854; --motif:url('/themes/easter.svg'); --pattern:url('/themes/patterns/easter.svg'); }
body[data-skin="christmas"] { --canvas:#ffffff; --ink:#173e2d; --muted:#4b6557; --accent:#c71f38; --strong:#08733f; --surface:#ffffff; --card-one:#e0f2e5; --card-two:#fde5e8; --card-three:#e0f2e5; --spotlight:#ffffff; --line:#9fc5aa; --banner:#08733f; --badge:#d5eddf; --glow:#e2f5e6; --hero:#08733f; --hero-two:#b61c34; --section-one:#08733f; --section-two:#bd1834; --section-three:#08733f; --trim:#e2b74a; --motif:url('/themes/christmas.svg'); --pattern:url('/themes/patterns/christmas.svg'); }
body[data-skin="birthday"] { --canvas:#fff2f8; --ink:#58216c; --muted:#77547e; --accent:#bd2472; --strong:#8e30b6; --surface:#fffefd; --card-one:#ead5fb; --card-two:#ffe597; --card-three:#cef1ee; --spotlight:#ffe1ef; --line:#d1a5df; --banner:#9b30a6; --badge:#ffdf78; --glow:#ffe4ac; --hero:#a12b8c; --hero-two:#6332af; --section-one:#8434b3; --section-two:#b22b76; --section-three:#147e85; --trim:#ffce45; --motif:url('/themes/birthday.svg'); --pattern:url('/themes/patterns/birthday.svg'); }
body[data-skin]:not([data-skin="base"])::before { content:''; position:fixed; inset:0; pointer-events:none; z-index:0; opacity:.20; background-image:var(--pattern,var(--motif)); background-size:100px 100px; background-position:36px 18px; }
.shell { position:relative; z-index:1; }
body[data-skin] .brand-icon { background:transparent; border-radius:0; width:56px; height:56px; flex-shrink:0; }
.brand-icon img { width:100%; height:100%; display:block; filter:drop-shadow(0 3px 0 #0000000c); }
body[data-skin] h1, body[data-skin] h2, body[data-skin] h3 { color:var(--ink); }
body[data-skin] .brand small, body[data-skin] .muted, body[data-skin] .suggestion p, body[data-skin] .event-details small, body[data-skin] .suggestion-source, body[data-skin] .recently-bought-heading { color:var(--muted); }
body[data-skin] .widget { border-color:var(--line); box-shadow:0 5px 0 color-mix(in srgb,var(--ink) 8%,transparent); }
body[data-skin] .widget.important { background:var(--spotlight); }
body[data-skin] .widget.calendar { background:var(--card-one); }
body[data-skin] .widget.shopping { background:var(--card-two); }
body[data-skin] .widget.tasks { background:var(--card-three); }
body[data-skin] .suggestion, body[data-skin] .item { background:var(--surface); }
body[data-skin] .badge { background:var(--badge); color:var(--ink); }
body[data-skin] .event, body[data-skin] .agenda-group + .agenda-group, body[data-skin] #calendar-picker, body[data-skin] .birthday-candidate { border-color:var(--line); }
body[data-skin] .quiet, body[data-skin] .check, body[data-skin] .add-form input, body[data-skin] .add-form select, body[data-skin] .due-date, body[data-skin] .quantity, body[data-skin] .item-category, body[data-skin] .assignee-choice, body[data-skin] .suggestion-assignee, body[data-skin] .unlock-form select, body[data-skin] .member-edit-form input, body[data-skin] .member-edit-form select, body[data-skin] #settings-body > select, body[data-skin] .access-card input, body[data-skin] .birthday-candidate select { background:var(--surface); border-color:var(--line); color:var(--ink); }
body[data-skin] .add-form button, body[data-skin] .access-card button[type="submit"], body[data-skin] .unlock-form button { background:var(--strong); color:var(--on-strong); }
body[data-skin] .item.done .check { background:var(--banner); border-color:var(--accent); color:var(--ink); }
body[data-skin] input::placeholder { color:var(--muted); opacity:1; }
body[data-skin] :is(button,input,select,a,summary):focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
body[data-skin] .settings-dialog, body[data-skin] dialog.admin-panel, body[data-skin] .access-card, body[data-skin] .skin-options, body[data-skin] .dashboard-menu[open] > .header-actions { background:var(--surface); border-color:var(--line); color:var(--ink); }
body[data-skin] .dashboard-menu .header-actions > button, body[data-skin] .dashboard-menu .header-actions > a { color:var(--ink); }
body[data-skin] .dashboard-menu .header-actions > button:hover, body[data-skin] .dashboard-menu .header-actions > a:hover { background:var(--card-one); }
body[data-skin] .admin-panel .family { background:transparent; box-shadow:none; }
body[data-skin] dialog::backdrop { background:color-mix(in srgb,var(--ink) 48%,transparent); }
body[data-skin] .remove { color:var(--muted); }
body[data-skin] .sync-status { background:var(--spotlight); color:var(--ink); border:1px solid var(--line); }
@media(max-width:650px) { body[data-skin] .brand-icon { width:44px; height:44px; } }

/* Seasonal colors extend through the header, data panels, and controls. */
body[data-skin]:not([data-skin="base"]) .topbar {
  padding: 10px 16px; border-radius: 21px;
  background: var(--hero); border-bottom: 4px solid var(--trim);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--hero) 14%, transparent);
}
body[data-skin]:not([data-skin="base"]) .topbar :is(.brand h1, .brand small, #today, .topbar-quote, .quote-byline) { color: #fff; }
body[data-skin]:not([data-skin="base"]) .brand-icon { width: 60px; height: 60px; }
body[data-skin]:not([data-skin="base"], .shopping-view) .grid .widget { padding-block-start: 0; }
body[data-skin]:not([data-skin="base"]) .important { --panel-color: var(--hero); }
body[data-skin]:not([data-skin="base"]) .calendar { --panel-color: var(--section-one); }
body[data-skin]:not([data-skin="base"]) .shopping { --panel-color: var(--section-two); }
body[data-skin]:not([data-skin="base"]) .tasks { --panel-color: var(--section-three); }
body[data-skin]:not([data-skin="base"]) .grid .widget > .widget-head {
  background: var(--panel-color);
  padding: 4px var(--panel-padding);
  margin-inline: calc(-1 * var(--panel-padding));
  border-bottom: 2px solid var(--trim);
}
body[data-skin]:not([data-skin="base"]) .grid .widget > .widget-head h2 { color: white; margin: 0; }
body[data-skin]:not([data-skin="base"]) .important .suggestion { border: 1px solid var(--line); border-left: 4px solid var(--accent); }
body[data-skin]:not([data-skin="base"]) .item { border: 1px solid var(--line); }
body[data-skin]:not([data-skin="base"]) :is(.add-form input, .add-form select, .check) { border-color: color-mix(in srgb, var(--accent) 38%, white); }
body[data-skin]:not([data-skin="base"]) .add-form button { background: var(--panel-color); }
body[data-skin]:not([data-skin="base"]) .check { border-width: 2px; }
body[data-skin]:not([data-skin="base"]) .item.done .check { background: var(--strong); border-color: var(--strong); color: white; }
body[data-skin] .item-author { color: var(--muted); }
body[data-skin] .item-link { color: var(--strong); }
body[data-skin="christmas"] .grid .widget { border-color: #16804a; }
body[data-skin="christmas"] .widget.shopping { border-color: #cb263d; }
body[data-skin="christmas"] .topbar { border-bottom: 5px solid transparent; border-image: repeating-linear-gradient(120deg,#fff 0 10px,#d42a40 10px 20px) 5; border-radius: 18px 18px 0 0; }
body[data-skin="halloween"] .grid .widget { border-color: #6d3a8d; }
body[data-skin="halloween"] .shopping { border-color: #d27528; }
body[data-skin="labor"] .topbar { border-bottom: 5px solid transparent; border-image: repeating-linear-gradient(120deg,#ffc02a 0 10px,#1b3d60 10px 20px) 5; border-radius: 18px 18px 0 0; }
body[data-skin].shopping-view #shopping > .widget-head { margin: 0 0 12px; border-radius: 14px; padding: 14px; }
@media(max-width:850px) {
  body[data-skin]:not([data-skin="base"]) .topbar { padding: 10px 12px; }
  body[data-skin]:not([data-skin="base"]) .brand-icon { width: 48px; height: 48px; }
}

/* Leave room for the piles above the headers and below the dashboard. */
body.has-snow:not(.shopping-view) .shell {
  padding-block: max(22px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-bottom));
}
body.has-snow:not(.shopping-view) .grid { row-gap: 22px; }
body.has-snow :is(.topbar, .sync-status) { margin-bottom: 22px; }
body.has-snow.shopping-view #shopping {
  padding-block: max(22px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-bottom));
}
.christmas-snow {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
body.shopping-view .christmas-snow { z-index: 101; }
.christmas-flakes { width: 100%; height: 100%; }
.snow-drift {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  pointer-events: auto;
  touch-action: none;
  touch-action: pinch-zoom;
  user-select: none;
  cursor: grab;
}
.snow-drift:active { cursor: grabbing; }

@media (min-width: 851px) and (max-width: 1400px) and (orientation: landscape) and (any-pointer: coarse) {
  body[data-skin]:not([data-skin="base"], .shopping-view) .topbar { padding: 5px 12px; }
  body[data-skin]:not(.shopping-view) .brand-icon { width: 46px; height: 46px; }
}
