/* TFH six tactile palettes. Shared by resident and staff demos. */
:root {
 --tfp-page:#b7ceda;--tfp-surface:#d1e4ed;--tfp-surface-alt:#b7d8e5;
 --tfp-well:#a9c8d7;--tfp-bright:#edfaff;--tfp-border:#eaf9ff;
 --tfp-rail-a:#294a62;--tfp-rail-b:#172d44;--tfp-hero-a:#294a62;--tfp-hero-b:#4e7f8f;
 --tfp-primary:#29677d;--tfp-primary-light:#acd9e6;--tfp-primary-dark:#204d64;
 --tfp-muted:#46616e;--tfp-ink:#203d50;--tfp-contrast:#d9eff5;
 --tfp-lift:5px 8px 17px #25485a32,-4px -4px 10px #f4ffffcc,inset 1px 2px 2px #ffffff8a;
}
:root[data-tfh-palette="purple"]{
 --tfp-page:#cfc4df;--tfp-surface:#e5dbef;--tfp-surface-alt:#d5c4e5;--tfp-well:#c8b4dd;
 --tfp-bright:#faf5ff;--tfp-border:#f9f0ff;--tfp-rail-a:#59436d;--tfp-rail-b:#302743;
 --tfp-hero-a:#55446b;--tfp-hero-b:#816b9b;--tfp-primary:#695087;--tfp-primary-light:#d4bfea;
 --tfp-primary-dark:#523970;--tfp-muted:#65566c;--tfp-ink:#352a47;--tfp-contrast:#eee3f8;
}
:root[data-tfh-palette="red"]{
 --tfp-page:#e6c5c8;--tfp-surface:#f3dfe1;--tfp-surface-alt:#e9c8cb;--tfp-well:#e1b9be;
 --tfp-bright:#fff6f6;--tfp-border:#fff1f2;--tfp-rail-a:#74424c;--tfp-rail-b:#45272e;
 --tfp-hero-a:#713e4a;--tfp-hero-b:#ac6e76;--tfp-primary:#923d53;--tfp-primary-light:#efbac5;
 --tfp-primary-dark:#732d42;--tfp-muted:#76535c;--tfp-ink:#482831;--tfp-contrast:#f9e2e6;
}
:root[data-tfh-palette="orange"]{
 --tfp-page:#e6cdb9;--tfp-surface:#f5e6d6;--tfp-surface-alt:#ecd2b9;--tfp-well:#e2c1a3;
 --tfp-bright:#fffaf2;--tfp-border:#fff7eb;--tfp-rail-a:#7a5236;--tfp-rail-b:#483322;
 --tfp-hero-a:#805434;--tfp-hero-b:#ad825c;--tfp-primary:#995a2e;--tfp-primary-light:#f2c69d;
 --tfp-primary-dark:#754323;--tfp-muted:#745944;--tfp-ink:#4a3324;--tfp-contrast:#f9e8d4;
}
:root[data-tfh-palette="yellow"]{
 --tfp-page:#e7ddbb;--tfp-surface:#f5edcf;--tfp-surface-alt:#eadead;--tfp-well:#dbd09a;
 --tfp-bright:#fffef2;--tfp-border:#fffde7;--tfp-rail-a:#6b6040;--tfp-rail-b:#403c29;
 --tfp-hero-a:#6c6341;--tfp-hero-b:#a49a67;--tfp-primary:#76601f;--tfp-primary-light:#f0de8d;
 --tfp-primary-dark:#584817;--tfp-muted:#68604b;--tfp-ink:#423b24;--tfp-contrast:#faf2d2;
}
:root[data-tfh-palette="green"]{
 --tfp-page:#bfd6c7;--tfp-surface:#dcebe0;--tfp-surface-alt:#bfdfc9;--tfp-well:#accdb7;
 --tfp-bright:#f5fff7;--tfp-border:#edfff1;--tfp-rail-a:#3a654e;--tfp-rail-b:#224133;
 --tfp-hero-a:#38644d;--tfp-hero-b:#659981;--tfp-primary:#346f53;--tfp-primary-light:#ace0bf;
 --tfp-primary-dark:#28563f;--tfp-muted:#4c6b59;--tfp-ink:#264332;--tfp-contrast:#e1f3e6;
}
/* Common theme selector */
.tfh-palette-card{margin-block:20px!important;min-width:0!important;padding:clamp(18px,3vw,24px)!important;border:1px solid var(--tfp-border)!important;border-radius:22px!important;background:linear-gradient(145deg,var(--tfp-surface),var(--tfp-surface-alt))!important;box-shadow:var(--tfp-lift)!important;color:var(--tfp-ink)!important}
.tfh-palette-card legend{font-weight:850;font-size:1.05rem;margin-bottom:8px;letter-spacing:-.02em;color:var(--tfp-ink)!important}
.tfh-palette-card p{margin:0 0 17px!important;font-size:.87rem;color:var(--tfp-muted)!important;line-height:1.5}
.tfh-palette-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px!important;width:100%;max-width:540px}
.tfh-palette-option{display:flex;align-items:center;justify-content:flex-start;flex-direction:column;gap:8px;padding:13px 5px!important;min-height:104px;position:relative;min-width:0;border:1px solid var(--tfp-border);border-radius:18px!important;box-shadow:var(--tfp-lift);color:var(--tfp-ink)!important;background:linear-gradient(145deg,var(--tfp-bright),var(--tfp-surface));font-weight:800;font-size:.86rem;cursor:pointer}
.tfh-palette-option[aria-pressed="true"]{outline:3px solid var(--tfp-primary-dark)!important;outline-offset:2px!important;background:var(--tfp-contrast)!important}
.tfh-palette-option:focus-visible{outline:3px solid var(--tfp-primary-dark)!important;outline-offset:3px!important}
.tfh-palette-swatch{width:43px;height:43px;border-radius:15px;display:grid;place-items:center;box-shadow:4px 5px 9px #00000024,inset 2px 2px 3px #ffffffa6,inset -2px -3px 3px #00000020;border:1.5px solid #ffffffd4;font-weight:950;font-size:21px}
.tfh-palette-option[aria-pressed="true"]::after{content:"✓";position:absolute;right:9px;top:6px;color:var(--tfp-primary-dark);font-size:16px}
.tfh-palette-swatch[data-colour=blue]{background:linear-gradient(140deg,#d7ecf5,#84b6ca);color:#23475b}
.tfh-palette-swatch[data-colour=purple]{background:linear-gradient(140deg,#f0e6fb,#ae8fc7);color:#4c3266}
.tfh-palette-swatch[data-colour=red]{background:linear-gradient(140deg,#fbe5e7,#d5929d);color:#732c42}
.tfh-palette-swatch[data-colour=orange]{background:linear-gradient(140deg,#fff0d9,#dfa76d);color:#73441d}
.tfh-palette-swatch[data-colour=yellow]{background:linear-gradient(140deg,#fff8d3,#e8cf78);color:#66531e}
.tfh-palette-swatch[data-colour=green]{background:linear-gradient(140deg,#e9fae8,#8ec2a0);color:#27593e}
.resident-shell .resident-settings fieldset:has(.resident-accent-setting){display:none!important}
/* Palette application: recolour the clay/fabric materials, not content imagery */
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) body{background:radial-gradient(ellipse at 80% 4%,var(--tfp-bright),transparent 46%),var(--tfp-page)!important;color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell{
 --bg:var(--tfp-page);--card:var(--tfp-surface);--card2:var(--tfp-surface-alt);
 --text:var(--tfp-ink);--muted:var(--tfp-muted);--line:var(--tfp-well);
 --primary:var(--tfp-primary-dark);--primary-soft:var(--tfp-primary-light);
 --accent:var(--tfp-primary-dark);--accent-soft:var(--tfp-primary-light);--accent-subtle:var(--tfp-surface);
 --accent-border:var(--tfp-primary);--on-accent:#fff;
 --tf-canvas:var(--tfp-page);--tf-navy:var(--tfp-rail-a);--tf-navy-deep:var(--tfp-rail-b);
 --tf-slate:var(--tfp-primary);--tf-fabric:var(--tfp-surface);--tf-card:var(--tfp-surface);
 --tf-teal:var(--tfp-primary);--tf-text:var(--tfp-ink);--tf-secondary:var(--tfp-muted);
 --tf-elevate:var(--tfp-lift);--tf-small:var(--tfp-lift);
 background:radial-gradient(ellipse at 85% 4%,var(--tfp-bright),transparent 43%),radial-gradient(ellipse at 1% 100%,var(--tfp-surface-alt),transparent 39%),var(--tf-grain),var(--tfp-page)!important;
 color:var(--tfp-ink)!important;
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell .resident-header{
 background:linear-gradient(120deg,var(--tfp-bright),var(--tfp-surface))!important;color:var(--tfp-ink)!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell .resident-bottom-nav{background:linear-gradient(155deg,var(--tfp-rail-a),var(--tfp-rail-b))!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell .resident-nav-item{color:#f7f7f7!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell .resident-nav-item.is-active{background:var(--tfp-contrast)!important;color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell .resident-nav-icon,
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell .resident-header-actions .resident-icon-button,
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-group-icon,.resident-support-icon,.resident-notification-icon,.resident-post-avatar,.hub-avatar){
 background:linear-gradient(140deg,var(--tfp-bright),var(--tfp-primary-light))!important;color:var(--tfp-primary-dark)!important;border-color:var(--tfp-border)!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-post-surface,.resident-feed-post .resident-post-surface,.resident-event-card,.resident-group-card,.resident-collection,.resident-learn-card,.resident-notification,.resident-action-needed,.resident-support-link,.resident-progress-card,.resident-progress-categories section,.guidance-question,.guidance-pathway>li,.guidance-tutorial-card,.resident-journal-entry,.resident-journey-item,.resident-showcase-settings,.resident-qr-card,.resident-settings fieldset,.resident-about-card,.resident-privacy-panel,.hub-profile-header,.hub-next,.hub-summary,.hub-quick-actions a,.resident-calendar-panel,.resident-calendar-day){
 background-color:var(--tfp-surface)!important;background-image:linear-gradient(145deg,#ffffff37,transparent 63%),var(--tf-grain)!important;box-shadow:var(--tfp-lift)!important;border-color:var(--tfp-border)!important;color:var(--tfp-ink)!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-group-hero,.tfh-hero){
 background:linear-gradient(120deg,var(--tfp-hero-a),var(--tfp-hero-b))!important;color:#fff!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-group-hero,.tfh-hero) :is(h1,h2,h3,p,small,strong){color:#fff!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell .tfh-quicklink:nth-child(n){background:linear-gradient(140deg,var(--tfp-primary-light),var(--tfp-surface))!important;color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.tfh-quicklink-icon,.resident-button:not(.resident-button--danger),.resident-action-button,.resident-feed-tabs button[aria-selected=true],.resident-segmented button[aria-selected=true],.resident-segmented button[aria-pressed=true]){
 background:linear-gradient(145deg,var(--tfp-bright),var(--tfp-primary-light))!important;color:var(--tfp-primary-dark)!important;border-color:var(--tfp-border)!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-feed-tabs,.resident-segmented,.hub-profile-tabs,.discovery-tabs){background:var(--tfp-well)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-feed-tabs button,.resident-segmented button,.resident-post-context a,.resident-post-details summary,.resident-page-heading h1,.resident-page-heading p,.resident-brand strong,.resident-brand small,.resident-group-hero + * a,.resident-collection h3){color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-post-author small,.resident-post-copy p,.tfh-quicklink small,.resident-feed-cue,.resident-action-help,.resident-section-copy){color:var(--tfp-muted)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(input:not([type=checkbox]):not([type=radio]),textarea,select){background:var(--tfp-bright)!important;color:var(--tfp-ink)!important;border-color:var(--tfp-well)!important}
/* Staff uses same material tokens, no CSS filter so logo/photos are unchanged */
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) body:has(.shell){background:radial-gradient(ellipse at 85% 3%,var(--tfp-bright),transparent 48%),var(--tfp-page)!important;color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .rail{background:linear-gradient(160deg,var(--tfp-rail-a),var(--tfp-rail-b))!important;color:#fff!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .top{background:var(--tfp-surface)!important;color:var(--tfp-ink)!important;border-color:var(--tfp-border)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .top small{color:var(--tfp-muted)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .card{background:linear-gradient(140deg,var(--tfp-surface),var(--tfp-surface-alt))!important;border-color:var(--tfp-border)!important;box-shadow:var(--tfp-lift)!important;color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .card :is(h1,h2,h3,strong,b){color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .card :is(p,small){color:var(--tfp-muted)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .btn{background:linear-gradient(145deg,var(--tfp-bright),var(--tfp-primary-light))!important;color:var(--tfp-primary-dark)!important;border-color:var(--tfp-border)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .hero{background:linear-gradient(120deg,var(--tfp-hero-a),var(--tfp-hero-b))!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) :is(.links a.on,.mobile a.on){background:var(--tfp-contrast)!important;color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .mobile{background:linear-gradient(145deg,var(--tfp-rail-a),var(--tfp-rail-b))!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .notice.cool{background:var(--tfp-surface)!important;color:var(--tfp-ink)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .field :is(input,textarea,select){background:var(--tfp-bright)!important;color:var(--tfp-ink)!important;border-color:var(--tfp-well)!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .welcome-intro{background:linear-gradient(135deg,var(--tfp-rail-a),var(--tfp-rail-b))!important;color:#fff!important}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .metric b{color:var(--tfp-primary-dark)!important}
.tfh-palette-settings-link{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:7px 12px;border-radius:13px;background:var(--tfp-contrast);color:var(--tfp-ink)!important;font-size:.83rem;font-weight:780;border:1px solid var(--tfp-border);box-shadow:var(--tfp-lift)}
@media(max-width:400px){.tfh-palette-grid{gap:9px!important}.tfh-palette-option{padding:12px 2px!important;min-height:92px}.tfh-palette-swatch{width:36px;height:36px;border-radius:12px}.tfh-palette-option span:last-child{font-size:.76rem}}
@media(prefers-reduced-motion:reduce){.tfh-palette-option,.tfh-palette-settings-link{transition:none!important}}

/* Named accent affordances should follow the selected palette too. */
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-date.is-selected,.resident-month-date.is-selected,.resident-calendar-date[aria-selected="true"]){
 background:var(--tfp-primary-light)!important;border:2px solid var(--tfp-primary)!important;
 color:var(--tfp-primary-dark)!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-tag,.resident-action-button.is-selected,.resident-feed-tabs button[aria-selected="true"],.resident-segmented button[aria-selected="true"],.hub-profile-tabs a[aria-selected="true"]){
 background:var(--tfp-primary-light)!important;color:var(--tfp-primary-dark)!important;
 border-color:var(--tfp-border)!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell .tfh-hero a{
 background:linear-gradient(130deg,var(--tfp-bright),var(--tfp-primary-light))!important;
 color:var(--tfp-primary-dark)!important;border-color:var(--tfp-border)!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-calendar-panel .resident-month-toolbar button,.resident-next-actions button,.resident-activity-action,.resident-filter-pills button[aria-pressed="true"]){
 background:var(--tfp-contrast)!important;color:var(--tfp-primary-dark)!important;border-color:var(--tfp-border)!important
}
:root[data-tfh-palette]:not([data-tfh-palette="blue"]) .resident-shell :is(.resident-notification-icon,.resident-settings-icon,.resident-progress-icon){color:var(--tfp-primary-dark)!important}
