/* Horizon color belongs to window chrome and the outer canvas. Existing card,
   reading-pane, field, and personal Theme Studio colors remain authoritative. */
body.fm-horizon-theme {
  --fm-finish-canvas:
    radial-gradient(ellipse at 100% 100%,color-mix(in srgb,var(--theme-accent,#d1a564) 10%,transparent),transparent 62%),
    linear-gradient(155deg,color-mix(in srgb,var(--horizon-mid,#326a76) 12%,#fffaf3),#fffaf3 22%,color-mix(in srgb,var(--horizon-light,#add9dc) 38%,#fffaf3) 54%,color-mix(in srgb,var(--horizon-mid,#326a76) 44%,#fff3de));
  --fm-finish-hero:
    radial-gradient(ellipse at 100% 0%,color-mix(in srgb,var(--theme-accent,#d1a564) 18%,transparent),transparent 68%),
    linear-gradient(112deg,var(--horizon-dark,#143a4a),color-mix(in srgb,var(--horizon-mid,#326a76) 70%,#132439) 72%,color-mix(in srgb,var(--horizon-mid,#326a76) 60%,#132439));
}

body.fm-horizon-theme #desktop :is(#win-calendar,#win-control,#win-people-connection) {
  background:var(--fm-finish-canvas)!important;
  border-color:color-mix(in srgb,var(--horizon-light,#add9dc) 30%,#20334b)!important;
  box-shadow:0 24px 64px #030b1755,0 4px 14px #030b1726,inset 0 1px 0 #ffffff24!important;
}
body.fm-horizon-theme #desktop :is(#win-calendar,#win-control,#win-people-connection) > .titlebar {
  background:var(--fm-finish-hero)!important;
  border-bottom:1px solid #ffffff30!important;
  box-shadow:inset 0 1px 0 #ffffff30,0 2px 9px #1021321a!important;
}
body.fm-horizon-theme #desktop :is(#win-calendar,#win-control,#win-people-connection) > .titlebar > :first-child {
  color:#fffaf5!important;
  text-shadow:0 1px 2px #07162455;
}

/* These three surfaces are the gaps around the existing white cards. */
body.fm-horizon-theme #desktop :is(#win-calendar > .fm-cal-body,#win-control .ts-main,#win-people-connection > .pc2-layout) {
  background:var(--fm-finish-canvas)!important;
}

/* Raised cream headers sit in the light end of the surrounding Horizon wash. */
body.fm-horizon-theme #desktop :is(#win-calendar,#win-people-connection) .fm-surface-heading {
  background:linear-gradient(110deg,#fffdf8,#fff9ef 70%,color-mix(in srgb,var(--theme-accent,#d1a564) 12%,#fffdf8))!important;
  color:#302d2a!important;
  border:1px solid color-mix(in srgb,var(--horizon-mid,#326a76) 22%,#fffaf3)!important;
  box-shadow:0 7px 20px #18364a1c,inset 0 1px 0 #ffffff!important;
}
body.fm-horizon-theme #desktop :is(#win-calendar,#win-people-connection) .fm-surface-heading h2 {
  color:#302d2a!important;
}
body.fm-horizon-theme #desktop :is(#win-calendar,#win-people-connection) .fm-surface-heading :is(p,.fm-feature-eyebrow) {
  color:#625951!important;
  opacity:1!important;
}

/* Only text directly on a colored canvas needs a new foreground. */
body.fm-horizon-theme #desktop #win-calendar > .fm-cal-body > .fm-cal-toolbar .fm-cal-period {
  color:#302d2a!important;
}
body.fm-horizon-theme #desktop #win-calendar > .fm-cal-body > #fm-cal-feedback {
  color:#302d2a!important;
}
body.fm-horizon-theme #desktop #win-calendar > .fm-cal-body > #fm-cal-feedback[data-error="true"] {
  color:#51151d!important;
}
body.fm-horizon-theme #desktop #win-control .ts-main :is(.ts-section-title,.fm-theme-collection-head p,.fm-theme-edition,.fm-horizon-note):not(:where(.ts-card *,.ts-hero *,.fm-theme-card *,.fm-studio-entry *)) {
  color:#302d2a!important;
}
