/* Little Loves v36.7 — per-user portal colour preference + theme token bridge. */
:root{
  --theme-primary:var(--primary,#3f6f52);
  --theme-primary-text:var(--primary,#3f6f52);
  --theme-primary-dark:var(--primary-dark,#294b37);
  --theme-primary-strong:var(--primary-dark,#294b37);
  --theme-primary-soft:#eef6f0;
  --theme-primary-soft-2:#f6faf7;
  --theme-primary-border:#b8cdbf;
  --theme-on-primary:#fff;
}
/* Main interactive colour. Safety/status colours deliberately remain semantic. */
#portal .btn.primary{background:var(--theme-primary);color:var(--theme-on-primary)}
#portal .btn.primary:hover{background:var(--theme-primary-dark);color:var(--theme-on-primary)}
#portal .btn.secondary,#portal .btn.ghost,#portal .eyebrow{color:var(--theme-primary-text)}
#portal .btn.ghost{box-shadow:inset 0 0 0 1px var(--theme-primary-text)}
#portal input:focus,#portal select:focus,#portal textarea:focus{border-color:var(--theme-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-primary) 15%,transparent)}
#portal button:focus-visible,#portal input:focus-visible,#portal select:focus-visible,#portal textarea:focus-visible,#portal a:focus-visible,#portal [tabindex]:focus-visible{outline-color:color-mix(in srgb,var(--theme-primary) 38%,white)}
#portal .sidebar nav button.active,#portal .sidebar-settings-link.active{background:var(--theme-primary-strong)!important;color:var(--theme-on-primary)!important}
#portal .child-photo,#portal .v36-profile-avatar{background:var(--theme-primary-soft);color:var(--theme-primary-dark)}
#portal .segmented button.active,#portal .choice-pill:has(input:checked),#portal .curriculum-check-option:has(input:checked),#portal .parent-voice-response-option:has(input:checked),#portal .daily-child-tiles label:has(input:checked),#portal .story-activity-option:has(input:checked),#portal .daily-activity-result.selected{border-color:var(--theme-primary)!important;background:var(--theme-primary-soft)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-primary) 12%,transparent)!important}
#portal .v36-more-menu button:hover,#portal .floating-menu button:hover{background:var(--theme-primary-soft)}
#portal .v36-learning-dayparts>div>b,#portal .v36-next-action b,#portal .v36-permission-advanced>summary{color:var(--theme-primary-dark)}
#portal .v36-record-timeline>div:before{background:var(--theme-primary);box-shadow:0 0 0 1px var(--theme-primary-border)}
#portal .v366-action-topbar:not(.alert){border-color:var(--theme-primary-border);color:var(--theme-primary-dark)}
#portal .v366-workspace-quickbar,#portal .v366-system-note{border-color:var(--theme-primary-border);background:var(--theme-primary-soft-2)}

.preferences-modal.v367-preferences{width:min(720px,calc(100vw - 24px));max-height:min(88vh,820px);overflow:auto;padding-bottom:0}
.v367-pref-section{border:1px solid var(--v36-border,#d9e2dc);border-radius:14px;padding:14px;margin:14px 0;background:#fff}
.v367-pref-section>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.v367-pref-section h3{margin:0 0 3px;font-size:16px}.v367-pref-section p{margin:0;color:var(--v36-muted,#68766e);font-size:12px;line-height:1.45}
.v367-theme-mode{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-bottom:12px}
.v367-theme-mode label{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:start;border:1.5px solid var(--v36-border,#d9e2dc);border-radius:12px;padding:10px;background:#fff;cursor:pointer}
.v367-theme-mode label:has(input:checked){border-color:var(--theme-primary);background:var(--theme-primary-soft)}
.v367-theme-mode input{width:auto;min-height:0;margin-top:3px}.v367-theme-mode b,.v367-theme-mode small{display:block}.v367-theme-mode small{color:var(--v36-muted,#68766e);font-weight:500;margin-top:2px}
.v367-colour-picker{display:grid;grid-template-columns:150px 1fr;gap:12px;align-items:end}.v367-colour-picker input[type=color]{height:46px;padding:3px}.v367-colour-value{display:flex;align-items:center;gap:9px;min-height:46px;padding:7px 10px;border:1px solid var(--v36-border,#d9e2dc);border-radius:10px;background:#f8faf8}.v367-colour-dot{width:24px;height:24px;border-radius:50%;border:1px solid rgba(0,0,0,.16);flex:0 0 auto}
.v367-swatches{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.v367-swatch{width:34px;height:34px;border-radius:10px;border:2px solid #fff;box-shadow:0 0 0 1px #b8c5bd;cursor:pointer;padding:0}.v367-swatch.selected{box-shadow:0 0 0 3px var(--theme-primary)}
.v367-theme-preview{display:flex;align-items:center;gap:8px;margin-top:10px;padding:10px;border-radius:11px;border:1px solid var(--theme-primary-border);background:var(--theme-primary-soft-2)}
.v367-theme-preview .sample{background:var(--v367-preview,#3f6f52);color:var(--v367-preview-on,#fff);border-radius:9px;padding:8px 12px;font-weight:800}.v367-theme-preview small{color:var(--v36-muted,#68766e)}
.v367-pref-actions{position:sticky;bottom:0;margin:16px -34px 0;padding:12px 34px;background:rgba(255,255,255,.97);border-top:1px solid var(--v36-border,#d9e2dc);display:flex;justify-content:flex-end;gap:8px;z-index:2}
@media(max-width:680px){.preferences-modal.v367-preferences{padding:22px 16px 0}.v367-theme-mode,.v367-colour-picker{grid-template-columns:1fr}.v367-pref-actions{margin-left:-16px;margin-right:-16px;padding:12px 16px}.v367-pref-section{padding:12px}.v367-theme-preview{align-items:flex-start;flex-direction:column}}
/* ERO workspace follows the user's main portal colour for navigation only; compliance status colours stay semantic. */
.llc363 header{background:var(--theme-primary-strong,#183d39)}
.llc363>nav button.active,.llc363 .btn.primary{background:var(--theme-primary-strong,#183d39);border-color:var(--theme-primary-strong,#183d39);color:var(--theme-on-primary,#fff)}
.llc363 .criterion.priority{border-left-color:var(--theme-primary-text,#477d70)}
